Repository navigation
smartspim: prefer SmartSPIM's stitched All_Channels volume - #31
Merged
Merged
Conversation
Port of NDR-matlab b8f0e4b. ferret-lightsheet established that
All_Channels/ holds SmartSPIM AutoStitch's TeraStitcher merge of the
destriped tiles with flat-field / left-right correction and blended
overlaps -- the better-stitched, harmonized data Imaris is built from.
Format layer (new, bridged regular_port):
* readAllChannelsInfo - index <Y>_<X>_<z*10>_ch<k>.tiff, map channels
to ch<k> via <channel>_MIP_stitched, else filter-channel rank;
numeric z order; canvas size / class; voxel size from metadata.json.
* hasAllChannels - non-throwing probe, usable only if every channel
has slices.
* readAllChannelsVolume - one channel as (z, y, x), optional ZRange.
Reader epochs:
[root] stitched volume, all channels on C (ch<k> order)
[root, channel] stitched volume, one channel
[root, channel, tile] destriped Ex_* tile, unchanged
Without a usable All_Channels, the first two keep the "does not pin a
channel / tile" errors (the Ex_* tiles are not obsolete).
imagecodecs joins the dev and formats extras: real All_Channels slices
are LZW, and the new tests write LZW fixtures.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U33UPxYJWPpcQimNu5t5Cb
NDR-matlab fixed readTileInfo reporting int16 for TIFFs that store SampleFormat = 1 (imfinfo's 'Unsigned integer' contains 'signed integer'). The Python port takes the numpy dtype straight from tifffile and never had the bug -- checked against a hand-built TIFF carrying SampleFormat = 1 -- so only the sync hash and decision_log change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U33UPxYJWPpcQimNu5t5Cb
NDR-matlab fixed tiffclass reading float TIFFs ('IEEE floating point')
as uint32. The Python port takes the dtype from tifffile and was never
affected -- float32 and int16 stacks round-trip -- so only the sync hash
and decision_log change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U33UPxYJWPpcQimNu5t5Cb
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.
Summary
This ports VH-Lab/NDR-matlab#142 (branch
claude/spim-all-channels). ferret-lightsheet established thatAll_Channels/contains SmartSPIM AutoStitch's stitched, flat-field-corrected and blended volume, which is what Imaris is built from. With this PR,ndr_reader_smartspimreads it first.New format functions (
ndr.format.smartspim, bridged asregular_port)readAllChannelsInfo: indexes<Y>_<X>_<z*10>_ch<k>.tiffand maps each channel to itsch<k>, taken from<channel>_MIP_stitchedor else from the filter-channel rank. Slices are sorted by numeric z. Also returns the canvas size and class, and the voxel size frommetadata.json.hasAllChannels: a non-throwing probe. It returns true only when every channel has slices.readAllChannelsVolume: reads one channel as (z, y, x), with an optionalZRange.Reader epochs
[root]ch<k>order)[root, channel][root, channel, tile]Ex_*tile (unchanged)Fallback: when
All_Channelsis missing or incomplete,[root]and[root, channel]raise the same "does not pin a channel / tile" errors as before. TheEx_*tiles remain the source of truth.Bridge syncs (MATLAB commits recorded)
smartspimreader + 3 new format functionsb8f0e4breadTileInfo3e300e5tiffstack8f870c1Other changes
imagecodecsis added to thedevandformatsextras. RealAll_Channelsslices are LZW-compressed, and tifffile needsimagecodecsto decode them; the new tests also write LZW fixtures.Testing
tests/test_smartspim_all_channels.py(new) andtests/test_smartspim_reader.py: 45 passed.black --checkandruff checkare clean.0013532: all checks green.Merge order: merge NDR-matlab#142 first, as a merge commit rather than a squash. The bridge YAML records that PR's commit hashes, and a squash would change them.
🤖 Generated with Claude Code
https://claude.ai/code/session_01U33UPxYJWPpcQimNu5t5Cb