From edece6e1b4b45218cf7116106efb21eb3c5d229c Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Mon, 13 Nov 2017 10:14:44 -0500 Subject: [PATCH 1/3] ENH: Enable recon-all -FLAIR/-FLAIRpial --- nipype/interfaces/freesurfer/preprocess.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/nipype/interfaces/freesurfer/preprocess.py b/nipype/interfaces/freesurfer/preprocess.py index 2f8b432bb3..a516a21fec 100644 --- a/nipype/interfaces/freesurfer/preprocess.py +++ b/nipype/interfaces/freesurfer/preprocess.py @@ -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', xor=['FLAIR_file'], 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", + min_ver='5.3.0', xor=['T2_file'], + 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", From 56e9613189e7557c713359b3ee493509567e5f7a Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Mon, 13 Nov 2017 10:15:18 -0500 Subject: [PATCH 2/3] make specs --- .../freesurfer/tests/test_auto_ReconAll.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py b/nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py index d02b2b47df..ff4ab603eb 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py @@ -4,10 +4,15 @@ 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', + xor=['T2_file'], + ), + T1_files=dict(argstr='-i %s...', ), T2_file=dict(argstr='-T2 %s', min_ver='5.3.0', + xor=['FLAIR_file'], ), args=dict(argstr='%s', ), @@ -108,8 +113,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', ), From 77f5bd4cfe1137d749424d680c3b90e49f6869fe Mon Sep 17 00:00:00 2001 From: "Christopher J. Markiewicz" Date: Mon, 13 Nov 2017 10:18:05 -0500 Subject: [PATCH 3/3] FIX: T2/FLAIR inputs not mutually exclusive --- nipype/interfaces/freesurfer/preprocess.py | 4 ++-- nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/nipype/interfaces/freesurfer/preprocess.py b/nipype/interfaces/freesurfer/preprocess.py index a516a21fec..1d209c3022 100644 --- a/nipype/interfaces/freesurfer/preprocess.py +++ b/nipype/interfaces/freesurfer/preprocess.py @@ -629,10 +629,10 @@ class ReconAllInputSpec(CommandLineInputSpec): 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', xor=['FLAIR_file'], + min_ver='5.3.0', desc='Convert T2 image to orig directory') FLAIR_file = File(exists=True, argstr="-FLAIR %s", - min_ver='5.3.0', xor=['T2_file'], + 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') diff --git a/nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py b/nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py index ff4ab603eb..f823855333 100644 --- a/nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py +++ b/nipype/interfaces/freesurfer/tests/test_auto_ReconAll.py @@ -6,13 +6,11 @@ def test_ReconAll_inputs(): input_map = dict(FLAIR_file=dict(argstr='-FLAIR %s', min_ver='5.3.0', - xor=['T2_file'], ), T1_files=dict(argstr='-i %s...', ), T2_file=dict(argstr='-T2 %s', min_ver='5.3.0', - xor=['FLAIR_file'], ), args=dict(argstr='%s', ),