Skip to content

Commit 8e23723

Browse files
committed
fix: alter lta type, only use lta extension
1 parent dc6c6b1 commit 8e23723

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

nitransforms/linear.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ def to_filename(self, filename, fmt='X5', moving=None):
298298
else:
299299
np.savetxt(filename, mat[0], delimiter=' ', fmt='%g')
300300
return filename
301-
elif fmt.lower() in ('fs', 'lta'):
301+
elif fmt.lower() == 'lta':
302302
# xform info
303303
lt = LinearTransform()
304304
lt['sigma'] = 1.
@@ -342,12 +342,13 @@ def load(filename, fmt='X5', reference=None):
342342
# elif fmt.lower() == 'afni':
343343
# parameters = LPS.dot(self.matrix.dot(LPS))
344344
# parameters = parameters[:3, :].reshape(-1).tolist()
345-
elif fmt.lower() in ('fs', 'lta'):
345+
elif fmt.lower() == 'lta':
346346
with open(filename) as ltafile:
347347
lta = LinearTransformArray.from_fileobj(ltafile)
348-
assert lta['nxforms'] == 1 # ever have multiple transforms?
348+
if lta['nxforms'] > 1:
349+
raise NotImplementedError("Multiple transforms are not yet supported.")
349350
if lta['type'] != 1:
350-
lta.as_type(1)
351+
lta.set_type(1)
351352
matrix = lta['xforms'][0]['m_L']
352353
elif fmt.lower() in ('x5', 'bids'):
353354
raise NotImplementedError

0 commit comments

Comments
 (0)