Skip to content

Commit e54f020

Browse files
committed
Detecting and apropriately warning about unconnected duplicatlely nodes
1 parent 32e724c commit e54f020

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

nipype/interfaces/afni/preprocess.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ class AlignEpiAnatPyOutputSpec(TraitedSpec):
119119
desc="matrix to volume register and align epi"
120120
"to anatomy and put into standard space")
121121
epi_vr_motion = File(
122-
desc="motion parameters from EPI time-series"
122+
desc="motion parameters from EPI time-series"
123123
"registration (tsh included in name if slice"
124124
"timing correction is also included).")
125125
skullstrip = File(
@@ -131,20 +131,20 @@ class AlignEpiAnatPy(AFNIPythonCommand):
131131
an EPI and an anatomical structural dataset, and applies the resulting
132132
transformation to one or the other to bring them into alignment.
133133
134-
This script computes the transforms needed to align EPI and
135-
anatomical datasets using a cost function designed for this purpose. The
136-
script combines multiple transformations, thereby minimizing the amount of
134+
This script computes the transforms needed to align EPI and
135+
anatomical datasets using a cost function designed for this purpose. The
136+
script combines multiple transformations, thereby minimizing the amount of
137137
interpolation applied to the data.
138-
138+
139139
Basic Usage:
140140
align_epi_anat.py -anat anat+orig -epi epi+orig -epi_base 5
141-
141+
142142
The user must provide EPI and anatomical datasets and specify the EPI
143-
sub-brick to use as a base in the alignment.
143+
sub-brick to use as a base in the alignment.
144144
145145
Internally, the script always aligns the anatomical to the EPI dataset,
146-
and the resulting transformation is saved to a 1D file.
147-
As a user option, the inverse of this transformation may be applied to the
146+
and the resulting transformation is saved to a 1D file.
147+
As a user option, the inverse of this transformation may be applied to the
148148
EPI dataset in order to align it to the anatomical data instead.
149149
150150
This program generates several kinds of output in the form of datasets
@@ -182,7 +182,7 @@ def _list_outputs(self):
182182
epi_prefix = ''.join(self._gen_fname(self.inputs.in_file).split('+')[:-1])
183183
outputtype = self.inputs.outputtype
184184
if outputtype == 'AFNI':
185-
ext = '.HEAD'
185+
ext = '.HEAD'
186186
else:
187187
Info.output_type_to_ext(outputtype)
188188
matext = '.1D'
@@ -620,7 +620,7 @@ class AutoTLRCInputSpec(CommandLineInputSpec):
620620
mandatory=True,
621621
exists=True,
622622
copyfile=False)
623-
base = traits.Str(
623+
base = traits.Str(
624624
desc = ' Reference anatomical volume'
625625
' Usually this volume is in some standard space like'
626626
' TLRC or MNI space and with afni dataset view of'
@@ -706,7 +706,7 @@ def _list_outputs(self):
706706
ext = '.HEAD'
707707
outputs['out_file'] = os.path.abspath(self._gen_fname(self.inputs.in_file, suffix='+tlrc')+ext)
708708
return outputs
709-
709+
710710
class BandpassInputSpec(AFNICommandInputSpec):
711711
in_file = File(
712712
desc='input file to 3dBandpass',

nipype/pipeline/engine/workflows.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -700,8 +700,13 @@ def _check_nodes(self, nodes):
700700
for node in nodes:
701701
if node.name in node_names:
702702
idx = node_names.index(node.name)
703-
if node_lineage[idx] in [node._hierarchy, self.name]:
704-
raise IOError('Duplicate node name %s found.' % node.name)
703+
try:
704+
this_node_lineage = node_lineage[idx]
705+
except IndexError:
706+
raise IOError('Duplicate and unconnected node name %s found.' % node.name)
707+
else:
708+
if this_node_lineage in [node._hierarchy, self.name]:
709+
raise IOError('Duplicate node name %s found.' % node.name)
705710
else:
706711
node_names.append(node.name)
707712

0 commit comments

Comments
 (0)