Skip to content

Commit

Permalink
Rename --freesurfer-input to --fs-subjects-dir (#152)
Browse files Browse the repository at this point in the history
* Rename `--freesurfer-input` to `--fs-subjects-dir`.

* Better check for FS dir.
  • Loading branch information
tsalo authored Nov 12, 2024
1 parent 4495e9d commit 38c3f08
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .circleci/FreeSurferIngressTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ${QSIRECON_CMD} \
--recon-input ${BIDS_INPUT_DIR} \
--sloppy \
--recon-spec ${PWD}/test_5tt_hsv.json \
--freesurfer-input ${SUBJECTS_DIR} \
--fs-subjects-dir ${SUBJECTS_DIR} \
--recon-only \
-vv --debug pdb

Expand Down
6 changes: 3 additions & 3 deletions docs/builtin_workflows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ structural connectivity matrix.
We don't recommend using ACT with FAST segmentations. The full benefits of ACT
require very precise tissue boundaries and FAST just doesn't do this reliably
enough. We strongly recommend the ``hsvs`` segmentation if you're going to
use ACT. Note that this requires ``--freesurfer-input``
use ACT. Note that this requires ``--fs-subjects-dir``

.. _mrtrix_dwi_outputs:

Expand Down Expand Up @@ -81,7 +81,7 @@ This workflow uses the ``msmt_csd`` algorithm :footcite:p:`msmt5tt` to estimate
gray matter and cerebrospinal fluid using *multi-shell acquisitions*. The white matter FODs are
used for tractography and the T1w segmentation is used for anatomical constraints :footcite:p:`smith2012anatomically`.
The T1w segmentation uses the hybrid surface volume segmentation (hsvs) :footcite:p:`smith2020hybrid` and
requires ``--freesurfer-input``.
requires ``--fs-subjects-dir``.
This workflow produces :ref:`mrtrix_dwi_outputs` and :ref:`mrtrix_anatomical_outputs`.

.. _mrtrix_multishell_msmt_ACT-fast:
Expand Down Expand Up @@ -117,7 +117,7 @@ to estimate FODs for white matter,
and cerebrospinal fluid using *single shell (DTI) acquisitions*. The white matter FODs are
used for tractography and the T1w segmentation is used for anatomical constraints :footcite:p:`smith2012anatomically`.
The T1w segmentation uses the hybrid surface volume segmentation (hsvs) :footcite:p:`smith2020hybrid` and
requires ``--freesurfer-input``.
requires ``--fs-subjects-dir``.
This workflow produces :ref:`mrtrix_dwi_outputs` and :ref:`mrtrix_anatomical_outputs`.

.. _mrtrix_singleshell_ss3t_ACT-fast:
Expand Down
4 changes: 2 additions & 2 deletions docs/input_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Including FreeSurfer Data
=========================

Suppose you ran FreeSurfer on your data (e.g. as part of fmriprep). You can
specify the directory containing freesurfer outputs with the ``--freesurfer-input`` flag. If you
specify the directory containing freesurfer outputs with the ``--fs-subjects-dir`` flag. If you
have::

derivatives/freesurfer/sub-x
Expand Down Expand Up @@ -145,7 +145,7 @@ You can run:
--omp-nthreads 8 \
--fs-license-file /license.txt \
--recon-spec mrtrix_multishell_msmt_ACT-hsvs \
--freesurfer-input "${PWD}/derivatives/freesurfer" \
--fs-subjects-dir "${PWD}/derivatives/freesurfer" \
-v -v
This will read the FreeSurfer data, align it to the ``qsiprep`` results and use it
Expand Down
11 changes: 7 additions & 4 deletions qsirecon/cli/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,15 @@ def _bids_filter(value, parser):
),
)
g_recon.add_argument(
"--freesurfer-input",
"--freesurfer_input",
"--fs-subjects-dir",
"--fs_subjects_dir",
action="store",
metavar="PATH",
type=Path,
help="Directory containing freesurfer outputs to be integrated into recon.",
type=PathExists,
help=(
"Directory containing Freesurfer outputs to be integrated into recon. "
"Freesurfer must already be run. QSIRecon will not run Freesurfer."
),
)
g_recon.add_argument(
"--skip-odf-reports",
Expand Down
3 changes: 0 additions & 3 deletions qsirecon/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,6 @@ class execution(_Config):
"""Disable ODF recon reports."""
participant_label = None
"""List of participant identifiers that are to be preprocessed."""
freesurfer_input = None
"""Directory containing FreeSurfer directories to use for recon workflows."""
templateflow_home = _templateflow_home
"""The root folder of the TemplateFlow client."""
work_dir = Path("work").absolute()
Expand All @@ -453,7 +451,6 @@ class execution(_Config):
"eddy_config",
"fs_license_file",
"fs_subjects_dir",
"freesurfer_input",
"layout",
"log_dir",
"output_dir",
Expand Down
2 changes: 1 addition & 1 deletion qsirecon/tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def test_mrtrix_multishell_msmt_hsvs(data_dir, output_dir, working_dir):
"participant",
f"-w={work_dir}",
"--sloppy",
f"--freesurfer-input={freesurfer_dir}",
f"--fs-subjects-dir={freesurfer_dir}",
"--recon-spec=mrtrix_multishell_msmt_ACT-hsvs",
"--atlases",
"AAL116",
Expand Down
2 changes: 1 addition & 1 deletion qsirecon/workflows/recon/anatomical.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def init_highres_recon_anatomical_wf(

# If there is no high-res anat data in the inputs there may still be an image available
# from freesurfer. Check for it:
freesurfer_dir = config.execution.freesurfer_input
freesurfer_dir = config.execution.fs_subjects_dir
subject_freesurfer_path = find_fs_path(freesurfer_dir, subject_id)
status["has_freesurfer"] = subject_freesurfer_path is not None
status["has_qsiprep_5tt_hsvs"] = False
Expand Down

0 comments on commit 38c3f08

Please sign in to comment.