@@ -85,7 +85,7 @@ class EditTransform(BaseInterface):
85
85
input_spec = EditTransformInputSpec
86
86
output_spec = EditTransformOutputSpec
87
87
_out_file = ""
88
- _pattern = '\((?P<entry>%s\s"?)([-\.\s\w]+)("?\))'
88
+ _pattern = r '\((?P<entry>%s\s"?)([-\.\s\w]+)("?\))'
89
89
90
90
_interp = {"nearest" : 0 , "linear" : 1 , "cubic" : 3 }
91
91
@@ -103,14 +103,14 @@ def _run_interface(self, runtime):
103
103
p = re .compile (
104
104
(self ._pattern % "ResultImagePixelType" ).decode ("string-escape" )
105
105
)
106
- rep = "(\g<entry>%s\g<3>" % self .inputs .output_type
106
+ rep = r "(\g<entry>%s\g<3>" % self .inputs .output_type
107
107
contents = p .sub (rep , contents )
108
108
109
109
if isdefined (self .inputs .output_format ):
110
110
p = re .compile (
111
111
(self ._pattern % "ResultImageFormat" ).decode ("string-escape" )
112
112
)
113
- rep = "(\g<entry>%s\g<3>" % self .inputs .output_format
113
+ rep = r "(\g<entry>%s\g<3>" % self .inputs .output_format
114
114
contents = p .sub (rep , contents )
115
115
116
116
if isdefined (self .inputs .interpolation ):
@@ -119,7 +119,7 @@ def _run_interface(self, runtime):
119
119
"string-escape"
120
120
)
121
121
)
122
- rep = "(\g<entry>%s\g<3>" % self ._interp [self .inputs .interpolation ]
122
+ rep = r "(\g<entry>%s\g<3>" % self ._interp [self .inputs .interpolation ]
123
123
contents = p .sub (rep , contents )
124
124
125
125
if isdefined (self .inputs .reference_image ):
@@ -130,17 +130,17 @@ def _run_interface(self, runtime):
130
130
131
131
size = " " .join (["%01d" % s for s in im .shape ])
132
132
p = re .compile ((self ._pattern % "Size" ).decode ("string-escape" ))
133
- rep = "(\g<entry>%s\g<3>" % size
133
+ rep = r "(\g<entry>%s\g<3>" % size
134
134
contents = p .sub (rep , contents )
135
135
136
136
index = " " .join (["0" for s in im .shape ])
137
137
p = re .compile ((self ._pattern % "Index" ).decode ("string-escape" ))
138
- rep = "(\g<entry>%s\g<3>" % index
138
+ rep = r "(\g<entry>%s\g<3>" % index
139
139
contents = p .sub (rep , contents )
140
140
141
141
spacing = " " .join (["%0.4f" % f for f in im .header .get_zooms ()])
142
142
p = re .compile ((self ._pattern % "Spacing" ).decode ("string-escape" ))
143
- rep = "(\g<entry>%s\g<3>" % spacing
143
+ rep = r "(\g<entry>%s\g<3>" % spacing
144
144
contents = p .sub (rep , contents )
145
145
146
146
itkmat = np .eye (4 )
@@ -156,7 +156,7 @@ def _run_interface(self, runtime):
156
156
# contents = p.sub(rep, contents)
157
157
158
158
p = re .compile ((self ._pattern % "Origin" ).decode ("string-escape" ))
159
- rep = "(\g<entry>%s\g<3>" % orig
159
+ rep = r "(\g<entry>%s\g<3>" % orig
160
160
contents = p .sub (rep , contents )
161
161
162
162
with open (self ._get_outfile (), "w" ) as of :
0 commit comments