From 507351d497161ee07c17d497f6de90895cba53d8 Mon Sep 17 00:00:00 2001 From: elakkyen Date: Thu, 25 May 2023 13:28:10 +0200 Subject: [PATCH] fixed lowres_axis in nnunet preprocessor.py to get the correct lowest resolution axis --- PyTorch/Segmentation/nnUNet/data_preprocessing/preprocessor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyTorch/Segmentation/nnUNet/data_preprocessing/preprocessor.py b/PyTorch/Segmentation/nnUNet/data_preprocessing/preprocessor.py index 898135898..f780f5185 100644 --- a/PyTorch/Segmentation/nnUNet/data_preprocessing/preprocessor.py +++ b/PyTorch/Segmentation/nnUNet/data_preprocessing/preprocessor.py @@ -217,7 +217,7 @@ def collect_spacings(self): spacing = np.array(spacing) target_spacing = np.median(spacing, axis=0) if max(target_spacing) / min(target_spacing) >= 3: - lowres_axis = np.argmin(target_spacing) + lowres_axis = np.argmax(target_spacing) target_spacing[lowres_axis] = np.percentile(spacing[:, lowres_axis], 10) self.target_spacing = list(target_spacing)