Skip to content

Commit

Permalink
fix code format issue
Browse files Browse the repository at this point in the history
Signed-off-by: Yiheng Wang <vennw@nvidia.com>
  • Loading branch information
yiheng-wang-nv committed Jan 7, 2025
1 parent 794f645 commit 466a672
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions monai/data/image_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,6 @@ def get_data(self, data) -> tuple[np.ndarray, dict]:
metadata[MetaKeys.SPATIAL_SHAPE] = data_array.shape
dicom_data.append((data_array, metadata))


# TODO: the actual type is list[np.ndarray | cp.ndarray]
# should figure out how to define correct types without having cupy not found error
# https://github.com/Project-MONAI/MONAI/pull/8188#discussion_r1886645918
Expand Down Expand Up @@ -796,9 +795,7 @@ def _get_frame_data(self, img, filename, array_data) -> Iterator:
"""

if not hasattr(img, "PerFrameFunctionalGroupsSequence"):
raise NotImplementedError(
f"To read dicom seg: {filename}, 'PerFrameFunctionalGroupsSequence' is required."
)
raise NotImplementedError(f"To read dicom seg: {filename}, 'PerFrameFunctionalGroupsSequence' is required.")

frame_seg_nums = []
for f in img.PerFrameFunctionalGroupsSequence:
Expand Down Expand Up @@ -910,7 +907,7 @@ def _get_array_data(self, img, filename):
columns = img.Columns
bits_allocated = img.BitsAllocated
samples_per_pixel = img.SamplesPerPixel
number_of_frames = getattr(img, 'NumberOfFrames', 1)
number_of_frames = getattr(img, "NumberOfFrames", 1)
pixel_representation = img.PixelRepresentation

if bits_allocated == 8:
Expand Down

0 comments on commit 466a672

Please sign in to comment.