|
3 | 3 | import os
|
4 | 4 | import numpy as np
|
5 | 5 |
|
6 |
| -from .base import SPMCommandInputSpec, SPMCommand, Info, scans_for_fnames, scans_for_fname |
| 6 | +from .base import (SPMCommandInputSpec, SPMCommand, Info, scans_for_fnames, |
| 7 | + scans_for_fname) |
7 | 8 | from ..matlab import MatlabCommand
|
8 | 9 | from ..base import (TraitedSpec, BaseInterface,
|
9 | 10 | BaseInterfaceInputSpec, isdefined,
|
10 | 11 | OutputMultiPath, InputMultiPath)
|
11 | 12 | from ..base import File, traits
|
12 |
| -from ...utils.filemanip import split_filename, fname_presuffix, filename_to_list, list_to_filename |
| 13 | +from ...utils.filemanip import (split_filename, fname_presuffix, |
| 14 | + filename_to_list, list_to_filename) |
13 | 15 |
|
14 | 16 |
|
15 | 17 | class Analyze2niiInputSpec(SPMCommandInputSpec):
|
@@ -45,7 +47,8 @@ class CalcCoregAffineInputSpec(SPMCommandInputSpec):
|
45 | 47 | target = File(exists=True, mandatory=True,
|
46 | 48 | desc='target for generating affine transform')
|
47 | 49 | moving = File(exists=True, mandatory=True, copyfile=False,
|
48 |
| - desc='volume transform can be applied to register with target') |
| 50 | + desc=('volume transform can be applied to register with ' |
| 51 | + 'target')) |
49 | 52 | mat = File(desc='Filename used to store affine matrix')
|
50 | 53 | invmat = File(desc='Filename used to store inverse affine matrix')
|
51 | 54 |
|
@@ -346,7 +349,8 @@ class ResliceToReferenceOutput(TraitedSpec):
|
346 | 349 |
|
347 | 350 |
|
348 | 351 | class ResliceToReference(SPMCommand):
|
349 |
| - """ Uses spm to reslice a volume to a target image space or to a provided voxel size and bounding box |
| 352 | + """Uses spm to reslice a volume to a target image space or to a provided |
| 353 | + voxel size and bounding box |
350 | 354 |
|
351 | 355 | Examples
|
352 | 356 | --------
|
@@ -409,10 +413,11 @@ class DicomImportInputSpec(SPMCommandInputSpec):
|
409 | 413 | icedims = traits.Bool(False,
|
410 | 414 | field='convopts.icedims',
|
411 | 415 | usedefault=True,
|
412 |
| - desc='If image sorting fails, one can try using the additional\ |
413 |
| - SIEMENS ICEDims information to create unique filenames.\ |
414 |
| - Use this only if there would be multiple volumes with\ |
415 |
| - exactly the same file names.') |
| 416 | + desc=('If image sorting fails, one can try using ' |
| 417 | + 'the additional SIEMENS ICEDims information ' |
| 418 | + 'to create unique filenames. Use this only if ' |
| 419 | + 'there would be multiple volumes with exactly ' |
| 420 | + 'the same file names.')) |
416 | 421 |
|
417 | 422 |
|
418 | 423 | class DicomImportOutputSpec(TraitedSpec):
|
@@ -468,9 +473,13 @@ def _list_outputs(self):
|
468 | 473 | if self.inputs.output_dir_struct == "flat":
|
469 | 474 | outputs['out_files'] = glob(os.path.join(od, '*.%s' % ext))
|
470 | 475 | elif self.inputs.output_dir_struct == 'series':
|
471 |
| - outputs['out_files'] = glob(os.path.join(od, os.path.join('*', '*.%s' % ext))) |
472 |
| - elif self.inputs.output_dir_struct in ['patid', 'date_time', 'patname']: |
473 |
| - outputs['out_files'] = glob(os.path.join(od, os.path.join('*', '*', '*.%s' % ext))) |
| 476 | + outputs['out_files'] = glob( |
| 477 | + os.path.join(od, os.path.join('*', '*.%s' % ext))) |
| 478 | + elif (self.inputs.output_dir_struct in |
| 479 | + ['patid', 'date_time', 'patname']): |
| 480 | + outputs['out_files'] = glob( |
| 481 | + os.path.join(od, os.path.join('*', '*', '*.%s' % ext))) |
474 | 482 | elif self.inputs.output_dir_struct == 'patid_date':
|
475 |
| - outputs['out_files'] = glob(os.path.join(od, os.path.join('*', '*', '*', '*.%s' % ext))) |
| 483 | + outputs['out_files'] = glob( |
| 484 | + os.path.join(od, os.path.join('*', '*', '*', '*.%s' % ext))) |
476 | 485 | return outputs
|
0 commit comments