Skip to content

ExtractChannel and FlatFieldDatasource 5D / multichannel datasource fixes#1654

Open
barentine wants to merge 4 commits intopython-microscopy:masterfrom
barentine:20260318
Open

ExtractChannel and FlatFieldDatasource 5D / multichannel datasource fixes#1654
barentine wants to merge 4 commits intopython-microscopy:masterfrom
barentine:20260318

Conversation

@barentine
Copy link
Copy Markdown
Member

Addresses issues:

  • ExtractChannel._pickChannel uses legacy image.data access and collapses the wrong index if you pass it a XYZTC shape [1024, 1024, 1, 1, 4] datasource and try to pick out one of the 4 channels
  • FlatFieldDataSource doesn't preserve parent datasource t/z info in its current state, and can also mess up channel extraction.

Is this a bugfix or an enhancement?
bugfix
Proposed changes:

  • use image.data_xyztc access in ExtractChannel module
  • add units tests for ExtractChannel
  • store parent datasource t/z info in FlatFieldDataSource

FlatfieldDataSource currently inherits from XYTCDataSource, i.e. the old-style datasource base. Certainly it would be better to do a full re-jig, but this was the fastest fix for me.

Checklist:
The below is a list of things what will be considered when reviewing PRs. It is not prescriptive, and does not
imply that PRs which touch any of these will be rejected but gives a rough indication of where there is a potential
for hangups (i.e. factors which could turn a 5 min review into a half hour or longer and shunt it to the bottom
of the TODO list).

  • Does the PR avoid variable renaming in existing code, whitespace changes, and other forms of tidying? [There is a place for code tidying, but it makes reviewing
    much simpler if this is kept separate from functional changes. The auto-formatting performed by some editors is particulaly egregious and can lead to files with thousands
    of non-functional changes with a few functional changes scattered amoungst them]

If an enhancement (or non-trivial bugfix):

  • Has this been discussed in advance (feature request, PR proposal, email, or direct conversation)?
  • Does this change how users interact with the software? How will these changes be communicated?
  • Does this maintain backwards compatibility with old data?
  • Does this change the required dependencies?
  • Are there any other side effects of the change?

@barentine barentine marked this pull request as ready for review March 19, 2026 17:16
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.

1 participant