Skip to content

ENH: Enable recon-all -FLAIR / -FLAIRpial options #2279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions nipype/interfaces/freesurfer/preprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,10 +628,17 @@ class ReconAllInputSpec(CommandLineInputSpec):
argstr="-hemi %s")
T1_files = InputMultiPath(File(exists=True), argstr='-i %s...',
desc='name of T1 file to process')
T2_file = File(exists=True, argstr="-T2 %s", min_ver='5.3.0',
T2_file = File(exists=True, argstr="-T2 %s",
min_ver='5.3.0',
desc='Convert T2 image to orig directory')
use_T2 = traits.Bool(argstr="-T2pial", min_ver='5.3.0',
desc='Use converted T2 to refine the cortical surface')
FLAIR_file = File(exists=True, argstr="-FLAIR %s",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use a single input i.e. T2, perhaps with:

  1. a requires set for use*
  2. a description update saying T2 file can be T2 or FLAIR
    ?

freesurfer doesn't really distinguish between the inputs in the recon-all process, only the use options change some thresholds to fixing surfaces.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When adding the images, -T2 <file> vs -FLAIR <file> dictates whether it's converted to orig/T2raw.mgz or orig/FLAIRraw.mgz Then -T2pial and -FLAIRpial draw from those files as well as set different options to mris_make_surfaces. (Also note that -T2 and -FLAIR are not mutually exclusive, but -T2pial and -FLAIRpial are.)

Also, recall that someone may use this in multiple stages. The -T2 <file> and -T2pial options may not be passed in the same interface, so dependencies between these options aren't necessarily going to be straightforward.

Given these considerations, do you see a way of simplifying this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@effigies - i was going to say we could set the appropriate argument in _format_arg. but since this interface offers the possibility of passing any of the Do* arguments, perhaps this is cleaner at this point. so i'm ok with the way this PR is currently implemented.

min_ver='5.3.0',
desc='Convert FLAIR image to orig directory')
use_T2 = traits.Bool(argstr="-T2pial", min_ver='5.3.0', xor=['use_FLAIR'],
desc='Use T2 image to refine the pial surface')
use_FLAIR = traits.Bool(argstr="-FLAIRpial",
min_ver='5.3.0', xor=['use_T2'],
desc='Use FLAIR image to refine the pial surface')
openmp = traits.Int(argstr="-openmp %d",
desc="Number of processors to use in parallel")
parallel = traits.Bool(argstr="-parallel",
Expand Down
10 changes: 9 additions & 1 deletion nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@


def test_ReconAll_inputs():
input_map = dict(T1_files=dict(argstr='-i %s...',
input_map = dict(FLAIR_file=dict(argstr='-FLAIR %s',
min_ver='5.3.0',
),
T1_files=dict(argstr='-i %s...',
),
T2_file=dict(argstr='-T2 %s',
min_ver='5.3.0',
Expand Down Expand Up @@ -108,8 +111,13 @@ def test_ReconAll_inputs():
terminal_output=dict(deprecated='1.0.0',
nohash=True,
),
use_FLAIR=dict(argstr='-FLAIRpial',
min_ver='5.3.0',
xor=['use_T2'],
),
use_T2=dict(argstr='-T2pial',
min_ver='5.3.0',
xor=['use_FLAIR'],
),
xopts=dict(argstr='-xopts-%s',
),
Expand Down