File tree 2 files changed +9
-7
lines changed
2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -202,13 +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
- mdict = _read_mat (byte_stream )
206
- nxforms = mdict ['fixed' ].shape [0 ]
207
-
208
- _self = cls ()
209
- _self .xforms = [ITKLinearTransform .from_matlab_dict (mdict , i )
210
- for i in range (nxforms )]
211
- return _self
205
+ raise TransformFileError ('Please use the ITK\' s new .h5 format.' )
212
206
213
207
@classmethod
214
208
def from_fileobj (cls , fileobj , check = True ):
Original file line number Diff line number Diff line change @@ -133,9 +133,17 @@ def test_ITKLinearTransformArray(tmpdir, data_path):
133
133
assert np .allclose (xfm .structarr ['parameters' ][:3 , ...],
134
134
xfm2 .structarr ['parameters' ][:3 , ...])
135
135
136
+ # ITK does not handle transforms lists in Matlab format
136
137
with pytest .raises (TransformFileError ):
137
138
itklist .to_filename ('matlablist.mat' )
138
139
140
+ with pytest .raises (TransformFileError ):
141
+ xfm2 = itk .ITKLinearTransformArray .from_binary ({})
142
+
143
+ with open ('filename.mat' , 'ab' ) as f :
144
+ with pytest .raises (TransformFileError ):
145
+ xfm2 = itk .ITKLinearTransformArray .from_fileobj (f )
146
+
139
147
140
148
@pytest .mark .parametrize ('matlab_ver' , ['4' , '5' ])
141
149
def test_read_mat1 (tmpdir , matlab_ver ):
You can’t perform that action at this time.
0 commit comments