tiffstack: ignore non-image sidecar files when TIFFs are listed directly#108
Merged
Conversation
ndr.reader.tiffstack.imagefiles treated ANY non-TIFF, non-folder epoch file as a directory anchor and globbed its parent directory. NDI's file navigator hands the reader the epoch's image files PLUS companion files (e.g. 'epochprobemap.ndi'); the companion was treated as an anchor, so in a flat directory holding several epochs every epoch globbed in every other epoch's TIFFs -- and the frame-times sidecar lookup switched to the directory-level 'frametimes.txt', mis-reporting movie epochs as clockless. Prefer directly-listed TIFFs (and directory expansions): resolve anchor files to their parent directory's TIFFs ONLY when no TIFFs are supplied directly (the marker-file-only case). This mirrors how the mfdaq NDR readers tolerate extra non-data files in an epoch's file list. https://claude.ai/code/session_01M7f7wSBJeN4QJFvuCwdsSu
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #108 +/- ##
==========================================
+ Coverage 37.87% 37.92% +0.04%
==========================================
Files 102 102
Lines 5367 5371 +4
==========================================
+ Hits 2033 2037 +4
Misses 3334 3334 ☔ 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.
Summary
Bug fix for
ndr.reader.tiffstack.imagefiles, found by the NDI-matlab image-DAQ end-to-end test (VH-Lab/NDI-matlab#824).imagefilestreated any non-TIFF, non-folder epoch file as a directory anchor and globbed its parent directory. But NDI's file navigator hands the reader an epoch's image files plus companion files (e.g.epochprobemap.ndi). The companion was treated as an anchor, so in a flat directory holding several epochs:frametimes.txtinstead of<base>_frametimes.txt, so a movie epoch was mis-reported as clockless (no_timeinstead ofdev_local_time).Fix
Prefer directly-listed TIFFs (and directory expansions). Resolve an anchor file to its parent directory's TIFFs only when no TIFFs are supplied directly — i.e. the marker-file-only case (a Prairie
.xml/.pcfconfig in a directory of TIFFs) still works, but companion files alongside the TIFFs are ignored. This mirrors how the mfdaq NDR readers tolerate extra non-data files in an epoch's file list.Existing
TestTiffstackcoverage (single file, directory, file-list, anchor-only) still applies; the anchor-only path is unchanged, and the "TIFFs + companion file" case is the one being corrected.Why this is a separate PR
NDI-matlab#824's CI installs NDR from
main, so this fix needs to land on NDRmainfor that PR to pass its image end-to-end test. No behavior change for the Prairie/marker-file path.https://claude.ai/code/session_01M7f7wSBJeN4QJFvuCwdsSu
Generated by Claude Code