From ef471512aff8ec37a71fea15abc0c65d4801cd6e Mon Sep 17 00:00:00 2001 From: pcamach2 <49655443+pcamach2@users.noreply.github.com> Date: Tue, 3 Dec 2019 10:43:28 -0600 Subject: [PATCH 01/12] Add files via upload This script is intended to run from the directory that contains the data for your subjects in order to create the file structure expected in the Analyze directory of each subject to run pipeline_example: SubjectsDirectory/ Subject/ Analyze/ bet_notunbiased/ bet_multispectral/ unbiased/ sienax_no2fast/ lesions_no2fast/ --- file_structure.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 file_structure.sh diff --git a/file_structure.sh b/file_structure.sh new file mode 100644 index 0000000..4628a38 --- /dev/null +++ b/file_structure.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +#run from subjects directory +for SUB in 001 002 003 004 005 +do + mkdir ./${SUB}/Analyze/unbiased + mkdir ./${SUB}/Analyze/bet_notunbiased + mkdir ./${SUB}/Analyze/lesions_no2fast + mkdir ./${SUB}/Analyze/bet_multispectral + mkdir ./${SUB}/Analyze/sienax_no2fast +done \ No newline at end of file From 90f94a4b9811290ef679fb95f9e56fdc49796461 Mon Sep 17 00:00:00 2001 From: pcamach2 <49655443+pcamach2@users.noreply.github.com> Date: Mon, 9 Dec 2019 16:32:56 -0600 Subject: [PATCH 02/12] Create outputRemoval.sh --- outputRemoval.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 outputRemoval.sh diff --git a/outputRemoval.sh b/outputRemoval.sh new file mode 100644 index 0000000..4edec99 --- /dev/null +++ b/outputRemoval.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +WorkDir=/path/to/dataDirectory + +#cleans out all results of pipeline_example except for dcm2niix outputs +for SUB in 001 002 003 004 005 +do + cd ${WorkDir}/${SUB}/Analyze/unbiased + rm ./* + cd ${WorkDir}/${SUB}/Analyze/bet_notunbiased + rm ./* + cd ${WorkDir}/${SUB}/Analyze/lesions_no2fast + rm ./* + cd ${WorkDir}/${SUB}/Analyze/bet_multispectral + rm ./* + cd ${WorkDir}/${SUB}/Analyze/sienax_no2fast + rm ./* +done From acdb55c7902ad298a42138110853cd28d3097ea1 Mon Sep 17 00:00:00 2001 From: pcamach2 <49655443+pcamach2@users.noreply.github.com> Date: Mon, 9 Dec 2019 16:42:28 -0600 Subject: [PATCH 03/12] Update pipeline_example Modified to run dcm2niix on SPACE and MPRAGE. Note that the first time that bet_nw runs, there will not yet be a lesionmapT2 to overlay and this will produce an error. --- pipeline_example | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pipeline_example b/pipeline_example index 735a1a4..8269cc7 100755 --- a/pipeline_example +++ b/pipeline_example @@ -12,16 +12,19 @@ args="Js* TheraStride* Exert* METS* " #args="METS_[0-9][0-9]_[0-9][0-9][0-9][0-9 args+="-numthreads auto -memory 32 -maxthreads 24 -analysis Analyze -v" #args=$subs+$args -nwpipe "dcm2nii -m N ../SPACE" \ +nwpipe "dcm2niix -m N -x y -z y ../SPACE" \ $args -numthreads 1 \ - -in ../SPACE -out ../SPACE/o*.nii.gz + -in ../SPACE -out ../SPACE/*_Crop_1.nii.gz nwpipe "unbias T2.nii.gz" \ $args -outdir unbiased \ - -in ../SPACE/o*.nii.gz T2.nii.gz \ + -in ../SPACE/*_Crop_1.nii.gz T2.nii.gz \ -out T2_unbiased.nii.gz +nwpipe "dcm2niix -m N -x y -z y ../MPRAGE" \ + $args -numthreads 1 \ + -in ../MPRAGE -out ../MPRAGE/*_Crop_1.nii.gz nwpipe "unbias T1.nii.gz" \ $args -outdir unbiased \ - -in ../MPRAGE/o*.nii.gz T1.nii.gz \ + -in ../MPRAGE/*_Crop_1.nii.gz T1.nii.gz \ -out T1_unbiased.nii.gz nwpipe "bet_nw ../unbiased/T2 t2_brain -R -png -d -s -m -f 0.4 -g -0.2" \ $args -outdir bet_notunbiased \ From d9ae72c833496d22b2ae715b1637f65062052bf3 Mon Sep 17 00:00:00 2001 From: pcamach2 <49655443+pcamach2@users.noreply.github.com> Date: Mon, 9 Dec 2019 21:31:44 -0600 Subject: [PATCH 04/12] Update slicer_nw Specified location of T2_unbiased and lesionmapT2 --- slicer_nw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slicer_nw b/slicer_nw index c0c288b..f6ad9df 100755 --- a/slicer_nw +++ b/slicer_nw @@ -53,7 +53,7 @@ if [ -n "$overlaycmd" ]; then overlay $overlaycmd fi - overlay 0 0 T2_unbiased -a lesionmapT2 0.9 1.1 lesionmapT2 0.9 1.1 overlay + overlay 0 0 ../unbiased/T2_unbiased -a ../lesions_no2fast/lesionmapT2 0.9 1.1 lesionmapT2 0.9 1.1 overlay midx=$(fslstats $in -C | cut -d" " -f1 | cut -d"." -f1) for it in {1..18}; do From e5706927ca9679425d140efa82cd0bc34512ba97 Mon Sep 17 00:00:00 2001 From: pcamach2 <49655443+pcamach2@users.noreply.github.com> Date: Tue, 10 Dec 2019 08:41:29 -0600 Subject: [PATCH 05/12] Update slicer_nw --- slicer_nw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slicer_nw b/slicer_nw index f6ad9df..6afd611 100755 --- a/slicer_nw +++ b/slicer_nw @@ -53,7 +53,7 @@ if [ -n "$overlaycmd" ]; then overlay $overlaycmd fi - overlay 0 0 ../unbiased/T2_unbiased -a ../lesions_no2fast/lesionmapT2 0.9 1.1 lesionmapT2 0.9 1.1 overlay + overlay 0 0 ../unbiased/T2_unbiased.nii.gz -a ../lesions_no2fast/lesionmapT2.nii.gz 0.9 1.1 lesionmapT2 0.9 1.1 overlay midx=$(fslstats $in -C | cut -d" " -f1 | cut -d"." -f1) for it in {1..18}; do From 4d9e8c0ec9d9a9827d1ea423d24e0cf62b52c8dd Mon Sep 17 00:00:00 2001 From: pcamach2 <49655443+pcamach2@users.noreply.github.com> Date: Tue, 10 Dec 2019 09:28:12 -0600 Subject: [PATCH 06/12] Update outputRemoval.sh --- outputRemoval.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/outputRemoval.sh b/outputRemoval.sh index 4edec99..d8c450a 100644 --- a/outputRemoval.sh +++ b/outputRemoval.sh @@ -6,13 +6,13 @@ WorkDir=/path/to/dataDirectory for SUB in 001 002 003 004 005 do cd ${WorkDir}/${SUB}/Analyze/unbiased - rm ./* + rm ./* cd ${WorkDir}/${SUB}/Analyze/bet_notunbiased rm ./* - cd ${WorkDir}/${SUB}/Analyze/lesions_no2fast + cd ${WorkDir}/${SUB}/Analyze/lesions_no2fast + rm ./* + cd ${WorkDir}/${SUB}/Analyze/bet_multispectral rm ./* - cd ${WorkDir}/${SUB}/Analyze/bet_multispectral + cd ${WorkDir}/${SUB}/Analyze/sienax_no2fast rm ./* - cd ${WorkDir}/${SUB}/Analyze/sienax_no2fast - rm ./* done From 92c43925123b316f00c3d0c4bcccb41bcd859fde Mon Sep 17 00:00:00 2001 From: pcamach2 <49655443+pcamach2@users.noreply.github.com> Date: Tue, 10 Dec 2019 09:31:04 -0600 Subject: [PATCH 07/12] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 339e84b..84be4ab 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,9 @@ Brad Sutton Magnetic Resonance Functional Imaging Lab University of Illinois at Urbana-Champaign +Create the directory structure for each participant's data before running. + This can be achieved using file_structure.sh + Use: lesion_mapper -in [options] Required parameters: From fc3f51551a49a27f370ad66a08a68424c5657efb Mon Sep 17 00:00:00 2001 From: pcamach2 <49655443+pcamach2@users.noreply.github.com> Date: Tue, 10 Dec 2019 09:55:17 -0600 Subject: [PATCH 08/12] Specified to call cluster from FSLDIR/bin Another cluster may be found in your PATH, which will cause an error. Be sure to check that you are using cluster from your FSL installation with "which cluster". --- fill_nw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fill_nw b/fill_nw index ce637e7..d775631 100755 --- a/fill_nw +++ b/fill_nw @@ -46,7 +46,7 @@ if [ "$failed" = 1 ]; then fi # begin computation -cluster --in=${mask} --thresh=0.5 -o ${mask}_cluster --no_table +${FSLDIR}/bin/cluster --in=${mask} --thresh=0.5 -o ${mask}_cluster --no_table index_max=$(fslstats ${mask}_cluster -R | cut -d' ' -f2 | cut -d'.' -f1) index_cur=1 while [ $index_cur -le $index_max ] From caaef8fafbc9587119b68d004e56a32780e0ed0a Mon Sep 17 00:00:00 2001 From: pcamach2 <49655443+pcamach2@users.noreply.github.com> Date: Tue, 10 Dec 2019 10:12:41 -0600 Subject: [PATCH 09/12] Update file_structure.sh --- file_structure.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/file_structure.sh b/file_structure.sh index 4628a38..649d26e 100644 --- a/file_structure.sh +++ b/file_structure.sh @@ -1,5 +1,8 @@ #!/bin/sh +#Usage: Creates required directory structure for each subject in a list +#Author: Paul B Camacho + #run from subjects directory for SUB in 001 002 003 004 005 do @@ -8,4 +11,4 @@ do mkdir ./${SUB}/Analyze/lesions_no2fast mkdir ./${SUB}/Analyze/bet_multispectral mkdir ./${SUB}/Analyze/sienax_no2fast -done \ No newline at end of file +done From 5ea15eb8766e4e2692a0de97748ebc395b1d62dd Mon Sep 17 00:00:00 2001 From: pcamach2 <49655443+pcamach2@users.noreply.github.com> Date: Tue, 10 Dec 2019 10:13:37 -0600 Subject: [PATCH 10/12] Update outputRemoval.sh --- outputRemoval.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/outputRemoval.sh b/outputRemoval.sh index d8c450a..16b8e6b 100644 --- a/outputRemoval.sh +++ b/outputRemoval.sh @@ -1,8 +1,10 @@ #!/bin/sh +#Usage: cleans out all results of pipeline_example except for dcm2niix outputs +#Author: Paul B Camacho + WorkDir=/path/to/dataDirectory -#cleans out all results of pipeline_example except for dcm2niix outputs for SUB in 001 002 003 004 005 do cd ${WorkDir}/${SUB}/Analyze/unbiased From ac71793465de24986c786d1d7240dff6b32a1a66 Mon Sep 17 00:00:00 2001 From: pcamach2 <49655443+pcamach2@users.noreply.github.com> Date: Wed, 11 Aug 2021 08:01:41 -0500 Subject: [PATCH 11/12] Added Dockerfile # Generated by: Neurodocker version 0.7.0+0.gdc97516.dirty # Latest release: Neurodocker version 0.7.0 # Timestamp: 2021/07/16 11:17:26 UTC # # Thank you for using Neurodocker. If you discover any issues # or ways to improve this software, please submit an issue or # pull request on our GitHub repository: # # https://github.com/ReproNim/neurodocker FROM debian:stretch USER root ARG DEBIAN_FRONTEND="noninteractive" ENV LANG="en_US.UTF-8" \ LC_ALL="en_US.UTF-8" \ ND_ENTRYPOINT="/neurodocker/startup.sh" RUN export ND_ENTRYPOINT="/neurodocker/startup.sh" \ && apt-get update -qq \ && apt-get install -y -q --no-install-recommends \ apt-utils \ bzip2 \ ca-certificates \ curl \ locales \ unzip \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ && sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \ && dpkg-reconfigure --frontend=noninteractive locales \ && update-locale LANG="en_US.UTF-8" \ && chmod 777 /opt && chmod a+s /opt \ && mkdir -p /neurodocker \ && if [ ! -f "$ND_ENTRYPOINT" ]; then \ echo '#!/usr/bin/env bash' >> "$ND_ENTRYPOINT" \ && echo 'set -e' >> "$ND_ENTRYPOINT" \ echo '#!/usr/bin/env bash' >> "$ND_ENTRYPOINT" \ && echo 'set -e' >> "$ND_ENTRYPOINT" \ && echo 'export USER="${USER:=`whoami`}"' >> "$ND_ENTRYPOINT" \ && echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "$ND_ENTRYPOINT"; \ fi \ && chmod -R 777 /neurodocker && chmod a+s /neurodocker ENTRYPOINT ["/neurodocker/startup.sh"] ENV FSLDIR="/opt/fsl-6.0.3" \ PATH="/opt/fsl-6.0.3/bin:$PATH" \ FSLOUTPUTTYPE="NIFTI_GZ" \ FSLMULTIFILEQUIT="TRUE" \ FSLTCLSH="/opt/fsl-6.0.3/bin/fsltclsh" \ FSLWISH="/opt/fsl-6.0.3/bin/fslwish" \ FSLLOCKDIR="" \ FSLMACHINELIST="" \ FSLREMOTECALL="" \ FSLGECUDAQ="cuda.q" RUN apt-get update -qq \ && apt-get install -y -q --no-install-recommends \ bc \ dc \ file \ libfontconfig1 \ libfreetype6 \ libgl1-mesa-dev \ libgl1-mesa-dri \ libglu1-mesa-dev \ libgomp1 \ libice6 \ libxcursor1 \ libxft2 \ libxinerama1 \ libxrandr2 \ libxrender1 \ libxt6 \ sudo \ wget \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ && echo "Downloading FSL ..." \ && mkdir -p /opt/fsl-6.0.3 \ && curl -fsSL --retry 5 https://fsl.fmrib.ox.ac.uk/fsldownloads/fsl-6.0.3-centos6_64.tar.gz \ | tar -xz -C /opt/fsl-6.0.3 --strip-components 1 \ && sed -i '$iecho Some packages in this Docker container are non-free' $ND_ENTRYPOINT \ && sed -i '$iecho If you are considering commercial use of this container, please consult the relevant license:' $ND_ENTRYPOINT \ && sed -i '$iecho https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/Licence' $ND_ENTRYPOINT \ && sed -i '$isource $FSLDIR/etc/fslconf/fsl.sh' $ND_ENTRYPOINT \ && echo "Installing FSL conda environment ..." \ && bash /opt/fsl-6.0.3/etc/fslconf/fslpython_install.sh -f /opt/fsl-6.0.3 RUN echo '{ \ \n "pkg_manager": "apt", \ \n "instructions": [ \ \n [ \ \n "base", \ \n "debian:stretch" \ \n ], \ \n [ \ \n "fsl", \ \n { \ \n { \ \n "version": "6.0.3" \ \n } \ \n ] \ \n ] \ \n}' > /neurodocker/neurodocker_specs.json RUN apt-get update && \ apt-get install -y --no-install-recommends \ curl \ git \ bzip2 \ ca-certificates \ build-essential \ libglu1-mesa-dev \ libglu1-mesa \ tcsh \ libqt4-scripttools \ apt-utils \ libfontconfig \ libxrender1 \ libfreetype6:amd64 \ libxi-dev \ libxmu-dev \ libxext6 \ libqt5gui5 \ libxss1 \ libxft2 \ libjpeg62 \ && \ apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* RUN git clone https://github.com/mrfil/lesion-mapper RUN chmod 777 -R /lesion-mapper ENV LESIONMAPPERDIR="/lesion-mapper" ENV PATH=$PATH:$LESIONMAPPERDIR WORKDIR /scripts #location to be used as homedir in scripts RUN mkdir -p /data/example RUN echo $FSLDIR ENV NWTOOLS=$LESIONMAPPERDIR --- Dockerfile | 1 + 1 file changed, 1 insertion(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/Dockerfile @@ -0,0 +1 @@ + From 4512c496b6d327e54db2418ca5ffcc5b2924023a Mon Sep 17 00:00:00 2001 From: pcamach2 <49655443+pcamach2@users.noreply.github.com> Date: Mon, 27 Dec 2021 13:08:47 -0600 Subject: [PATCH 12/12] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 84be4ab..f9f2bb2 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ +A BIDS-compatible extended version of this tool is available at https://github.com/mrfil/lesion-mapper-bids. The new version can utilize outputs from Freesurfer and/or fMRIPrep and distinguishes between deep white matter lesions and periventricular lesions. + + lesion_mapper - A tool for mappping white matter hyperintensities. Publication at: Wetter, Hubbard, Motl, Sutton. Brain Behav. 2016 Jan 28;6(3):e00440. https://doi.org/10.1002/brb3.440 For research purposes only! Please see LICENSE.txt