Skip to content

Commit b7ef629

Browse files
committed
fix: set missing import to None, ensure first frame exists before fetching
1 parent bbd420a commit b7ef629

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

nibabel/nicom/dicomwrappers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ def __init__(self, dcm_data):
467467
except TypeError:
468468
raise WrapperError("PerFrameFunctionalGroupsSequence is empty.")
469469
# DWI image where derived isotropic, ADC or trace volume was appended to the series
470-
if self.frames[0].get([0x18, 0x9117]):
470+
if self.frames[0] and self.frames[0].get([0x18, 0x9117], None):
471471
self.frames = Sequence(
472472
frame for frame in self.frames if
473473
frame.get([0x18, 0x9117])[0].get([0x18, 0x9075]).value

nibabel/pydicom_compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import numpy as np
2222

2323
have_dicom = True
24-
pydicom = read_file = tag_for_keyword = None
24+
pydicom = read_file = tag_for_keyword = Sequence = None
2525

2626
try:
2727
import dicom as pydicom

0 commit comments

Comments
 (0)