Skip to content

Commit cbaf81d

Browse files
committed
Merge pull request #16 from chrisfilo/enh/rapidart
Code cleanup.
2 parents 9af6cc6 + 5b97b03 commit cbaf81d

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

nipype/algorithms/rapidart.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ def _get_output_filenames(self, motionfile, output_dir):
287287
infile = motionfile[0]
288288
else:
289289
raise Exception("Unknown type of file")
290-
filepath, filename, ext = split_filename(infile)
290+
_, filename, ext = split_filename(infile)
291291
artifactfile = os.path.join(output_dir, ''.join(('art.', filename,
292292
'_outliers.txt')))
293293
intensityfile = os.path.join(output_dir, ''.join(('global_intensity.',
@@ -594,8 +594,8 @@ def _get_output_filenames(self, motionfile, output_dir):
594594
output_dir: string
595595
output directory in which the files will be generated
596596
"""
597-
(filepath, filename) = os.path.split(motionfile)
598-
(filename, ext) = os.path.splitext(filename)
597+
(_, filename) = os.path.split(motionfile)
598+
(filename, _) = os.path.splitext(filename)
599599
corrfile = os.path.join(output_dir, ''.join(('qa.', filename,
600600
'_stimcorr.txt')))
601601
return corrfile
@@ -655,7 +655,7 @@ def _run_interface(self, runtime):
655655
intensityfiles = self.inputs.intensity_values
656656
spmmat = sio.loadmat(self.inputs.spm_mat_file, struct_as_record=False)
657657
nrows = []
658-
for i, imgf in enumerate(motparamlist):
658+
for i in range(len(motparamlist)):
659659
sessidx = i
660660
rows = None
661661
if self.inputs.concatenated_design:

nipype/algorithms/tests/test_rapidart.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ def test_ad_output_filenames():
6262

6363

6464
def test_ad_get_affine_matrix():
65-
ad = ra.ArtifactDetect()
6665
matrix = ra._get_affine_matrix(np.array([0]), 'SPM')
6766
yield assert_equal, matrix, np.eye(4)
6867
# test translation
@@ -89,7 +88,6 @@ def test_ad_get_affine_matrix():
8988

9089

9190
def test_ad_get_norm():
92-
ad = ra.ArtifactDetect()
9391
params = np.array([0, 0, 0, 0, 0, 0, 0, 0, 0, np.pi / 4, np.pi / 4,
9492
np.pi / 4, 0, 0, 0, -np.pi / 4,
9593
-np.pi / 4, -np.pi / 4]).reshape((3, 6))

0 commit comments

Comments
 (0)