diff --git a/src/python/dicomifier/bruker_to_dicom/iods/enhanced_mr_image_storage.py b/src/python/dicomifier/bruker_to_dicom/iods/enhanced_mr_image_storage.py index ebb6573..7943b7e 100644 --- a/src/python/dicomifier/bruker_to_dicom/iods/enhanced_mr_image_storage.py +++ b/src/python/dicomifier/bruker_to_dicom/iods/enhanced_mr_image_storage.py @@ -110,10 +110,10 @@ def enhanced_mr_image_storage(bruker_data_set, transfer_syntax, ideal_b_values): merge_shared_groups(dicom_data_set, groups) - pixel_data_list = [] - for i, frame_index in enumerate(generator): - pixel_data_list.append( - image.get_pixel_data(bruker_data_set, generator, frame_index)[0]) + pixel_data_list = [ + image.get_pixel_data(bruker_data_set, generator, frame_index)[0] + for frame_index in generator + ] dicom_data_set.add( odil.registry.PixelData, diff --git a/tests/python/bruker/test_dataset.py b/tests/python/bruker/test_dataset.py index 35d3328..59b806a 100644 --- a/tests/python/bruker/test_dataset.py +++ b/tests/python/bruker/test_dataset.py @@ -35,9 +35,7 @@ def test_load(self): dataset = dicomifier.bruker.Dataset() dataset.load(self.path) - fields = [] - for name, value in dataset.items(): - fields.append([name, value]) + fields = [[name, value] for name, value in dataset.items()] self.assertEqual([x[0] for x in fields], [x for x in dataset]) expected_fields = [