diff --git a/mu_map/data/prepare.py b/mu_map/data/prepare.py index 2037fd7767d5aba0602437ea76835480aa2d55e6..3f5adfca9be1c9312d84575a6aeca45bdc0d6ef7 100644 --- a/mu_map/data/prepare.py +++ b/mu_map/data/prepare.py @@ -406,7 +406,7 @@ if __name__ == "__main__": ), f"Not all pixel spacings of the reconstructions are equal: {pixel_spacings}" pixel_spacing = pixel_spacings[0] - # extract shapes and assert that they are equal for all reconstruction images + # use the shape with the fewest slices, all other images will be aligned to that _map_lists = map( lambda image: [image.Rows, image.Columns, image.NumberOfSlices], recon_images, @@ -414,9 +414,7 @@ if __name__ == "__main__": _map_lists = map(lambda shape: list(map(int, shape)), _map_lists) _map_ndarrays = map(lambda shape: np.array(shape), _map_lists) shapes = list(_map_ndarrays) - _equal = all(map(lambda shape: (shape == shapes[0]).all(), shapes)) - # assert _equal, f"Not all shapes of the reconstructions are equal: {shapes}" - # print(shapes) + shapes.sort(key=lambda shape: shape[2]) shape = shapes[0] # exctract and sort energy windows