From 7dd150b9de42a32fe4404df2e9a403280ff32a08 Mon Sep 17 00:00:00 2001 From: sarthakpati Date: Sat, 30 Mar 2024 13:42:41 -0400 Subject: [PATCH 1/3] fixed bug --- ereg/registration.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ereg/registration.py b/ereg/registration.py index d3e0dea..5c27ba1 100644 --- a/ereg/registration.py +++ b/ereg/registration.py @@ -150,7 +150,7 @@ def register( target_image = read_image_and_cast_to_32bit_float(target_image) moving_image = read_image_and_cast_to_32bit_float(moving_image) - if self.parameters["bias_correct"]: + if self.parameters.get("bias"): self.logger.info("Bias correcting images.") target_image = self._bias_correct_image(target_image) moving_image = self._bias_correct_image(moving_image) From fa1b974d28277c051873b9ac07ac9ce051986823 Mon Sep 17 00:00:00 2001 From: sarthakpati Date: Sat, 30 Mar 2024 13:44:02 -0400 Subject: [PATCH 2/3] added test for checking `bias` in the registration class --- unit_tests/test_full.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unit_tests/test_full.py b/unit_tests/test_full.py index a71355b..536c70d 100644 --- a/unit_tests/test_full.py +++ b/unit_tests/test_full.py @@ -89,7 +89,7 @@ def test_registration_function(): tempfile.gettempdir(), "tcia_aaac_t1ce_registered.nii.gz" ) atlas_sri = os.path.join(atlas_data_dir, "sri24", "image.nii.gz") - test_config = {"initialization": "moments"} + test_config = {"initialization": "moments", "bias": True} registration_function( target_image=atlas_sri, moving_image=moving_image, From ec0a807176a7b3502e7e17de7251699f6eeeb9b6 Mon Sep 17 00:00:00 2001 From: sarthakpati Date: Sat, 30 Mar 2024 13:45:21 -0400 Subject: [PATCH 3/3] updated docstring comments --- ereg/functional.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ereg/functional.py b/ereg/functional.py index 4bed1f9..9e432a5 100644 --- a/ereg/functional.py +++ b/ereg/functional.py @@ -10,7 +10,7 @@ def registration_function( target_image: Union[str, sitk.Image], moving_image: Union[str, sitk.Image], output_image: str, - configuration: str = None, + configuration: Union[str, dict] = None, transform_file: str = None, log_file: str = None, **kwargs, @@ -22,7 +22,7 @@ def registration_function( target_image (Union[str, sitk.Image]): The target image. moving_image (Union[str, sitk.Image]): The moving image. output_image (str): The output image. - config_file (str, optional): The config file for the registration. Defaults to None. + configuration (Union[str, dict], optional): The configuration file or dictionary. Defaults to None. transform_file (str, optional): The transform file. Defaults to None. Returns: