CIL icon indicating copy to clipboard operation
CIL copied to clipboard

Automatically shrink reconstruction volume

Open hrobarts opened this issue 2 months ago • 0 comments

Changes

Code to reduce the reconstruction volume

  • Performs a quick binned reconstruction and applies a circular mask (maybe this should be optional)
  • If auto=True, tries to automatically find the limits for the reduced reconstruction
  • Set a threshold between data and background or use an Otsu filter
  • Plots the maximum pixel intensity along each direction, finds pixels above the threshold, identifies large connected components and calculates limits around them
  • Can apply a buffer around the automatically calculated limits
  • If manual_limits are set these over-ride the automatically calculated limits

vs = VolumeShrinker() ig_reduced = vs.run(data, auto=True)

image

ig_reduced = vs.run(data, auto=True, buffer=10) image

Use manual limits in specified direction image

Don't reduce in specified directions vs = VolumeShrinker() ig_reduced = vs.run(data, auto=True, buffer=10, manual_limits={'horizontal_x':None, 'horizontal_y':None}) image

If logging is enabled, plot a histogram with the threshold and reduced box image

Testing you performed

Please add any demo scripts to https://github.com/TomographicImaging/CIL-Demos/tree/main/misc

Related issues/links

May close #1998

Checklist

  • [ ] I have performed a self-review of my code
  • [ ] I have added docstrings in line with the guidance in the developer guide
  • [ ] I have updated the relevant documentation
  • [ ] I have implemented unit tests that cover any new or modified functionality
  • [ ] CHANGELOG.md has been updated with any functionality change
  • [ ] Request review from all relevant developers

hrobarts avatar Oct 10 '25 15:10 hrobarts