Skip to content

Commit a37e276

Browse files
bpinsardyarikoptic
authored andcommitted
test data include messed-up dicoms with no affine
1 parent 115b227 commit a37e276

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

heudiconv/heuristics/convertall.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ def custom_seqinfo(wrapper: dw.Wrapper, series_files: list[str], **kw: Any) -> t
2121
# for already loaded DICOM data, and including storing/returning
2222
# the sample series file as was requested
2323
# in https://github.com/nipy/heudiconv/pull/333
24-
return wrapper.affine.tostring(), series_files[0]
24+
from nibabel.nicom.dicomwrappers import WrapperError
25+
try:
26+
affine = wrapper.affine.tostring()
27+
except WrapperError:
28+
affine = None
29+
return affine, series_files[0]
2530

2631

2732
def infotodict(

0 commit comments

Comments
 (0)