@@ -63,63 +63,63 @@ class C3dAffineTool(SEMLikeCommandLine):
63
63
64
64
class C3dInputSpec (CommandLineInputSpec ):
65
65
in_file = InputMultiPath (File (),
66
- position = 1 ,
67
- argstr = "%s" ,
68
- mandatory = True ,
69
- desc = "Input file (wildcard and multiple are supported)" )
66
+ position = 1 ,
67
+ argstr = "%s" ,
68
+ mandatory = True ,
69
+ desc = "Input file (wildcard and multiple are supported)" )
70
70
out_file = File (exists = False ,
71
- argstr = "-o %s" ,
72
- position = - 1 ,
73
- xor = ["out_files" ],
74
- desc = "Output file of last image on the stack" )
71
+ argstr = "-o %s" ,
72
+ position = - 1 ,
73
+ xor = ["out_files" ],
74
+ desc = "Output file of last image on the stack" )
75
75
out_files = InputMultiPath (File (),
76
- argstr = "-oo %s" ,
77
- xor = ["out_file" ],
78
- position = - 1 ,
79
- desc = ("Write all images on the convert3d stack as multiple files."
80
- " Supports both list of output files or a pattern for the output"
81
- " filenames (using %d substituion)." ))
76
+ argstr = "-oo %s" ,
77
+ xor = ["out_file" ],
78
+ position = - 1 ,
79
+ desc = ("Write all images on the convert3d stack as multiple files."
80
+ " Supports both list of output files or a pattern for the output"
81
+ " filenames (using %d substituion)." ))
82
82
pix_type = traits .Enum ("float" , "char" , "uchar" , "short" , "ushort" , "int" , "uint" , "double" ,
83
- argstr = "-type %s" ,
84
- desc = ("Specifies the pixel type for the output image. By default, images are written in"
85
- " floating point (float) format" ))
83
+ argstr = "-type %s" ,
84
+ desc = ("Specifies the pixel type for the output image. By default, images are written in"
85
+ " floating point (float) format" ))
86
86
scale = traits .Either (traits .Int (), traits .Float (),
87
- argstr = "-scale %s" ,
88
- desc = "Multiplies the intensity of each voxel in the last image on the stack by the given factor." )
87
+ argstr = "-scale %s" ,
88
+ desc = "Multiplies the intensity of each voxel in the last image on the stack by the given factor." )
89
89
shift = traits .Either (traits .Int (), traits .Float (),
90
- argstr = "-shift %s" ,
91
- desc = 'Adds the given constant to every voxel.' )
90
+ argstr = "-shift %s" ,
91
+ desc = 'Adds the given constant to every voxel.' )
92
92
interp = traits .Enum ("Linear" , "NearestNeighbor" , "Cubic" , "Sinc" , "Gaussian" ,
93
- argstr = "-interpolation %s" ,
94
- desc = "Specifies the interpolation used with -resample and other commands. Default is Linear." )
93
+ argstr = "-interpolation %s" ,
94
+ desc = "Specifies the interpolation used with -resample and other commands. Default is Linear." )
95
95
resample = traits .Str (argstr = "-resample %s" ,
96
- desc = ("Resamples the image, keeping the bounding box the same, but changing the number of"
97
- " voxels in the image. The dimensions can be specified as a percentage, for example to"
98
- " double the number of voxels in each direction. The -interpolation flag affects how"
99
- " sampling is performed." ))
96
+ desc = ("Resamples the image, keeping the bounding box the same, but changing the number of"
97
+ " voxels in the image. The dimensions can be specified as a percentage, for example to"
98
+ " double the number of voxels in each direction. The -interpolation flag affects how"
99
+ " sampling is performed." ))
100
100
smooth = traits .Str (argstr = "-smooth %s" ,
101
- desc = ("Applies Gaussian smoothing to the image. The parameter vector specifies the"
102
- " standard deviation of the Gaussian kernel." ))
101
+ desc = ("Applies Gaussian smoothing to the image. The parameter vector specifies the"
102
+ " standard deviation of the Gaussian kernel." ))
103
103
multicomp_split = traits .Bool (False ,
104
- usedefault = True ,
105
- argstr = "-mcr" ,
106
- position = 0 ,
107
- desc = "Enable reading of multi-component images." )
108
- is_4d = traits .Bool (False ,
109
- usedefault = True ,
110
- desc = "Changes command to support 4D file operations (default is false)." )
104
+ usedefault = True ,
105
+ argstr = "-mcr" ,
106
+ position = 0 ,
107
+ desc = "Enable reading of multi-component images." )
108
+ is_4d = traits .Bool (False ,
109
+ usedefault = True ,
110
+ desc = "Changes command to support 4D file operations (default is false)." )
111
111
112
112
class C3dOutputSpec (TraitedSpec ):
113
113
out_files = OutputMultiPath (File (exists = False ))
114
114
115
115
class C3d (CommandLine ):
116
116
"""
117
- Convert3d is a command-line tool for converting 3D (or 4D) images between common
118
- file formats. The tool also includes a growing list of commands for image manipulation,
119
- such as thresholding and resampling. The tool can also be used to obtain information about
117
+ Convert3d is a command-line tool for converting 3D (or 4D) images between common
118
+ file formats. The tool also includes a growing list of commands for image manipulation,
119
+ such as thresholding and resampling. The tool can also be used to obtain information about
120
120
image files. More information on Convert3d can be found at:
121
121
https://sourceforge.net/p/c3d/git/ci/master/tree/doc/c3d.md
122
-
122
+
123
123
124
124
Example
125
125
=======
@@ -174,7 +174,7 @@ def _list_outputs(self):
174
174
if isdefined (self .inputs .out_file ):
175
175
outputs ["out_files" ] = os .path .abspath (self .inputs .out_file )
176
176
if isdefined (self .inputs .out_files ):
177
- if not len (self .inputs .out_files ) > 1 :
177
+ if len (self .inputs .out_files ) == 1 :
178
178
_out_files = glob (os .path .abspath (self .inputs .out_files [0 ]))
179
179
else :
180
180
_out_files = [os .path .abspath (fl ) for fl in self .inputs .out_files
0 commit comments