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: 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) 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,