Skip to content

feat: add array_equal#56

Merged
william-silversmith merged 8 commits intomainfrom
wms_array_equal
Nov 3, 2025
Merged

feat: add array_equal#56
william-silversmith merged 8 commits intomainfrom
wms_array_equal

Conversation

@william-silversmith
Copy link
Copy Markdown
Contributor

@william-silversmith william-silversmith commented Nov 3, 2025

An important missing feature has been the ability to efficiently check if two crackle arrays are identical even if they were encoded differently. Previously, this required decompressing the arrays entirely.

This function checks the following:

  1. are the sizes in x,y,z the same?
  2. are the number of labels the same?
  3. do the unique labels match?
  4. is the buffer pointer the same?
  5. multithreaded decompress per slice and check for mismatch. the check will exit as soon as a mismatch is found.
is_equal = crackle.array_equal(binary1, binary2)
arr == arr2 # for CrackleArrays

@william-silversmith william-silversmith self-assigned this Nov 3, 2025
@william-silversmith william-silversmith added the enhancement New feature or request label Nov 3, 2025
For entire dataset files, this will make things much faster.
This checks if two arrays have the same underlying connected
components domains regardless of how they are labeled.

The check for format version 1 is very efficient. Format 0 requires
computing the voxel connectivity graph.
@william-silversmith william-silversmith merged commit 140953c into main Nov 3, 2025
15 checks passed
@william-silversmith william-silversmith deleted the wms_array_equal branch November 3, 2025 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant