Skip to content

Commit

Permalink
Merge pull request #552 from samtygier-stfc/551_fix_remove_ring_theta…
Browse files Browse the repository at this point in the history
…_min

551 fix remove ring theta min
  • Loading branch information
carterbox committed Jul 15, 2021
2 parents 774dc90 + bcf1bbd commit 7683092
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion source/libtomo/misc/remove_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ remove_ring(float* data, float center_x, float center_y, int dx, int dy, int dz,
polar_image =
polar_transform(image, center_x, center_y, dx, dy, &pol_width, &pol_height,
thresh_max, thresh_min, r_scale, ang_scale, ring_width);
m_azi = ceil((float) pol_height / 360.0) * angular_min;
m_azi = floor((float) pol_height / 360.0 * angular_min);
m_rad = 2 * ring_width + 1;

// Call Ring Algorithm
Expand Down
6 changes: 5 additions & 1 deletion source/tomopy/misc/corr.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,8 @@ def remove_ring(rec, center_x=None, center_y=None, thresh=300.0,
thresh_min : float, optional
min value for portion of image to filer
theta_min : int, optional
minimum angle in degrees (int) to be considered ring artifact
Features larger than twice this angle (degrees) will be considered
a ring artifact. Must be less than 180 degrees.
rwidth : int, optional
Maximum width of the rings to be filtered in pixels
int_mode : str, optional
Expand Down Expand Up @@ -598,6 +599,9 @@ def remove_ring(rec, center_x=None, center_y=None, thresh=300.0,
else:
raise ValueError("int_mode should be WRAP or REFLECT")

if not 0 <= theta_min < 180:
raise ValueError("theta_min should be in the range [0 - 180)")

args = (center_x, center_y, dx, dy, dz, thresh_max, thresh_min,
thresh, theta_min, rwidth, int_mode)

Expand Down

0 comments on commit 7683092

Please sign in to comment.