Skip to content

Conversation

@grlee77
Copy link
Contributor

@grlee77 grlee77 commented Nov 7, 2025

resolves #964

This reconstruction function is a hybrid implementation that still relies on an inner Cython reconstruction_loop function from upstream scikit-image. I found that upgrading the input as done here avoids the observed crash and gives output that matches the scikit-image one.

@grlee77 grlee77 added this to the v25.12.00 milestone Nov 7, 2025
@grlee77 grlee77 requested a review from a team as a code owner November 7, 2025 21:42
@grlee77 grlee77 added bug Something isn't working non-breaking Introduces a non-breaking change labels Nov 7, 2025
@grlee77 grlee77 added this to cucim Nov 7, 2025
@copy-pr-bot
Copy link

copy-pr-bot bot commented Nov 7, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@grlee77 grlee77 force-pushed the grelee/fix-morphology-reconstruction-bug branch from ca39a5a to c14eb25 Compare November 8, 2025 17:26
@grlee77 grlee77 force-pushed the grelee/fix-morphology-reconstruction-bug branch from c14eb25 to dbe8839 Compare November 8, 2025 17:31
@gigony gigony changed the base branch from main to release/25.12 November 18, 2025 19:06
Copy link
Member

@jakirkham jakirkham left a comment

Choose a reason for hiding this comment

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

Thanks Greg! 🙏

Generally this looks reasonable

Had a couple questions below

# Rescale image intensity so that we can see dim features.
image = rescale_intensity(image, in_range=(50, 200))

seed = cp.copy(image)
Copy link
Member

Choose a reason for hiding this comment

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

seed could be confused with random number generator seed. Should we use a different name like image2 or similar?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, updated as suggested

mask = image

seed = seed.astype(unsigned_dtype)
filled = reconstruction(seed, mask, method="erosion")
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this could be image2_eroded?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

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

Labels

bug Something isn't working non-breaking Introduces a non-breaking change

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[BUG] crash in cucim.skimage.morphology.reconstruction for unsigned integer input

2 participants