-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add workbench to qsirecon (#6) * Update Dockerfile * Update Dockerfile * update amico * continued * update mamba repo * Install c3d with mamba (#8) * Install c3d and ants with mamba. * Update Dockerfile_Micromamba * Drop ANTS install. * Reformat AtlasPack into a BIDS-Atlas dataset (#7) Reformat AtlasPack into a BIDS-Atlas dataset. * Reorganize QSIRecon atlases into a BIDS-Atlas dataset (#9) * Use new version of QSIRecon atlases. * Change location of AtlasPack. --------- Co-authored-by: Matt Cieslak <[email protected]> Co-authored-by: Taylor Salo <[email protected]>
- Loading branch information
1 parent
0ce99d7
commit b4a1ec6
Showing
6 changed files
with
203 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Copied from: fMRIPrep Docker Container Image distribution | ||
# | ||
# MIT License | ||
# | ||
# Copyright (c) 2021 The NiPreps Developers | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
|
||
FROM nvidia/cuda:11.2.2-devel-ubuntu18.04 | ||
ARG TAG_ANTS | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
ca-certificates \ | ||
curl \ | ||
libblas-dev \ | ||
liblapack-dev \ | ||
build-essential \ | ||
libglu1-mesa-dev \ | ||
bzip2 \ | ||
libgomp1 \ | ||
wget | ||
|
||
# Create a shared $HOME directory | ||
RUN useradd -m -s /bin/bash -G users qsiprep | ||
WORKDIR /home/qsiprep | ||
ENV HOME="/home/qsiprep" | ||
|
||
WORKDIR / | ||
RUN echo "2024.04.11" | ||
RUN curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba | ||
|
||
ENV MAMBA_ROOT_PREFIX="/opt/conda" \ | ||
MAMBA_NO_LOW_SPEED_LIMIT=1 \ | ||
PIP_DEFAULT_TIMEOUT=100 | ||
|
||
COPY qsirecon_env.yml /tmp/env.yml | ||
|
||
WORKDIR /tmp | ||
RUN micromamba config set extract_threads 1 | ||
RUN micromamba create -vv -y -f /tmp/env.yml | ||
ENV PATH=/opt/conda/envs/qsiprep/bin:$PATH | ||
RUN micromamba clean -y -a | ||
|
||
RUN mkdir -p ${HOME}/.dipy \ | ||
&& python -c "import amico; amico.core.setup()" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: qsiprep | ||
channels: | ||
- conda-forge | ||
dependencies: | ||
- mkl | ||
- mkl-service | ||
- numpy=1.23.5 | ||
- scipy=1.11 | ||
- fury | ||
# Workflow dependencies: Convert3d | ||
- convert3d=1.4 | ||
# Python dependencies | ||
- python=3.10 | ||
- pip | ||
- pip: | ||
- bids-validator==1.14.1 | ||
- coverage | ||
- dipy==1.8.0 | ||
- dmri-amico==2.0.3 | ||
- jinja2==3.0.3 | ||
- keras==2.8.0 | ||
- matplotlib==3.8.3 | ||
- nibabel==5.2.1 | ||
- nilearn==0.10.1 | ||
- nipype==1.8.6 | ||
- niworkflows >=1.9,<= 1.10 | ||
- numpy==1.23.5 | ||
- pandas==1.5.3 | ||
- pillow==10.3.0 | ||
- pyafq==1.3.2 | ||
- pytest==8.2.2 | ||
- pytest-cov==5.0.0 | ||
- pytest-env==1.1.3 | ||
- protobuf==3.19.6 | ||
- scikit-image==0.22.0 | ||
- scikit-learn==1.4.0 | ||
- sentry-sdk==1.40.6 | ||
- simpleitk==2.3.1 | ||
- sqlalchemy==2.0.27 | ||
- templateflow==23.1.0 | ||
- tensorflow-gpu==2.8.4 | ||
- torch==1.13.1 | ||
- transforms3d==0.4.1 | ||
- trx-python==0.2.9 | ||
- xvfbwrapper==0.2.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
"""Convert the AtlasPack folder into a BIDS dataset.""" | ||
|
||
import json | ||
import os | ||
import re | ||
import shutil | ||
|
||
if __name__ == "__main__": | ||
# Where all the files are located | ||
in_dir = os.getenv("QSIRECON_ATLASPACK") | ||
|
||
with open(os.path.join(in_dir, "dataset_description.json"), "w") as fo: | ||
json.dump( | ||
{"Name": "AtlasPack", "BIDSVersion": "1.9.0", "DatasetType": "atlas"}, | ||
fo, | ||
) | ||
|
||
# Define patterns and corresponding target formats | ||
patterns = [ | ||
(r"atlas-([a-zA-Z0-9+]+)_dseg.tsv", r"atlas-\1/atlas-\1_dseg.tsv"), | ||
( | ||
r"tpl-MNI152NLin6Asym_atlas-([a-zA-Z0-9+]+)_res-01_dseg.nii.gz", | ||
r"atlas-\1/atlas-\1_space-MNI152NLin6Asym_res-01_dseg.nii.gz", | ||
), | ||
( | ||
r"tpl-MNI152NLin2009cAsym_atlas-([a-zA-Z0-9+]+)_res-01_dseg.nii.gz", | ||
r"atlas-\1/atlas-\1_space-MNI152NLin2009cAsym_res-01_dseg.nii.gz", | ||
), | ||
( | ||
r"tpl-fsLR_atlas-([a-zA-Z0-9+]+)_den-91k_dseg.dlabel.nii", | ||
r"atlas-\1/atlas-\1_space-fsLR_den-91k_dseg.dlabel.nii", | ||
), | ||
( | ||
r"tpl-MNI152NLin6Asym_atlas-([a-zA-Z0-9+]+)_dseg.json", | ||
r"atlas-\1/atlas-\1_space-MNI152NLin6Asym_res-01_dseg.json", | ||
), | ||
( | ||
r"tpl-MNI152NLin2009cAsym_atlas-([a-zA-Z0-9+]+)_dseg.json", | ||
r"atlas-\1/atlas-\1_space-MNI152NLin2009cAsym_res-01_dseg.json", | ||
), | ||
( | ||
r"tpl-fsLR_atlas-([a-zA-Z0-9+]+)_dseg.json", | ||
r"atlas-\1/atlas-\1_space-fsLR_den-91k_dseg.json", | ||
), | ||
] | ||
|
||
for pattern, target_format in patterns: | ||
files = [f for f in os.listdir(in_dir) if re.search(pattern, f)] | ||
for filename in files: | ||
atlas_name = re.findall(pattern, filename)[0] | ||
target_dir = os.path.join(in_dir, f"atlas-{atlas_name}") | ||
target_path = os.path.join(in_dir, target_format.replace(r"\1", atlas_name)) | ||
|
||
# Create target directory if it doesn't exist | ||
os.makedirs(target_dir, exist_ok=True) | ||
|
||
# Move and rename the file | ||
shutil.move(os.path.join(in_dir, filename), target_path) | ||
print(f"Moved {filename} to {target_path}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters