Skip to content

Commit

Permalink
Merge pull request #12 from mrfil/qsiprep-v0.15.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pcamach2 authored Apr 1, 2022
2 parents fe0cbc4 + b7ab8c5 commit 88443be
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 208 deletions.
12 changes: 4 additions & 8 deletions docs/source/Install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ To get started with the pipeline, please install the following requirements:
* Brain Connectivity Toolbox for Matlab (https://sites.google.com/site/bctnet/Home/functions/BCT.zip?attredirects=0)
* xcpEngine dsn files (https://github.com/PennBBL/xcpEngine/tree/master/designs)
* ASHS (https://sites.google.com/site/hipposubfields/)
* LAYNII (https://github.com/layerfMRI/LAYNII)
* bidsphysio (https://github.com/cbinyu/bidsphysio)

You will need to install git, to clone the build recipe files from this repository.
Expand All @@ -31,17 +30,14 @@ This following commands can be used to build these required images for the pipel
singularity build mriqc-0.16.1.sif docker://poldracklab/mriqc:0.16.1
singularity build heudiconv-0.9.sif docker://nipy/heudiconv:0.9.0
singularity build fmriprep-v20.2.6.sif docker://nipreps/fmriprep:21.0.0
singularity build xcpengine-1.2.3.sif docker://pennbbl/xcpengine:1.2.3
singularity build qsiprep-v0.14.3.sif docker://pennbbl/qsiprep:0.14.3
#for reorient_fslstd to prepare for SCFSL_GPU
singularity build qsiprep-v0.14.3.sif docker://pennbbl/qsiprep:0.15.1
singularity build fmriprep-v21.0.1.sif docker://nipreps/fmriprep:21.0.1
singularity build xcpengine-1.2.4.sif docker://pennbbl/xcpengine:1.2.4
singularity build qsiprep-v0.15.1.sif docker://pennbbl/qsiprep:0.15.1
# See README.md for more information on
# provided def files for ubuntu-jq, python3
SINGULARITY_NOHTTPS=1 singularity build ubuntu-jq-0.1.sif defjq
SINGULARITY_NOHTTPS=1 singularity build ubuntu-jqjo.sif jqjo.def
SINGULARITY_NOHTTPS=1 singularity build python3.sif defpy3
SINGULARITY_NOHTTPS=1 singularity build laynii-2.0.0.sif layniidef
SINGULARITY_NOHTTPS=1 singularity build ashs-1.0.0.sif ashsdef
#Start Docker registry for localhost
Expand Down
20 changes: 10 additions & 10 deletions docs/source/Sub-Pipelines.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ Using the structural images and fieldmaps, we perform diffusion-weighted-image p

.. code-block:: bash
docker run -v ${IMAGEDIR}:/imgdir -v ${stmpdir}:/paulscratch -v ${projDir}:/data ${IMAGEDIR}/qsiprep-v0.14.3.sif --fs-license-file /imgdir/license.txt /data/bids /data/bids/derivatives /data/bids/ --output-resolution 1.6 -w /paulscratch participant --participant-label ${subject}
docker run -v ${IMAGEDIR}:/imgdir -v ${stmpdir}:/paulscratch -v ${projDir}:/data ${IMAGEDIR}/qsiprep-v0.14.3.sif --fs-license-file /imgdir/license.txt /data/bids /data/bids/derivatives /data/bids/ --freesurfer-input /data/bids/derivatives/fmriprep/freesurfer --output-resolution 1.6 -w /paulscratch participant --participant-label ${subject}
.. code-block:: bash
singularity run --cleanenv --bind ${IMAGEDIR}:/imgdir,${stmpdir}:/paulscratch,${projDir}:/data ${IMAGEDIR}/qsiprep-v0.14.3.sif --fs-license-file /imgdir/license.txt /data/bids /data/bids/derivatives --output-resolution 1.6 -w /paulscratch participant --participant-label ${subject}
singularity run --cleanenv --bind ${IMAGEDIR}:/imgdir,${stmpdir}:/paulscratch,${projDir}:/data ${IMAGEDIR}/qsiprep-v0.14.3.sif --fs-license-file /imgdir/license.txt /data/bids /data/bids/derivatives --freesurfer-input /data/bids/derivatives/fmriprep/freesurfer --output-resolution 1.6 -w /paulscratch participant --participant-label ${subject}
*Reconstruction*

Expand All @@ -123,15 +123,15 @@ Constrained Spherical Deconvolution-based multi-shell multi-tissue w/ SIFT2 via
.. code-block:: bash
#run reconstruction workflow in QSIPrep
docker run -v ${IMAGEDIR}:/imgdir -v ${stmpdir}:/paulscratch -v ${projDir}:/data ${IMAGEDIR}/qsiprep-v0.14.3.sif --fs-license-file /imgdir/license.txt /data/bids /data/bids/derivatives --recon_input /data/bids/derivatives/qsiprep --recon_spec mrtrix_multishell_msmt --output-resolution 1.6 -w /paulscratch participant --participant-label ${subject}
docker run -v ${IMAGEDIR}:/imgdir -v ${stmpdir}:/paulscratch -v ${projDir}:/data ${IMAGEDIR}/qsiprep-v0.14.3.sif --fs-license-file /imgdir/license.txt /data/bids /data/bids/derivatives --recon_input /data/bids/derivatives/qsiprep --recon_spec mrtrix_multishell_msmt_ACT-hsvs --freesurfer-input /data/bids/derivatives/fmriprep/freesurfer --output-resolution 1.6 -w /paulscratch participant --participant-label ${subject}
#calculate network-based statistics and save NxN matrices from .net
docker run -v ${scripts}/matlab:/work -v ${scripts}/2019_03_03_BCT:/bctoolbox -v ${projDir}/bids/derivatives/qsirecon:/data ${IMAGEDIR}/matlab-R2019a.sif /work/qsinbs.sh "$subject" "$sesname"
.. code-block:: bash
#run reconstruction workflow in QSIPrep
singularity run --cleanenv --bind ${IMAGEDIR}:/imgdir,${stmpdir}:/paulscratch,${projDir}:/data ${IMAGEDIR}/qsiprep-v0.14.3.sif --fs-license-file /imgdir/license.txt /data/bids /data/bids/derivatives --recon_input /data/bids/derivatives/qsiprep --recon_spec mrtrix_multishell_msmt --output-resolution 1.6 -w /paulscratch participant --participant-label ${subject}
singularity run --cleanenv --bind ${IMAGEDIR}:/imgdir,${stmpdir}:/paulscratch,${projDir}:/data ${IMAGEDIR}/qsiprep-v0.14.3.sif --fs-license-file /imgdir/license.txt /data/bids /data/bids/derivatives --recon_input /data/bids/derivatives/qsiprep --recon_spec mrtrix_multishell_msmt_ACT-hsvs --freesurfer-input /data/bids/derivatives/fmriprep/freesurfer --output-resolution 1.6 -w /paulscratch participant --participant-label ${subject}
#calculate network-based statistics and save NxN matrices from .net
singularity run --cleanenv --bind ${scripts}/matlab:/work,${scripts}/2019_03_03_BCT:/bctoolbox,${projDir}/bids/derivatives/qsirecon:/data ${IMAGEDIR}/matlab-R2019a.sif /work/qsinbs.sh "$subject" "$sesname"
Expand All @@ -141,7 +141,7 @@ Generalized q-Sampling imaging via DSI Studio
.. code-block:: bash
#run reconstruction workflow in QSIPrep
docker run -v ${IMAGEDIR}:/imgdir -v ${stmpdir}:/paulscratch -v ${projDir}:/data ${IMAGEDIR}/qsiprep-v0.14.3.sif --fs-license-file /imgdir/license.txt /data/bids /data/bids/derivatives --recon_input /data/bids/derivatives/qsiprep --recon_spec dsi_studio_gqi --output-resolution 1.6 -w /paulscratch participant --participant-label ${subject}
docker run -v ${IMAGEDIR}:/imgdir -v ${stmpdir}:/paulscratch -v ${projDir}:/data ${IMAGEDIR}/qsiprep-v0.14.3.sif --fs-license-file /imgdir/license.txt /data/bids /data/bids/derivatives --recon_input /data/bids/derivatives/qsiprep --recon_spec dsi_studio_gqi --freesurfer-input /data/bids/derivatives/fmriprep/freesurfer --output-resolution 1.6 -w /paulscratch participant --participant-label ${subject}
#get network-based statistics to a csv from .mat
docker run -v ${scripts}:/scripts -v ${projDir}/bids/derivatives/qsirecon/${subject}/${sesname}/dwi:/datain -W /datain ${IMAGEDIR}/pylearn.sif /scripts/gqimetrics.py
Expand All @@ -150,7 +150,7 @@ Generalized q-Sampling imaging via DSI Studio
.. code-block:: bash
#run reconstruction workflow in QSIPrep
singularity run --cleanenv --bind ${IMAGEDIR}:/imgdir,${stmpdir}:/paulscratch,${projDir}:/data ${IMAGEDIR}/qsiprep-v0.14.3.sif --fs-license-file /imgdir/license.txt /data/bids /data/bids/derivatives --recon_input /data/bids/derivatives/qsiprep --recon_spec dsi_studio_gqi --output-resolution 1.6 -w /paulscratch participant --participant-label ${subject}
singularity run --cleanenv --bind ${IMAGEDIR}:/imgdir,${stmpdir}:/paulscratch,${projDir}:/data ${IMAGEDIR}/qsiprep-v0.14.3.sif --fs-license-file /imgdir/license.txt /data/bids /data/bids/derivatives --recon_input /data/bids/derivatives/qsiprep --recon_spec dsi_studio_gqi --freesurfer-input /data/bids/derivatives/fmriprep/freesurfer --output-resolution 1.6 -w /paulscratch participant --participant-label ${subject}
#get network-based statistics to a csv from .mat
singularity run --cleanenv --bind ${scripts}:/scripts,${projDir}/bids/derivatives/qsirecon/${subject}/${sesname}/dwi:/datain -W /datain ${IMAGEDIR}/pylearn.sif /scripts/gqimetrics.py
Expand All @@ -160,15 +160,15 @@ NODDI via AMICO python implementation
.. code-block:: bash
#run reconstruction workflow in QSIPrep
docker run -v ${IMAGEDIR}:/imgdir -v ${stmpdir}:/paulscratch -v ${projDir}:/data ${IMAGEDIR}/qsiprep-v0.14.3.sif --fs-license-file /imgdir/license.txt /data/bids /data/bids/derivatives --recon_input /data/bids/derivatives/qsiprep --recon_spec amico_noddi --output-resolution 1.6 -w /paulscratch participant --participant-label ${subject}
docker run -v ${IMAGEDIR}:/imgdir -v ${stmpdir}:/paulscratch -v ${projDir}:/data ${IMAGEDIR}/qsiprep-v0.14.3.sif --fs-license-file /imgdir/license.txt /data/bids /data/bids/derivatives --recon_input /data/bids/derivatives/qsiprep --recon_spec amico_noddi --freesurfer-input /data/bids/derivatives/fmriprep/freesurfer --output-resolution 1.6 -w /paulscratch participant --participant-label ${subject}
#ROI-wise stats
docker run -v ${scripts}:/scripts -v ${projDir}/bids/derivatives/qsirecon/${subject}/${sesname}/dwi:/datanoddi ${IMAGEDIR}/neurodoc.sif /scripts/noddi_stats.sh "$subject" "$sesname"
.. code-block:: bash
#run reconstruction workflow in QSIPrep
singularity run --cleanenv --bind ${IMAGEDIR}:/imgdir,${stmpdir}:/paulscratch,${projDir}:/data ${IMAGEDIR}/qsiprep-v0.14.3.sif --fs-license-file /imgdir/license.txt /data/bids /data/bids/derivatives --recon_input /data/bids/derivatives/qsiprep --recon_spec amico_noddi --output-resolution 1.6 -w /paulscratch participant --participant-label ${subject}
singularity run --cleanenv --bind ${IMAGEDIR}:/imgdir,${stmpdir}:/paulscratch,${projDir}:/data ${IMAGEDIR}/qsiprep-v0.14.3.sif --fs-license-file /imgdir/license.txt /data/bids /data/bids/derivatives --recon_input /data/bids/derivatives/qsiprep --recon_spec amico_noddi --freesurfer-input /data/bids/derivatives/fmriprep/freesurfer --output-resolution 1.6 -w /paulscratch participant --participant-label ${subject}
#ROI-wise stats
singularity run --cleanenv --bind ${scripts}:/scripts,${projDir}/bids/derivatives/qsirecon/${subject}/${sesname}/dwi:/datanoddi ${IMAGEDIR}/neurodoc.sif /scripts/noddi_stats.sh "$subject" "$sesname"
Expand All @@ -187,12 +187,12 @@ QSIPrep preprocessing reorient to FSL space:
.. code-block:: bash
#run reconstruction workflow in QSIPrep
docker run -v ${IMAGEDIR}:/imgdir -v ${stmpdir}:/paulscratch -v ${projDir}:/data ${IMAGEDIR}/qsiprep-v0.15.1.sif --fs-license-file /imgdir/license.txt /data/bids /data/bids/derivatives --recon_input /data/bids/derivatives/qsiprep --recon_spec reorient_fslstd --output-resolution 1.6 -w /paulscratch participant --participant-label ${subject}
docker run -v ${IMAGEDIR}:/imgdir -v ${stmpdir}:/paulscratch -v ${projDir}:/data ${IMAGEDIR}/qsiprep-v0.15.1.sif --fs-license-file /imgdir/license.txt /data/bids /data/bids/derivatives --recon_input /data/bids/derivatives/qsiprep --recon_spec reorient_fslstd --freesurfer-input /data/bids/derivatives/fmriprep/freesurfer --output-resolution 1.6 -w /paulscratch participant --participant-label ${subject}
.. code-block:: bash
#run reconstruction workflow in QSIPrep
singularity run --cleanenv --bind ${IMAGEDIR}:/imgdir,${stmpdir}:/paulscratch,${projDir}:/data ${IMAGEDIR}/qsiprep-v0.15.1.sif --fs-license-file /imgdir/license.txt /data/bids /data/bids/derivatives --recon_input /data/bids/derivatives/qsiprep --recon_spec reorient_fslstd --output-resolution 1.6 -w /paulscratch participant --participant-label ${subject}
singularity run --cleanenv --bind ${IMAGEDIR}:/imgdir,${stmpdir}:/paulscratch,${projDir}:/data ${IMAGEDIR}/qsiprep-v0.15.1.sif --fs-license-file /imgdir/license.txt /data/bids /data/bids/derivatives --recon_input /data/bids/derivatives/qsiprep --recon_spec reorient_fslstd --freesurfer-input /data/bids/derivatives/fmriprep/freesurfer --output-resolution 1.6 -w /paulscratch participant --participant-label ${subject}
CUDA 10.2-accelerated FDT pipeline
Expand Down
2 changes: 2 additions & 0 deletions docs/source/Usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Running FreeSurfer-informed FSL DTI tractography on GPU
*Docker*

.. code-block:: bash
# Running SCFSL GPU tractography
docker exec --gpus all -e LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-10.2/lib64 \
-v /path/to/freesurfer/license.txt:/opt/freesurfer/license.txt \
Expand All @@ -52,6 +53,7 @@ Running FreeSurfer-informed FSL DTI tractography on GPU
*Singularity*

.. code-block:: bash
# Running SCFSL GPU tractography
SINGULARITY_ENVLD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-10.2/lib64 \
singularity exec --nv -B /path/to/freesurfer/license.txt:/opt/freesurfer/license.txt,/path/project/bids:/data \
Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
author = 'Paul B Camacho, Evan D Anderson, Nishant Bhamidipati, Aaron T Anderson, Benjamin Zimmerman, Matthew S Moore, Ezra Paul Winter-Nelson, Maximillian K Egan, Brad P Sutton'

# The full version, including alpha/beta/rc tags
release = '0.1.0'
release = '0.3.0'


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -53,4 +53,4 @@
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']

pygments_style = 'sphinx'
pygments_style = 'sphinx'
50 changes: 10 additions & 40 deletions jsoncrawler.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
#
#single-sub single-session script for adding intended for statements to fmap jsons before running BIDS apps
#
# requires JQ
#usage: jsoncrawler.sh {bids directory} {session} {subject}
#
#pbc
Expand All @@ -10,7 +10,6 @@
sesname=$2
seslen=${#sesname}
sub=$3
intend='"IntendedFor": '

seshs=($1/${sub}/${sesname})
for sesh in ${seshs[@]}; do
Expand All @@ -20,21 +19,15 @@ restfuncs=(./func/*rest*bold*nii.gz)

for restfuncmap in ${restfuncmaps[@]}; do
img=${restfuncs:1}
jq .IntendedFor $restfuncmap > tmpj
jq '.IntendedFor' $restfuncmap > tmpj
if [[ $(cat tmpj) == "${sesname}${img}" ]];
then
echo "IntendedFor found as "${sesname}$img""
exit 0
else
printf " " > test.txt
printf $intend >> test.txt
printf " " >> test.txt
printf '"' >> test.txt
printf "${sesname}""$img" >> test.txt
printf '",' >> test.txt
echo "" >> test.txt
echo "" > tmp
awk 'NR==1{a=$0}NR==FNR{next}FNR==32{print a}1' test.txt $restfuncmap >> tmp && mv tmp $restfuncmap
# replace the following with jq or jo
cat $restfuncmap | jq '.IntendedFor |= "${sesname}$img"' > tmp
mv tmp $restfuncmap
fi
done

Expand All @@ -48,22 +41,8 @@ taskfuncs=`find ./func -maxdepth 2 -type f \( -iname "*nback*bold*nii.gz" -a -no
task="*nback*"
if [[ "$img" == "$task" ]];
then
# jq .IntendedFor $taskfuncmap > tmpj
# if [[ "`cat tmpj`" == "${sesname}$img" ]];
# then
# echo "IntendedFor found as "${sesname}$img""
# exit 0
# else
printf " " > test.txt
printf $intend >> test.txt
printf " " >> test.txt
printf '"' >> test.txt
printf "${sesname}""$img" >> test.txt
printf '",' >> test.txt
echo "" >> test.txt
echo "" > tmp
awk 'NR==1{a=$0}NR==FNR{next}FNR==32{print a}1' test.txt $taskfuncmap >> tmp && mv tmp $taskfuncmap

cat $taskfuncmap | jq '.IntendedFor |= "${sesname}$img"' > tmp
mv tmp $taskfuncmap
fi
done

Expand All @@ -72,25 +51,16 @@ dwis=(./dwi/*dwi*nii.gz)

for dwimap in ${dwimaps[@]}; do
img=${dwis:1}
jq .IntendedFor $dwimap > tmpj
jq '.IntendedFor' $dwimap > tmpj
if [[ $(cat tmpj) == "${sesname}$img" ]];
then
echo "IntendedFor found as "${sesname}$img""
exit 0
else
printf " " > test.txt
printf $intend >> test.txt
printf " " >> test.txt
printf '"' >> test.txt
printf "${sesname}""$img" >> test.txt
printf '",' >> test.txt
echo "" >> test.txt
echo "" > tmp
awk 'NR==1{a=$0}NR==FNR{next}FNR==32{print a}1' test.txt $dwimap >> tmp && mv tmp $dwimap
cat $dwimap | jq '.IntendedFor |= "${sesname}$img"' > tmp
mv tmp $dwimap
fi
done
done

rm -f test.txt
rm -f tmp
rm -f tmpj
Loading

0 comments on commit 88443be

Please sign in to comment.