Skip to content

SmartSPIM: read Z<z>_Ch<k>.tif slices and a single channel folder without _Ch<n> - #150

Merged
stevevanhooser merged 1 commit into
mainfrom
claude/smartspim-short-slice-names
Nov 10, 2026
Merged

stevevanhooser merged 1 commit into
mainfrom
claude/smartspim-short-slice-names

Conversation

@stevevanhooser

Copy link
Copy Markdown
Contributor

Some SmartSPIM software versions write a single-channel acquisition in a layout NDR did not recognize, so the Lightsheet Manager refused it as "not a SmartSPIM acquisition". Two lab acquisitions look like this (Nielsen_PSS_Retrobeads/Full_Adult_Hemi_processed, Site_processed):

  • the channel folder is Ex_561_Em_561F, with no _Ch<n> (beside it are Ex_561_Em_561F_MIP, _MIP_stitched, _stitched, _MIDDLE);
  • the stitched slices in All_Channels are Z000000_Ch0.tif, Z000010_Ch0.tif, ….

Changes

  • readAllChannelsInfo accepts slice names Z<z*10>_Ch<k>.tif(f), alongside <y>_<x>_<z*10>_ch<k> and <z*10>_ch<k>. Matching ignores case.
  • listChannels and isSmartSPIM accept a channel folder named Ex_<laser>_Em_<filter>. Its filter name must have no underscores, so working folders such as _MIP, _stitched and _MIDDLE still aren't taken for channels. For that folder, filterChannel is NaN and numTiles is counted from metadata.json's tiles with its laser and filter.
  • A lone unnumbered channel is matched to whichever single _ch<k> its slices carry.
  • Several channel folders where any lacks _Ch<n> are refused with ndr:format:smartspim:listChannels:UnnumberedChannels. Nothing would then say which _ch<k> slices belong to which channel, and a guess could swap two channels without anyone noticing. A multi-channel acquisition in this layout will need to be looked at before it's supported.

Tests

In TestSmartSPIMAllChannels:

  • testSingleChannelWithoutChNumber rewrites the fixture into this layout (one channel folder without _Ch<n>, working folders beside it, Z…_Ch0.tif slices) and reads it, values and z order included.
  • testSeveralChannelsWithoutChNumberAreRefused covers two unnumbered folders, and one numbered plus one unnumbered.

Per AGENTS.md these MATLAB tests weren't run here. The same change and tests are in NDR-python (VH-Lab/NDR-python, same branch name) and pass there.


Generated by Claude Code

…hout _Ch<n>

Some SmartSPIM software versions write a single-channel acquisition with:
- a channel folder named Ex_<laser>_Em_<filter>, without _Ch<n>;
- stitched All_Channels slices named Z<z*10>_Ch<k>.tif.
Neither was recognized, so the folder was "not a SmartSPIM acquisition".

- readAllChannelsInfo accepts Z<z*10>_Ch<k>.tif(f) slice names.
- listChannels / isSmartSPIM accept a channel folder without _Ch<n>
  (filterChannel NaN; numTiles counted by laser and filter). Working
  folders such as _MIP, _stitched and _MIDDLE are still not channels.
- A lone unnumbered channel takes whichever single _ch<k> its slices
  carry.
- Several channel folders when any lacks _Ch<n> are refused
  (ndr:format:smartspim:listChannels:UnnumberedChannels) rather than
  guessed at: nothing would say which _ch<k> slices are whose.

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

Copy link
Copy Markdown
Contributor

Test Results

399 tests  +2   396 ✅ +2   39s ⏱️ +5s
 41 suites ±0     3 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 147073c. ± Comparison against base commit ea26242.

@codecov

codecov Bot commented Nov 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.10526% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.09%. Comparing base (ea26242) to head (147073c).

Files with missing lines Patch % Lines
+ndr/+format/+smartspim/listChannels.m 90.32% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #150      +/-   ##
==========================================
+ Coverage   54.96%   55.09%   +0.12%     
==========================================
  Files         164      164              
  Lines        9617     9647      +30     
==========================================
+ Hits         5286     5315      +29     
- Misses       4331     4332       +1     
Flag Coverage Δ
symmetry 18.95% <0.00%> (-0.06%) ⬇️
unittests 52.37% <92.10%> (+0.13%) ⬆️

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 6c20e3c into main Nov 10, 2026
8 checks passed
@stevevanhooser
stevevanhooser deleted the claude/smartspim-short-slice-names branch November 10, 2026 18:56
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