From e0d591107b3a02b9b23c0386526e77645a9b3ab7 Mon Sep 17 00:00:00 2001 From: Liviu Soltuzu Date: Thu, 11 Apr 2024 16:38:15 +0200 Subject: [PATCH] Fix name of overlay generator in warnings --- nnunetv2/experiment_planning/verify_dataset_integrity.py | 2 +- nnunetv2/imageio/nibabel_reader_writer.py | 8 ++++---- nnunetv2/imageio/simpleitk_reader_writer.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/nnunetv2/experiment_planning/verify_dataset_integrity.py b/nnunetv2/experiment_planning/verify_dataset_integrity.py index 71f84bff4..197120fd6 100644 --- a/nnunetv2/experiment_planning/verify_dataset_integrity.py +++ b/nnunetv2/experiment_planning/verify_dataset_integrity.py @@ -93,7 +93,7 @@ def check_cases(image_files: List[str], label_file: str, expected_num_channels: if not np.allclose(affine_image, affine_seg): print('WARNING: Affine is not the same for image and seg! \nAffine image: %s \nAffine seg: %s\n' 'Image files: %s. \nSeg file: %s.\nThis can be a problem but doesn\'t have to be. Please run ' - 'nnUNet_plot_dataset_pngs to verify if everything is OK!\n' + 'nnUNetv2_plot_overlay_pngs to verify if everything is OK!\n' % (affine_image, affine_seg, image_files, label_file)) # sitk checks diff --git a/nnunetv2/imageio/nibabel_reader_writer.py b/nnunetv2/imageio/nibabel_reader_writer.py index 8faafb709..a7d288fc4 100644 --- a/nnunetv2/imageio/nibabel_reader_writer.py +++ b/nnunetv2/imageio/nibabel_reader_writer.py @@ -26,7 +26,7 @@ class NibabelIO(BaseReaderWriter): Nibabel loads the images in a different order than sitk. We convert the axes to the sitk order to be consistent. This is of course considered properly in segmentation export as well. - IMPORTANT: Run nnUNet_plot_dataset_pngs to verify that this did not destroy the alignment of data and seg! + IMPORTANT: Run nnUNetv2_plot_overlay_pngs to verify that this did not destroy the alignment of data and seg! """ supported_file_endings = [ '.nii.gz', @@ -67,7 +67,7 @@ def read_images(self, image_fnames: Union[List[str], Tuple[str, ...]]) -> Tuple[ print(original_affines) print('Image files:') print(image_fnames) - print('It is up to you to decide whether that\'s a problem. You should run nnUNet_plot_dataset_pngs to verify ' + print('It is up to you to decide whether that\'s a problem. You should run nnUNetv2_plot_overlay_pngs to verify ' 'that segmentations and data overlap.') if not self._check_all_same(spacings_for_nnunet): print('ERROR! Not all input images have the same spacing_for_nnunet! This might be caused by them not ' @@ -104,7 +104,7 @@ class NibabelIOWithReorient(BaseReaderWriter): Nibabel loads the images in a different order than sitk. We convert the axes to the sitk order to be consistent. This is of course considered properly in segmentation export as well. - IMPORTANT: Run nnUNet_plot_dataset_pngs to verify that this did not destroy the alignment of data and seg! + IMPORTANT: Run nnUNetv2_plot_overlay_pngs to verify that this did not destroy the alignment of data and seg! """ supported_file_endings = [ '.nii.gz', @@ -149,7 +149,7 @@ def read_images(self, image_fnames: Union[List[str], Tuple[str, ...]]) -> Tuple[ print(reoriented_affines) print('Image files:') print(image_fnames) - print('It is up to you to decide whether that\'s a problem. You should run nnUNet_plot_dataset_pngs to verify ' + print('It is up to you to decide whether that\'s a problem. You should run nnUNetv2_plot_overlay_pngs to verify ' 'that segmentations and data overlap.') if not self._check_all_same(spacings_for_nnunet): print('ERROR! Not all input images have the same spacing_for_nnunet! This might be caused by them not ' diff --git a/nnunetv2/imageio/simpleitk_reader_writer.py b/nnunetv2/imageio/simpleitk_reader_writer.py index 6a9afc24f..f8c645c11 100644 --- a/nnunetv2/imageio/simpleitk_reader_writer.py +++ b/nnunetv2/imageio/simpleitk_reader_writer.py @@ -78,7 +78,7 @@ def read_images(self, image_fnames: Union[List[str], Tuple[str, ...]]) -> Tuple[ print(origins) print('Image files:') print(image_fnames) - print('It is up to you to decide whether that\'s a problem. You should run nnUNet_plot_dataset_pngs to verify ' + print('It is up to you to decide whether that\'s a problem. You should run nnUNetv2_plot_overlay_pngs to verify ' 'that segmentations and data overlap.') if not self._check_all_same(directions): print('WARNING! Not all input images have the same direction!') @@ -86,7 +86,7 @@ def read_images(self, image_fnames: Union[List[str], Tuple[str, ...]]) -> Tuple[ print(directions) print('Image files:') print(image_fnames) - print('It is up to you to decide whether that\'s a problem. You should run nnUNet_plot_dataset_pngs to verify ' + print('It is up to you to decide whether that\'s a problem. You should run nnUNetv2_plot_overlay_pngs to verify ' 'that segmentations and data overlap.') if not self._check_all_same(spacings_for_nnunet): print('ERROR! Not all input images have the same spacing_for_nnunet! (This should not happen and must be a '