@@ -63,7 +63,7 @@ def to_filename(self, filename):
63
63
f .write (self .to_string ())
64
64
65
65
def to_ras (self ):
66
- """Return a nitransforms' internal RAS matrix."""
66
+ """Return a nitransforms internal RAS+ matrix."""
67
67
sa = self .structarr
68
68
matrix = sa ['parameters' ]
69
69
offset = sa ['offset' ]
@@ -165,10 +165,10 @@ def xforms(self):
165
165
166
166
@xforms .setter
167
167
def xforms (self , value ):
168
- self ._xforms = value
168
+ self ._xforms = list ( value )
169
169
170
170
# Update indexes
171
- for i , val in enumerate (self ._xforms ):
171
+ for i , val in enumerate (self .xforms ):
172
172
val ['index' ] = i
173
173
174
174
def __getitem__ (self , idx ):
@@ -182,14 +182,14 @@ def __getitem__(self, idx):
182
182
def to_filename (self , filename ):
183
183
"""Store this transform to a file with the appropriate format."""
184
184
if str (filename ).endswith ('.mat' ):
185
- raise TransformFileError (' Please use the ITK\ ' s new .h5 format.' )
185
+ raise TransformFileError (" Please use the ITK's new .h5 format." )
186
186
187
187
with open (str (filename ), 'w' ) as f :
188
188
f .write (self .to_string ())
189
189
190
190
def to_ras (self ):
191
191
"""Return a nitransforms' internal RAS matrix."""
192
- return np .stack ([xfm .to_ras () for xfm in self ._xforms ])
192
+ return np .stack ([xfm .to_ras () for xfm in self .xforms ])
193
193
194
194
def to_string (self ):
195
195
"""Convert to a string directly writeable to file."""
@@ -202,7 +202,7 @@ def to_string(self):
202
202
@classmethod
203
203
def from_binary (cls , byte_stream ):
204
204
"""Read the struct from a matlab binary file."""
205
- raise TransformFileError (' Please use the ITK\ ' s new .h5 format.' )
205
+ raise TransformFileError (" Please use the ITK's new .h5 format." )
206
206
207
207
@classmethod
208
208
def from_fileobj (cls , fileobj , check = True ):
0 commit comments