Skip to content

Commit

Permalink
Merge pull request #54 from BrainLesion/53-bug-keyerror-bias_correct
Browse files Browse the repository at this point in the history
fixed bug related to `bias`
  • Loading branch information
neuronflow authored Mar 30, 2024
2 parents e5127d0 + ec0a807 commit 01d3cd9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ereg/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion ereg/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion unit_tests/test_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 01d3cd9

Please sign in to comment.