add large image support to cucim.skimage.measure.label (support 64-bit indexing)#1087
Open
grlee77 wants to merge 1 commit into
Open
add large image support to cucim.skimage.measure.label (support 64-bit indexing)#1087grlee77 wants to merge 1 commit into
cucim.skimage.measure.label (support 64-bit indexing)#1087grlee77 wants to merge 1 commit into
Conversation
64-bit indexing and label array is used instead of 32-bit when necessary
jakirkham
reviewed
May 27, 2026
Member
jakirkham
left a comment
There was a problem hiding this comment.
Thanks Greg! 🙏
Generally looks reasonable
Had a couple minor questions on cleanups
|
|
||
| import cupy as cp | ||
|
|
||
| # import numpy as np |
Member
There was a problem hiding this comment.
Guessing we just never needed NumPy here
Comment on lines
18
to
20
| # import pytest | ||
|
|
||
| # import cucim.skimage.measure._ccomp as ccomp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #1076
CuPy recently updated
cupyx.scipy.ndimage.labelto support 64-bit indexing when necessary to support large image sizes. See a more detailed description for the changes made in the upstream PR:cupy/cupy#9859
This MR makes the exact same change to the very similar kernels underlying
cucim.skimage.measure.label. The reason we don't use CuPy kernels directly for cuCIM'slabelis that the CuPy API is for binary image labeling only (i.e. all foreground pixels are treated the same regardless of intensity). The version oflabelin the scikit-image API also supports a grayscale mode where neighboring pixels are only connected if the grayscale intensity is actually equal. Thus we have modified kernels that support that logic. The indexing concern and solution is the same as in the upstream PR, though.