Skip to content

Commit 41027b1

Browse files
committed
enh: allow lta comments at beginning of file
1 parent 45a0a2f commit 41027b1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

nitransforms/io/lta.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,13 @@ def from_string(klass, string):
191191
lta = klass()
192192
sa = lta.structarr
193193
lines = string.splitlines()
194+
while lines:
195+
if not lines[0].startswith('type'):
196+
lines.pop(0)
197+
continue
198+
break
199+
if not lines:
200+
raise Exception("Invalid LTA format")
194201
for key in ('type', 'nxforms'):
195202
label, valstring = lines.pop(0).split(' = ')
196203
assert label.strip() == key

0 commit comments

Comments
 (0)