forked from freesurfer/freesurfer
-
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.
Modifications to support infant pipeline and building samseg atlases (f…
…reesurfer#924) * [FIX] making infant stream compatible with latest niftireg (1.3.9) * [WIP] adding binaries needed for infant stream * [WIP] more robust cmake setings * [WIP] cmake support for INFANT_MODULE AND MINIMAL * [WIP] reverting niftyreg tweak now that version is correct * [WIP] adding infant stream python reqs * [WIP] neurodocker entrypoint * [FIX] entrypoint * [FIX] entrypoint perm fix * [WIP] updating infant py reqs * [WIP] install infant entrypoint * [FIX] fs dir structure * [FIX] harden against top-level files in subject dir * [ENH] to support samseg vis * [WIP] inital attempt at recalc script * [WIP] cleanup and argparse * [FIX] std:: namespace ref * [WIP] helpful debug msg * [WIP] comments and cleanup * [TXT] helpful debug/processing msg * [FIX] semicolons * [WIP] infant entrypoint for aws initial test * [WIP] match fs env vars and infant input fname reqs * [WIP] installing infant entrypoint script for aws * [ENH] New env var: SSCNN_MODEL_DIR Used to overide the default location of sscnn_skullstrip model files * [FIX] indent * [WIP] exposing params to comand line * [WIP] syntax * [WIP] tweaks to support additional command line params * [WIP] connecting numIterations and edgeCollapseFactor params * [WIP] syntax * [ENH] making `prepareAtlasDirectory.py` callable from command line * [GIT] removing `recompute_atlas_probs` (superceded by `gems_compute_atlas_probs`)
- Loading branch information
Showing
10 changed files
with
156 additions
and
261 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
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,55 @@ | ||
#!/bin/bash | ||
|
||
# TODO: remove `FS_INFANT_MODEL` (no longer needed?) | ||
echo "===============================================================" | ||
echo "ENVIRONMENT VARIABLES" | ||
echo "" | ||
echo "AWS_BATCH_JOB_ID: $AWS_BATCH_JOB_ID" | ||
echo "AWS_BATCH_JQ_NAME: $AWS_BATCH_JQ_NAME" | ||
echo "AWS_BATCH_CE_NAME: $AWS_BATCH_CE_NAME" | ||
echo "---------------------------------------------------------------" | ||
echo "FREESURFER_HOME: $FREESURFER_HOME" | ||
echo "FS_INFANT_MODEL: $FS_INFANT_MODEL" | ||
echo "SUBJECTS_DIR: $SUBJECTS_DIR" | ||
echo "FS_SUB_NAME: $FS_SUB_NAME" | ||
echo "SSCNN_MODEL_DIR: $SSCNN_MODEL_DIR" | ||
echo "---------------------------------------------------------------" | ||
echo "FS_NIFTI_INPUT_S3_FILEPATH: $FS_NIFTI_INPUT_S3_FILEPATH" | ||
echo "FS_NIFTI_INPUT_LOCAL_FILEPATH: $FS_NIFTI_INPUT_LOCAL_FILEPATH" | ||
echo "FS_OUTPUT_S3_FILEPATH: $FS_OUTPUT_S3_FILEPATH" | ||
echo "===============================================================" | ||
|
||
# infant pipeline input must be ${SUBJECTS_DIR}:${FS_SUB_NAME}/mprage.nii.gz | ||
if [ -n "${SUBJECTS_DIR}" ] && [ -n "${FS_SUB_NAME}" ]; then | ||
echo "---------------------------------------------------------------" | ||
echo "SUBJECTS_DIR and FS_SUB_NAME detected. Attempting to make dir" | ||
echo "mkdir -p ${SUBJECTS_DIR}/${FS_SUB_NAME}" | ||
mkdir -p ${SUBJECTS_DIR}/${FS_SUB_NAME} | ||
echo "---------------------------------------------------------------" | ||
fi | ||
|
||
if [ -n "${FS_NIFTI_INPUT_S3_FILEPATH}" ] && [ -n "${FS_NIFTI_INPUT_LOCAL_FILEPATH}" ]; then | ||
echo "---------------------------------------------------------------" | ||
echo "FS_NIFTI_INPUT_S3_FILEPATH and FS_NIFTI_INPUT_LOCAL_FILEPATH detected. Attempting to copy file locally" | ||
echo "aws s3 cp ${FS_NIFTI_INPUT_S3_FILEPATH} ${FS_NIFTI_INPUT_LOCAL_FILEPATH}" | ||
aws s3 cp $FS_NIFTI_INPUT_S3_FILEPATH $FS_NIFTI_INPUT_LOCAL_FILEPATH | ||
echo "---------------------------------------------------------------" | ||
fi | ||
|
||
# Symlink the volume_mounted model files to where FreeSurfer expects them | ||
# PW 2021/11/18 No longer needed, since `SSCNN_MODEL_DIR` can now be used in `sscnn_skullstrip` | ||
# ----------------------------------------------------------------------- | ||
#mkdir -p $FREESURFER_HOME/average/sscnn_skullstripping | ||
#ln -s $FS_INFANT_MODEL/sscnn_skullstrip/cor_sscnn.h5 $FREESURFER_HOME/average/sscnn_skullstripping/cor_sscnn.h5 | ||
#ln -s $FS_INFANT_MODEL/sscnn_skullstrip/ax_sscnn.h5 $FREESURFER_HOME/average/sscnn_skullstripping/ax_sscnn.h5 | ||
#ln -s $FS_INFANT_MODEL/sscnn_skullstrip/sag_sscnn.h5 $FREESURFER_HOME/average/sscnn_skullstripping/sag_sscnn.h5 | ||
|
||
eval "$@" | ||
|
||
if [ -n "${FS_OUTPUT_S3_FILEPATH}" ]; then | ||
echo "---------------------------------------------------------------" | ||
echo "FS_OUTPUT_S3_FILEPATH detected. Attempting to copy the subjects_dir to s3:" | ||
echo "aws s3 cp --recursive ${SUBJECTS_DIR}/${FS_SUB_NAME} ${FS_OUTPUT_S3_FILEPATH}" | ||
aws s3 cp --recursive ${SUBJECTS_DIR}/${FS_SUB_NAME} ${FS_OUTPUT_S3_FILEPATH} | ||
echo "---------------------------------------------------------------" | ||
fi |
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 |
---|---|---|
@@ -1,9 +1,22 @@ | ||
#!/bin/bash | ||
|
||
# TODO: remove `FS_INFANT_MODEL` (no longer needed?) | ||
echo "===============================================================" | ||
echo "ENVIRONMENT VARIABLES" | ||
echo "" | ||
echo "FREESURFER_HOME: $FREESURFER_HOME" | ||
echo "FS_INFANT_MODEL: $FS_INFANT_MODEL" | ||
echo "SUBJECTS_DIR: $SUBJECTS_DIR" | ||
echo "FS_SUB_NAME: $FS_SUB_NAME" | ||
echo "SSCNN_MODEL_DIR: $SSCNN_MODEL_DIR" | ||
echo "===============================================================" | ||
|
||
# Symlink the volume_mounted model files to where FreeSurfer expects them | ||
mkdir -p $FREESURFER_HOME/average/sscnn_skullstripping | ||
ln -s $FS_INFANT_MODEL/sscnn_skullstrip/cor_sscnn.h5 $FREESURFER_HOME/average/sscnn_skullstripping/cor_sscnn.h5 | ||
ln -s $FS_INFANT_MODEL/sscnn_skullstrip/ax_sscnn.h5 $FREESURFER_HOME/average/sscnn_skullstripping/ax_sscnn.h5 | ||
ln -s $FS_INFANT_MODEL/sscnn_skullstrip/sag_sscnn.h5 $FREESURFER_HOME/average/sscnn_skullstripping/sag_sscnn.h5 | ||
# PW 2021/11/18 No longer needed, since `SSCNN_MODEL_DIR` can now be used in `sscnn_skullstrip` | ||
# ----------------------------------------------------------------------- | ||
#mkdir -p $FREESURFER_HOME/average/sscnn_skullstripping | ||
#ln -s $FS_INFANT_MODEL/sscnn_skullstrip/cor_sscnn.h5 $FREESURFER_HOME/average/sscnn_skullstripping/cor_sscnn.h5 | ||
#ln -s $FS_INFANT_MODEL/sscnn_skullstrip/ax_sscnn.h5 $FREESURFER_HOME/average/sscnn_skullstripping/ax_sscnn.h5 | ||
#ln -s $FS_INFANT_MODEL/sscnn_skullstrip/sag_sscnn.h5 $FREESURFER_HOME/average/sscnn_skullstripping/sag_sscnn.h5 | ||
|
||
eval "$@" |
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 |
---|---|---|
|
@@ -16,3 +16,7 @@ pandas | |
matplotlib | ||
transforms3d | ||
scikit-image==0.16.2 | ||
|
||
## Samseg vis | ||
pyqtgraph | ||
PyQt5 |
Oops, something went wrong.