Repository navigation
SmartSPIM 6.0: map unnumbered channel folders by IMS_Notes.txt or metadata.json - #152
Merged
Merged
Conversation
…adata.json
SmartSPIM 6.0 names channel folders Ex_<laser>_Em_<filter> (no _Ch<n>) and
writes no _ch suffix in _MIP_stitched, so a two-channel acquisition in this
layout was refused (UnnumberedChannels). A channel's All_Channels _Ch<k> is
now taken from, in order:
1. the _ch<k> suffix of its _MIP_stitched files (as before);
2. IMS_Notes.txt, which SmartSPIM writes beside Convert2IMS.bat ("The folder
<channel>_stitched is represented as Ch<k>"), read by the new
readImsNotes;
3. the rank of its filter-channel number (as before). A folder without _Ch<n>
gets that number from metadata.json's tiles with its laser and filter.
Where it is still unknown, it refuses:
- several folders where one has no number from metadata.json and is not in
IMS_Notes.txt (UnnumberedChannels);
- unnumbered folders mapped by rank, when the rank disagrees with the order
the channels first appear in metadata.json (ChannelOrderDisagrees). Which
order the stitcher follows there is not yet known.
A single channel folder without _Ch<n> still takes whichever one _Ch<k> its
slices carry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E59gJ2kMfx16TfRmzo2SnL
Contributor
Test Results403 tests +4 400 ✅ +4 22s ⏱️ -12s Results for commit a77f2d6. ± Comparison against base commit 6c20e3c. This pull request removes 1 and adds 5 tests. Note that renamed tests count towards both. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #152 +/- ##
==========================================
+ Coverage 55.09% 55.34% +0.25%
==========================================
Files 164 165 +1
Lines 9647 9708 +61
==========================================
+ Hits 5315 5373 +58
- Misses 4332 4335 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Follow-up to #150. SmartSPIM software 6.0 names channel folders
Ex_<laser>_Em_<filter>, with no_Ch<n>, and its_MIP_stitchedfiles carry no_chsuffix. #150 refused a multi-channel acquisition in this layout because nothing in the folder names said whichAll_Channels_Ch<k>belongs to which channel. Two of Audrey's acquisitions (…AJ013_16x_561_640g_Destripe_DONE,…AJ010_16x_561_640_Destripe_DONE) are like this.Both acquisitions record the answer in two places:
IMS_Notes.txt, which SmartSPIM writes besideConvert2IMS.bat: "The folder Ex_561_Em_561F_stitched is represented as Ch0 … Ex_640_Em_640F_stitched is represented as Ch1".metadata.json, whose tiles give each laser/filter itsFilterChannel(561F → 2, 640F → 3). Ranking those numbers gives the same mapping. This is the ruleferret-lightsheet/formats/SmartSPIM.mddocuments from AJ007, where_MIP_stitchedshowedch<k>follows filter-channel order and not acquisition order.Changes
A channel's
_Ch<k>now comes from, in order:_ch<k>suffix of its_MIP_stitchedfiles (unchanged);IMS_Notes.txt, read by the newndr.format.smartspim.readImsNotes. A missing or unreadable file gives an empty result and never errors;_Ch<n>gets that number frommetadata.json's tiles for its laser and filter, when they all give one number (listChannels).Still refused, because the mapping would be a guess:
metadata.jsonand isn't named inIMS_Notes.txt(listChannels:UnnumberedChannels);metadata.json(readAllChannelsInfo:ChannelOrderDisagrees). Which order the stitcher follows for this layout is not yet known; the first such acquisition will tell us.Unchanged: a single channel folder without
_Ch<n>still takes whichever one_Ch<k>its slices carry. Numbered folders keep their existing behaviour.Tests (
TestSmartSPIMAllChannels)testSeveralChannelsNumberedByMetadata: two unnumbered folders, and one numbered plus one unnumbered, read with 640 as_ch1.testFilterOrderAndMetadataOrderMustAgree: withmetadata.jsonreordered so 640 comes first, the read is refused; addingIMS_Notes.txtsettles it.testSeveralUnnumberedChannelsWithoutEvidenceAreRefused: with nometadata.json, the read is refused, including whenIMS_Notes.txtnames only one channel.testImsNotesNameEachChannelsSlices:IMS_Notes.txtdecides, even against the rank.testReadImsNotesWithoutAFile.testSingleChannelWithoutChNumbernow expectsfilterChannel2, frommetadata.json.The MATLAB tests weren't run here. The Python port (VH-Lab/NDR-python, same branch name) has the same tests, and they pass.
Generated by Claude Code