Skip to content

Conversation

@MyTreeSings
Copy link

@MyTreeSings MyTreeSings commented Dec 8, 2025

…volume)

Description

This PR introduces an interactive volume cropping tool for use in Jupyter notebooks, in order to simplify and standardise the workflow around manual volume reduction prior to reconstruction or further processing.

The addition consists of a new widget class InteractiveVolumeShrinker allowing users to interactively select crop limits using sliders and visual overlays

Has an ability to save cropped geometry (cropped_ig), manual crop limits (crop_limits) and preview reconstruction (last_recon)

This functionality is designed for exploratory workflows in Jupyter, allowing a user to visually guide a crop without manually computing voxel bounds.

The implementation is non-invasive: it does not modify core processor behaviour, but provides a notebook-oriented interface on top of existing utilities.
No changes to existing APIs are required.

Example Usage

from cil.utilities.jupyter.interactiveVolumeShrinker import InteractiveVolumeShrinker

ivs = InteractiveVolumeShrinker(
absorption_data3D=absorption_data3D,
preview=preview_image,
roi_xy=roi_xy
)

ivs.show()

cropped_ig = ivs.cropped_ig
crop_limits = ivs.crop_limits
last_recon = ivs.last_recon

recon = FBP(cropped_ig, absorption_data3D.geometry)(absorption_data3D)

Contribution Notes

  • The content of this Pull Request (the Contribution) is intentionally submitted for inclusion in CIL (the Work) under the terms and conditions of the Apache-2.0 License
  • I confirm that the contribution does not violate any intellectual property rights of third parties

❤️ Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant