Skip to content

Commit

Permalink
Merge pull request #560 from ANTsX/n4mask
Browse files Browse the repository at this point in the history
ENH:  Coordinate with other n4 usage.
  • Loading branch information
ntustison authored Mar 8, 2024
2 parents a5456e1 + 3d7c6cc commit b8e7118
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ants/utils/bias_correction.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def n3_bias_field_correction2(
image to bias correct
mask : ANTsImage
input mask, if one is not passed one will be made
Input mask. If not specified, the entire image is used.
rescale_intensities : boolean
At each iteration, a new intensity mapping is
Expand Down Expand Up @@ -112,7 +112,7 @@ def n3_bias_field_correction2(
iters = convergence["iters"]
tol = convergence["tol"]
if mask is None:
mask = get_mask(image)
mask = image * 0 + 1
if spline_param is None:
spline_param = [1] * image.dimension

Expand Down Expand Up @@ -182,7 +182,7 @@ def n4_bias_field_correction(
image to bias correct
mask : ANTsImage
input mask, if one is not passed one will be made
Input mask. If not specified, the entire image is used.
rescale_intensities : boolean
At each iteration, a new intensity mapping is
Expand Down Expand Up @@ -228,8 +228,9 @@ def n4_bias_field_correction(
image = image.clone("float")
iters = convergence["iters"]
tol = convergence["tol"]

if mask is None:
mask = get_mask(image)
mask = image * 0 + 1
if spline_param is None:
spline_param = [1] * image.dimension

Expand Down

1 comment on commit b8e7118

@samtorrisi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh this is great. i didn't like the automasks when n3 or n4-ing in antspy. thanks!

Please sign in to comment.