@@ -85,7 +85,7 @@ class EditTransform(BaseInterface):
8585 input_spec = EditTransformInputSpec
8686 output_spec = EditTransformOutputSpec
8787 _out_file = ""
88- _pattern = '\((?P<entry>%s\s"?)([-\.\s\w]+)("?\))'
88+ _pattern = r '\((?P<entry>%s\s"?)([-\.\s\w]+)("?\))'
8989
9090 _interp = {"nearest" : 0 , "linear" : 1 , "cubic" : 3 }
9191
@@ -103,14 +103,14 @@ def _run_interface(self, runtime):
103103 p = re .compile (
104104 (self ._pattern % "ResultImagePixelType" ).decode ("string-escape" )
105105 )
106- rep = "(\g<entry>%s\g<3>" % self .inputs .output_type
106+ rep = r "(\g<entry>%s\g<3>" % self .inputs .output_type
107107 contents = p .sub (rep , contents )
108108
109109 if isdefined (self .inputs .output_format ):
110110 p = re .compile (
111111 (self ._pattern % "ResultImageFormat" ).decode ("string-escape" )
112112 )
113- rep = "(\g<entry>%s\g<3>" % self .inputs .output_format
113+ rep = r "(\g<entry>%s\g<3>" % self .inputs .output_format
114114 contents = p .sub (rep , contents )
115115
116116 if isdefined (self .inputs .interpolation ):
@@ -119,7 +119,7 @@ def _run_interface(self, runtime):
119119 "string-escape"
120120 )
121121 )
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 ]
123123 contents = p .sub (rep , contents )
124124
125125 if isdefined (self .inputs .reference_image ):
@@ -130,17 +130,17 @@ def _run_interface(self, runtime):
130130
131131 size = " " .join (["%01d" % s for s in im .shape ])
132132 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
134134 contents = p .sub (rep , contents )
135135
136136 index = " " .join (["0" for s in im .shape ])
137137 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
139139 contents = p .sub (rep , contents )
140140
141141 spacing = " " .join (["%0.4f" % f for f in im .header .get_zooms ()])
142142 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
144144 contents = p .sub (rep , contents )
145145
146146 itkmat = np .eye (4 )
@@ -156,7 +156,7 @@ def _run_interface(self, runtime):
156156 # contents = p.sub(rep, contents)
157157
158158 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
160160 contents = p .sub (rep , contents )
161161
162162 with open (self ._get_outfile (), "w" ) as of :
0 commit comments