Skip to content

Commit

Permalink
ensure sampling can be done for different levels
Browse files Browse the repository at this point in the history
  • Loading branch information
sarthakpati committed Mar 31, 2024
1 parent 63d70c8 commit 7d37b97
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ereg/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,9 +452,11 @@ def _register_image_and_get_transform(
self.parameters.get("sampling_strategy", "random").lower()
]
)
R.SetMetricSamplingPercentage(
self.parameters.get("sampling_percentage", 0.01)
)
sampling_rate = self.parameters.get("sampling_percentage", 0.01)
if isinstance(sampling_rate, float):
R.SetMetricSamplingPercentage(sampling_rate)
elif type(sampling_rate) in [np.ndarray, list]:
R.SetMetricSamplingPercentagePerLevel(sampling_rate)

self.parameters["optimizer_parameters"] = self.parameters.get(
"optimizer_parameters", {}
Expand Down

0 comments on commit 7d37b97

Please sign in to comment.