Skip to content

SmartSPIM All_Channels: read <z>_ch<k>.tiff slice names; refuse a listing that repeats files - #38

Merged
stevevanhooser merged 3 commits into
mainfrom
claude/smartspim-short-slice-names
Nov 6, 2026
Merged

stevevanhooser merged 3 commits into
mainfrom
claude/smartspim-short-slice-names

Conversation

@stevevanhooser

Copy link
Copy Markdown
Contributor

This mirrors the NDR-matlab change in ndr.format.smartspim.readAllChannelsInfo (same branch name there).

Slices named without the Y/X origins

Some versions of the SmartSPIM stitching pipeline name the All_Channels slices 000000_ch0.tiff instead of 675050_455000_000000_ch0.tiff. Such acquisitions were rejected with No "*_ch.tif(f)" slices found.

  • _SLICE_RE now treats the <Y>_<X>_ origins as optional: ^(?:\d+_\d+_)?(\d+)_ch(\d+)\.tiff?$.
  • z is the number just before _ch<k>, and is used only to order the slices.
  • The channel mapping is unchanged. These acquisitions' _MIP_stitched files carry no _ch<k> suffix, so channels map by filter-channel rank.

Refusing an untrustworthy listing

On a macOS SMB share with directory caching on, the listing of a large All_Channels folder repeated names (and left others out). _index_slices now raises RuntimeError in two cases:

  • the listing names a file more than once (the message gives the dir_cache_off=yes fix);
  • two files have the same channel and z.

hasAllChannels returns False in both cases.

Tests

tests/test_smartspim_all_channels.py: 29 passed locally, including the two new tests:

  • test_slices_named_without_origins
  • test_two_files_for_one_slice_are_refused

Generated by Claude Code

… origins)

Some versions of the SmartSPIM stitching/Imaris pipeline name the
All_Channels slices 000000_ch0.tiff rather than
675050_455000_000000_ch0.tiff, and such acquisitions were rejected as
having no slices. The slice pattern now takes the origins as optional;
z is the number just before _ch<k>.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E59gJ2kMfx16TfRmzo2SnL
…iles for one slice

A folder cannot hold one name twice, but a macOS SMB share's listing of a
large folder can return the same name several times (and leave others
out); a volume built from it would repeat some planes and lack others.
readAllChannelsInfo now refuses such a listing, saying how to turn off
SMB directory caching, and refuses two files for the same channel and z
(tiles rather than stitched slices).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E59gJ2kMfx16TfRmzo2SnL
Both NDR-matlab commits touching readAllChannelsInfo.m (ffcf678, the
<z>_ch<k>.tiff names; 15d82e1, refusing a repeated listing or two files
for one slice) are ported in this branch; the decision log says how.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E59gJ2kMfx16TfRmzo2SnL
@stevevanhooser
stevevanhooser merged commit d46b69b into main Nov 6, 2026
7 checks passed
@stevevanhooser
stevevanhooser deleted the claude/smartspim-short-slice-names branch November 6, 2026 15:51
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.

2 participants