@@ -35,7 +35,8 @@ class CopyGeomInputSpec(FSLCommandInputSpec):
35
35
in_file = File (exists = True , mandatory = True , argstr = "%s" , position = 0 ,
36
36
desc = "source image" )
37
37
dest_file = File (exists = True , mandatory = True , argstr = "%s" , position = 1 ,
38
- desc = "destination image" , copyfile = True )
38
+ desc = "destination image" , copyfile = True , output_name = 'out_file' ,
39
+ name_source = 'dest_file' , name_template = '%s' )
39
40
ignore_dims = traits .Bool (desc = ('Do not copy image dimensions' ),
40
41
argstr = '-d' , position = "-1" )
41
42
@@ -44,37 +45,16 @@ class CopyGeomOutputSpec(TraitedSpec):
44
45
45
46
class CopyGeom (FSLCommand ):
46
47
"""Use fslcpgeom to copy the header geometry information to another image.
47
-
48
48
Copy certain parts of the header information (image dimensions, voxel dimensions,
49
49
voxel dimensions units string, image orientation/origin or qform/sform info)
50
50
from one image to another. Note that only copies from Analyze to Analyze
51
51
or Nifti to Nifti will work properly. Copying from different files will result
52
52
in loss of information or potentially incorrect settings.
53
-
54
53
"""
55
54
_cmd = "fslcpgeom"
56
55
input_spec = CopyGeomInputSpec
57
56
output_spec = CopyGeomOutputSpec
58
57
59
- def _run_interface (self , runtime ):
60
- # Copy destination file to new local file to prevent overwriting
61
- # and update destination file
62
- out_file = self ._gen_filename ('out_file' )
63
- copyfile (self .inputs .dest_file , out_file , copy = True )
64
- self .inputs .dest_file = out_file
65
- return super (CopyGeom , self )._run_interface (runtime )
66
-
67
- def _gen_filename (self , name ):
68
- if name == 'out_file' :
69
- return self ._gen_fname (self .inputs .dest_file , suffix = "_newhd" )
70
- return None
71
-
72
- def _list_outputs (self ):
73
- outputs = self .output_spec ().get ()
74
- # Use the new destination file updated by _run_interface
75
- outputs ['out_file' ] = self .inputs .dest_file
76
- return outputs
77
-
78
58
79
59
class RobustFOVInputSpec (FSLCommandInputSpec ):
80
60
in_file = File (exists = True ,
0 commit comments