diff --git a/deep_utils/__init__.py b/deep_utils/__init__.py index 34133c1..8e0f975 100644 --- a/deep_utils/__init__.py +++ b/deep_utils/__init__.py @@ -4,7 +4,7 @@ from .utils.lib_utils.integeration_utils import import_lazy_module # Deep Utils version number -__version__ = "1.3.61" +__version__ = "1.3.62" from .utils.constants import DUMMY_PATH, Backends diff --git a/deep_utils/medical/sitk_utils/sitk_utils.py b/deep_utils/medical/sitk_utils/sitk_utils.py index f9e9d7e..540ce4b 100644 --- a/deep_utils/medical/sitk_utils/sitk_utils.py +++ b/deep_utils/medical/sitk_utils/sitk_utils.py @@ -174,9 +174,9 @@ def save_sample(input_sample: np.ndarray, org_sitk_img: Optional[Image], sample_sitk.SetSpacing(spacing) else: spacing = list(org_sitk_img.GetSpacing()) - if remove_index and len(spacing) > 3: + if remove_index is not None and len(spacing) > 3: del spacing[remove_index] - if slice_index and len(spacing) > 3: + if slice_index is not None and len(spacing) > 3: del spacing[slice_index] sample_sitk.SetSpacing(spacing) @@ -187,10 +187,10 @@ def save_sample(input_sample: np.ndarray, org_sitk_img: Optional[Image], org_flat_direction = np.array(org_sitk_img.GetDirection()) direction_size = int(math.sqrt(len(org_flat_direction))) original_direction = org_flat_direction.reshape(direction_size, direction_size) - if remove_index and direction_size > 3: + if remove_index is not None and direction_size > 3: original_direction = np.delete(original_direction, remove_index, 0) original_direction = np.delete(original_direction, remove_index, 1) - if slice_index and direction_size > 3: + if slice_index is not None and direction_size > 3: original_direction = np.delete(original_direction, slice_index, 0) original_direction = np.delete(original_direction, slice_index, 1) @@ -202,9 +202,9 @@ def save_sample(input_sample: np.ndarray, org_sitk_img: Optional[Image], else: original_origin = list(org_sitk_img.GetOrigin()) org_size = len(original_origin) - if remove_index and org_size > 3: + if remove_index is not None and org_size > 3: del original_origin[remove_index] - if slice_index and org_size > 3: + if slice_index is not None and org_size > 3: del original_origin[slice_index] # submatrix_direction = original_direction[:3, :3].flatten() diff --git a/setup.py b/setup.py index c52013d..2ebb511 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ import setuptools -VERSION = "1.3.61" +VERSION = "1.3.62" long_description = open("Readme.md", mode="r", encoding="utf-8").read()