From e6d19be120307319fbb283a771f9418634bba28a Mon Sep 17 00:00:00 2001 From: Karol Gotkowski Date: Tue, 17 Oct 2023 14:12:12 +0200 Subject: [PATCH] fix: Fixed metadata conversion --- particleseg3d/train/preprocess.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/particleseg3d/train/preprocess.py b/particleseg3d/train/preprocess.py index 730f55e..fa6baba 100644 --- a/particleseg3d/train/preprocess.py +++ b/particleseg3d/train/preprocess.py @@ -125,8 +125,8 @@ def preprocess_single(i: int, image = utils.standardize(image, zscore) image_shape = image.shape - source_particle_size_in_mm = tuple(metadata[name]["particle_size"]) - source_spacing = tuple(metadata[name]["spacing"]) + source_particle_size_in_mm = [metadata[name]["particle_size"]] * 3 + source_spacing = [metadata[name]["spacing"]] * 3 target_particle_size_in_mm = tuple(utils.pixel2mm(target_particle_size_in_pixel, target_spacing)) size_conversion_factor = utils.compute_size_conversion_factor(source_particle_size_in_mm, source_spacing, target_particle_size_in_mm, target_spacing)