Automatically shrink reconstruction volume #2221
Conversation
|
For discussion: Could this be a method on image_data
Could this be a method on acquisition_geometry
Could this be a method on acqusition_data
|
|
What should the name be
|
lauramurgatroyd
left a comment
There was a problem hiding this comment.
Hi @hrobarts
The shrinker tool is looking very useful!
I had some questions about the structure, plus some docstring and unit test suggestions, and maybe some more checking of valid parameters. Also wasn't sure about the mask parameter in the 'manual' case
|
You will need to add the volume shrinker to this file in the documentation: |
Co-authored-by: Laura Murgatroyd <60604372+lauramurgatroyd@users.noreply.github.com> Signed-off-by: Hannah Robarts <77114597+hrobarts@users.noreply.github.com>
hrobarts
left a comment
There was a problem hiding this comment.
Hi @lauramurgatroyd thank you for your review! I think I've addressed all the comments now.
Neonbluestoplight
left a comment
There was a problem hiding this comment.
Hi @hrobarts,
There's one change but the first comment about AcquisitionType is just for my own understanding and doesn't have to be changed.
Thank you for your review @Neonbluestoplight, I think I have addressed your comments! |
|
Hi @hrobarts
|
Good point it was not the most up to date version, I've copied the current file but we can import it once it's merged. I think the problem is actually in how the bounds are calculated because we use a binned reconstruction the boundary which is found can never be more precise than the binning. At the moment the binning level is calculated internally based on the panel size but we could make this an argument the user can choose. Another way to get round this is by adding a buffer around the found boundaries. Here is the new output from the demo using a buffer. Perhaps by default the buffer=binning to avoid these edge issues.
|
We discussed this and decided to always add the binning level to the bounds, this is separate from the buffer |
Signed-off-by: Hannah Robarts <77114597+hrobarts@users.noreply.github.com>



Changes
Code to create a reduced reconstruction volume from an AcquisitionData object
If using
method='manual'limitsargument. If a dimension is not included in the limits dictionary, the full size of the axis is usedIf using
method='otsuorthresholdIf
preview=Truekwargs
bufferapplies a buffer around the automatically calculated limitsmask_radiusapplies a mask to the reconstruction before finding limitsotsu_classeschanges number of material classes to assume in the Otsu thresholdingmin_component_sizespecified a minimum number of connected components in pixels to consider when choosing the limits - to avoid a small amount of noise changing the limitsIf debug logging is enabled, we plot a histogram with the threshold and reduced box

Testing you performed
Demo TomographicImaging/CIL-Demos#283
I think it makes sense for this code to be in utilities and possibly be called by
AcquisitionData.get_ImageGeometry()however when I did this I had trouble with circular imports. Maybe it should be moved to utilities under framework?Related issues/links
May close #1998
Checklist