Skip to content

Commit

Permalink
Reorganize QSIRecon atlases into a BIDS-Atlas dataset (#9)
Browse files Browse the repository at this point in the history
* Use new version of QSIRecon atlases.

* Change location of AtlasPack.
  • Loading branch information
tsalo authored Oct 17, 2024
1 parent 0ffcd5d commit 2e55b68
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
37 changes: 20 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -211,30 +211,33 @@ RUN python fetch_templates.py && \
find $HOME/.cache/templateflow -type d -exec chmod go=u {} + && \
find $HOME/.cache/templateflow -type f -exec chmod go=u {} +

# Precaching AtlasPack atlases
RUN mkdir /AtlasPack
COPY --from=atlaspack /AtlasPack/tpl-fsLR_*.dlabel.nii /AtlasPack/
COPY --from=atlaspack /AtlasPack/tpl-MNI152NLin6Asym_*.nii.gz /AtlasPack/
COPY --from=atlaspack /AtlasPack/tpl-MNI152NLin2009cAsym_*.nii.gz /AtlasPack/
COPY --from=atlaspack /AtlasPack/atlas-4S*.tsv /AtlasPack/
COPY --from=atlaspack /AtlasPack/*.json /AtlasPack/
# Make it ok for singularity on CentOS
RUN strip --remove-section=.note.ABI-tag /opt/qt512/lib/libQt5Core.so.5.12.8 \
&& ldconfig

# Prepare atlases
RUN mkdir /atlas

# Download the AtlasPack atlases
RUN mkdir /atlas/AtlasPack
COPY --from=atlaspack /AtlasPack/tpl-fsLR_*.dlabel.nii /atlas/AtlasPack/
COPY --from=atlaspack /AtlasPack/tpl-MNI152NLin6Asym_*.nii.gz /atlas/AtlasPack/
COPY --from=atlaspack /AtlasPack/tpl-MNI152NLin2009cAsym_*.nii.gz /atlas/AtlasPack/
COPY --from=atlaspack /AtlasPack/atlas-4S*.tsv /atlas/AtlasPack/
COPY --from=atlaspack /AtlasPack/*.json /atlas/AtlasPack/
ENV QSIRECON_ATLASPACK /atlas/AtlasPack

# Reformat AtlasPack into a BIDS dataset
COPY scripts/fix_atlaspack.py fix_atlaspack.py
RUN python fix_atlaspack.py && rm fix_atlaspack.py

# Make it ok for singularity on CentOS
RUN strip --remove-section=.note.ABI-tag /opt/qt512/lib/libQt5Core.so.5.12.8 \
&& ldconfig

# Download the built-in atlases
ENV QSIRECON_ATLAS /atlas/qsirecon_atlases
RUN bash -c \
'mkdir /atlas \
&& cd /atlas \
&& wget -nv https://upenn.box.com/shared/static/40f2m6dzzd8co5jx3cxpgct3zkkwm5d3.xz \
&& tar xvfJm 40f2m6dzzd8co5jx3cxpgct3zkkwm5d3.xz \
&& rm 40f2m6dzzd8co5jx3cxpgct3zkkwm5d3.xz'
'cd /atlas \
&& wget -nv https://upenn.box.com/shared/static/5k1tvg6soelxdhi9nvrkry6w0z49ctne.xz \
&& tar xvfJm 5k1tvg6soelxdhi9nvrkry6w0z49ctne.xz \
&& rm 5k1tvg6soelxdhi9nvrkry6w0z49ctne.xz'
ENV QSIRECON_ATLAS /atlas/qsirecon_atlases

# Download the PyAFQ atlases
RUN pyAFQ download
Expand Down
2 changes: 1 addition & 1 deletion scripts/fix_atlaspack.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

if __name__ == "__main__":
# Where all the files are located
in_dir = "/AtlasPack"
in_dir = os.getenv("QSIRECON_ATLASPACK")

with open(os.path.join(in_dir, "dataset_description.json"), "w") as fo:
json.dump(
Expand Down

0 comments on commit 2e55b68

Please sign in to comment.