Skip to content

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

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

Two changes to ndr.format.smartspim.readAllChannelsInfo. They are found by hasAllChannels, and through it by NDI's Lightsheet Manager.

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. Acquisitions like that were rejected with No "*_ch.tif(f)" slices found.

  • The slice pattern now treats the <Y>_<X>_ origins as optional: ^(?:\d+_\d+_)?(\d+)_ch(\d+)\.tiff?$.
  • z is the number just before _ch<k>. It is used only to order the slices; nothing read the origins.
  • In such acquisitions the <channel>_MIP_stitched files carry no _ch<k> suffix either (000000.tiff). Channels therefore map by filter-channel rank, as before (Ch2 → ch0, Ch3 → ch1). This was checked on a real acquisition: All_Channels ch0 correlates 0.48 with the 561 MIP and 0.03 with the 640 MIP.

Refusing an untrustworthy listing

On a macOS SMB share with directory caching on, the listing of a large All_Channels folder returned each name ten times (same size and date) and left other files out. The total came to exactly 10000. A volume built from that listing would repeat some planes and lack others, with no error. readAllChannelsInfo now raises:

  • …:DuplicateListing when the listing names a file more than once. The message says how to turn caching off: dir_cache_off=yes in /etc/nsmb.conf, then remount.
  • …:DuplicateSlice when two different files have the same channel and z (tiles rather than stitched slices).

hasAllChannels returns false in both cases.

Tests

TestSmartSPIMAllChannels gains:

  • testSlicesNamedWithoutOrigins: renames the fixture's slices and checks the channels, slice counts, order and pixel values.
  • testTwoFilesForOneSliceAreRefused.

Authored without a MATLAB runtime, so CI is these tests' first run. The same change is in VH-Lab/NDR-python on the branch of the same name.


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
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

397 tests  +2   394 ✅ +2   28s ⏱️ -8s
 41 suites ±0     3 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 3d59e4a. ± Comparison against base commit 14a894f.

♻️ This comment has been updated with latest results.

readAllChannelsVolume returns (z, y, x); testSlicesNamedWithoutOrigins
indexed it as if z were last.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E59gJ2kMfx16TfRmzo2SnL
@codecov

codecov Bot commented Nov 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 71.42857% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.96%. Comparing base (14a894f) to head (3d59e4a).

Files with missing lines Patch % Lines
+ndr/+format/+smartspim/readAllChannelsInfo.m 71.42% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #149   +/-   ##
=======================================
  Coverage   54.95%   54.96%           
=======================================
  Files         164      164           
  Lines        9606     9617   +11     
=======================================
+ Hits         5279     5286    +7     
- Misses       4327     4331    +4     
Flag Coverage Δ
symmetry 19.01% <0.00%> (-0.03%) ⬇️
unittests 52.24% <71.42%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@stevevanhooser
stevevanhooser merged commit ea26242 into main Nov 6, 2026
8 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