Skip to content

Commit c6ac7a6

Browse files
authored
Merge pull request #2523 from effigies/fix/fsl_orthogonalization
FIX: FSL orthogonalization bug
2 parents 539930e + 22fd9ff commit c6ac7a6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

nipype/interfaces/fsl/model.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,16 @@ def _create_ev_files(self, cwd, runinfo, runidx, ev_parameters,
217217
self._create_ev_file(evfname, evinfo)
218218
# add ev orthogonalization
219219
for i in range(1, num_evs[0] + 1):
220+
initial = ev_ortho.substitute(c0=i, c1=0, orthogonal=1)
220221
for j in range(0, num_evs[0] + 1):
221222
try:
222223
orthogonal = int(orthogonalization[i][j])
223224
except (KeyError, TypeError, ValueError, IndexError):
224225
orthogonal = 0
225-
ev_txt += ev_ortho.substitute(
226-
c0=i, c1=j, orthogonal=orthogonal)
226+
if orthogonal == 1 and initial not in ev_txt:
227+
ev_txt += initial + "\n"
228+
ev_txt += ev_ortho.substitute(c0=i, c1=j,
229+
orthogonal=orthogonal)
227230
ev_txt += "\n"
228231
# add contrast info to fsf file
229232
if isdefined(contrasts):

0 commit comments

Comments
 (0)