Skip to content

Commit 78020b8

Browse files
committed
fix: pep8, return parameters to conform to nipy to_matrix44
1 parent 410fc5b commit 78020b8

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

nipype/interfaces/nipy/preprocess.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,17 +159,19 @@ def _run_interface(self, runtime):
159159

160160
for j, corr in enumerate(corr_run):
161161
self._out_file_path.append(os.path.abspath('corr_%s.nii.gz' %
162-
(split_filename(self.inputs.in_file[j])[1])))
162+
(split_filename(self.inputs.in_file[j])[1])))
163163
save_image(corr, self._out_file_path[j])
164164

165165
self._par_file_path.append(os.path.abspath('%s.par' %
166166
(os.path.split(self.inputs.in_file[j])[1])))
167167
mfile = open(self._par_file_path[j], 'w')
168168
motion = R._transforms[j]
169-
#output a .par file that looks like fsl.mcflirt's .par file
169+
# nipy does not encode euler angles. return in original form of
170+
# translation followed by rotation vector see:
171+
# http://en.wikipedia.org/wiki/Rodrigues'_rotation_formula
170172
for i, mo in enumerate(motion):
171-
params = ['%.10f' % item for item in np.hstack((mo.rotation,
172-
mo.translation))]
173+
params = ['%.10f' % item for item in np.hstack((mo.translation,
174+
mo.rotation))]
173175
string = ' '.join(params) + '\n'
174176
mfile.write(string)
175177
mfile.close()

0 commit comments

Comments
 (0)