diff --git a/README.md b/README.md index c8d69f1..ffb2480 100644 --- a/README.md +++ b/README.md @@ -138,12 +138,19 @@ repository. To run the analysis using Apptainer: ```bash -apptainer run --bind "${PWD}":/data hh-enigmapd-2025/enigma-pd-wml/enigma-pd-wml: +apptainer run --bind "${PWD}":/data library://hh-enigmapd-2025/enigma-pd-wml/enigma-pd-wml: ``` where `` is the version of the image you would like to pull. -Note, the image will be downloaded from Sylabs Cloud the first time you run a particular version of the +It can sometime be slow to pull the image from Sylabs Cloud. If you would prefer to pull the Docker image +from Docker Hub and build and run a local Apptainer image, you can run the following command: + +```bash +apptainer run --bind "${PWD}":/data docker://hamiedaharoon24/enigma-pd-wml: +``` + +Note, the image will be downloaded from Sylabs Cloud (or Docker Hub) the first time you run a particular version of the image. ### Options @@ -216,11 +223,19 @@ These zip files should contain six files: - `results2min_lin_perivent.nii.gz`: WML segmentations (periventricular) linearly transformed to MNI space. -- `results2mni_nonlin.nii.gz`: WML segmentations non-linearly transformed to MNI space. +- `results2mni_nonlin.nii.gz`: WML segmentations non-linearly warped to MNI space. + +- `results2min_nonlin_deep.nii.gz`: WML segmentations (deep white matter) non-linearly warped to MNI space. + +- `results2mni_nonlin_perivent.nii.gz`: WML segmentations (periventricular) non-linearly warped to MNI space. + +- `T1_biascorr_brain_to_MNI_lin.nii.gz`: T1 bias-corrected brain linearly transformed to MNI space. + +- `FLAIR_biascorr_brain_to_MNI_lin.nii.gz`: FLAIR bias-corrected brain linearly transformed to MNI space. -- `results2min_nonlin_deep.nii.gz`: WML segmentations (deep white matter) non-linearly transformed to MNI space. +- `T1_biascorr_brain_to_MNI_nonlin.nii.gz`: T1 bias-corrected brain non-linearly warped to MNI space. -- `results2mni_nonlin_perivent.nii.gz`: WML segmentations (periventricular) non-linearly transformed to MNI space. +- `FLAIR_biascorr_brain_to_MNI_nonlin.nii.gz`: FLAIR bias-corrected brain non-linearly warped to MNI space. #### Top-level zip file diff --git a/analysis_script.sh b/analysis_script.sh index d3adaf2..bf59eb4 100644 --- a/analysis_script.sh +++ b/analysis_script.sh @@ -209,6 +209,10 @@ function processOutputs(){ "${data_outpath}"/output/results2mni_nonlin.nii.gz "${data_outpath}"/output/results2mni_nonlin_deep.nii.gz "${data_outpath}"/output/results2mni_nonlin_perivent.nii.gz + "${data_outpath}"/output/T1_biascorr_brain_to_MNI_lin.nii.gz + "${data_outpath}"/output/FLAIR_biascorr_brain_to_MNI_lin.nii.gz + "${data_outpath}"/output/T1_biascorr_brain_to_MNI_nonlin.nii.gz + "${data_outpath}"/output/FLAIR_biascorr_brain_to_MNI_nonlin.nii.gz ) if [ "$overwrite" = false ] && allFilesExist "${output_files[@]}" then @@ -232,6 +236,8 @@ function processOutputs(){ cp ${data_outpath}/input/vent_dist_mapping/dwm_t1brain.nii.gz . cp ${data_outpath}/input/vent_dist_mapping/perivent_flairbrain.nii.gz . cp ${data_outpath}/input/vent_dist_mapping/dwm_flairbrain.nii.gz . + cp ${data_outpath}/input/t1-mni.anat/T1_biascorr_brain.nii.gz . + cp ${data_outpath}/input/flair-bet/flairvol2t1brain.nii.gz . tree ${data_outpath}/input/ @@ -279,6 +285,14 @@ function processOutputs(){ -out results2mni_lin_deep \ -paddingsize 0.0 -interp nearestneighbour -ref MNI152_T1_1mm_brain.nii.gz + flirt -in T1_biascorr_brain.nii.gz -applyxfm -init T1_to_MNI_lin.mat \ + -out T1_biascorr_brain_to_MNI_lin \ + -paddingsize 0.0 -interp trilinear -ref MNI152_T1_1mm_brain.nii.gz + + flirt -in flairvol2t1brain.nii.gz -applyxfm -init T1_to_MNI_lin.mat \ + -out FLAIR_biascorr_brain_to_MNI_lin \ + -paddingsize 0.0 -interp trilinear -ref MNI152_T1_1mm_brain.nii.gz + echo "STEP 05" # run FSL's applywarp tool to nonlinearly warp WML segmentations with MNI T1 @@ -294,6 +308,14 @@ function processOutputs(){ --out=results2mni_nonlin_deep \ --interp=nn --ref=${FSLDIR}/data/standard/MNI152_T1_1mm_brain.nii.gz + applywarp --in=T1_biascorr_brain.nii.gz --warp=T1_to_MNI_nonlin_coeff.nii.gz \ + --out=T1_biascorr_brain_to_MNI_nonlin \ + --interp=trilinear --ref=${FSLDIR}/data/standard/MNI152_T1_1mm_brain.nii.gz + + applywarp --in=flairvol2t1brain.nii.gz --warp=T1_to_MNI_nonlin_coeff.nii.gz \ + --out=FLAIR_biascorr_brain_to_MNI_nonlin \ + --interp=trilinear --ref=${FSLDIR}/data/standard/MNI152_T1_1mm_brain.nii.gz + echo all done! echo } @@ -347,7 +369,11 @@ function runAnalysis (){ processOutputs cd ${data_outpath}/output - zip -q ../${subject}_${session}_results.zip results2mni_lin*.nii.gz results2mni_nonlin*.nii.gz + zip -q ../${subject}_${session}_results.zip \ + results2mni_lin*.nii.gz \ + results2mni_nonlin*.nii.gz \ + T1_biascorr_brain_to_MNI_*lin.nii.gz \ + FLAIR_biascorr_brain_to_MNI_*lin.nii.gz }