Skip to content

Commit 9057ffa

Browse files
author
David Ellis
committed
FIX: Allows for aseg to be copied in segstats for 5.3.
1 parent d6560f1 commit 9057ffa

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

nipype/interfaces/freesurfer/model.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,8 @@ class SegStatsReconAllInputSpec(SegStatsInputSpec):
796796
desc="Input file must be <subject_id>/surf/lh.pial")
797797
rh_pial = File(mandatory=True, exists=True,
798798
desc="Input file must be <subject_id>/surf/rh.pial")
799+
aseg = File(exists=True,
800+
desc="Mandatory implicit input in 5.3")
799801
copy_inputs = traits.Bool(desc="If running as a node, set this to True " +
800802
"otherwise, this will copy the implicit inputs " +
801803
"to the node directory.")
@@ -868,6 +870,8 @@ def run(self, **inputs):
868870
'mri', 'ribbon.mgz')
869871
copy2subjdir(self, self.inputs.presurf_seg,
870872
'mri', 'aseg.presurf.mgz')
873+
copy2subjdir(self, self.inputs.aseg,
874+
'mri', 'aseg.mgz')
871875
copy2subjdir(self, self.inputs.transform,
872876
os.path.join('mri', 'transforms'),
873877
'talairach.xfm')

nipype/workflows/smri/freesurfer/autorecon3.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,6 @@ def create_AutoRecon3(name="AutoRecon3", qcache=False, plugin_args=None,
638638
ar3_wf.connect([(apas_2_aseg, segstats, [('out_file', 'segmentation_file')]),
639639
(inputspec, segstats, [('lh_white', 'lh_white'),
640640
('rh_white', 'rh_white'),
641-
('aseg_presurf', 'presurf_seg'),
642641
('transform', 'transform'),
643642
('norm', 'in_intensity'),
644643
('norm', 'partial_volume_file'),
@@ -654,6 +653,12 @@ def create_AutoRecon3(name="AutoRecon3", qcache=False, plugin_args=None,
654653
]),
655654
])
656655

656+
if fsvernum > 6:
657+
ar3_wf.connect(inputspec, 'aseg_presurf', segstats, 'presurf_seg')
658+
else:
659+
ar3_wf.connect(inputspec, 'aseg_presurf', segstats, 'aseg')
660+
661+
657662
# White Matter Parcellation
658663

659664
# Adds WM Parcellation info into the aseg and computes stat.

0 commit comments

Comments
 (0)