From 466a6728fc2c78ff18af3f3a3e4c38386e4d4c8b Mon Sep 17 00:00:00 2001 From: Yiheng Wang Date: Tue, 7 Jan 2025 06:05:03 +0000 Subject: [PATCH] fix code format issue Signed-off-by: Yiheng Wang --- monai/data/image_reader.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/monai/data/image_reader.py b/monai/data/image_reader.py index c189a35eda..a7eddc7671 100644 --- a/monai/data/image_reader.py +++ b/monai/data/image_reader.py @@ -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 @@ -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: @@ -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: