Skip to content

Migrate BrukerTiffImagingInterface to the unified extractor and dict-based metadata#1773

Open
h-mayorquin wants to merge 10 commits into
mainfrom
new_bruker_interface
Open

Migrate BrukerTiffImagingInterface to the unified extractor and dict-based metadata#1773
h-mayorquin wants to merge 10 commits into
mainfrom
new_bruker_interface

Conversation

@h-mayorquin

Copy link
Copy Markdown
Collaborator

This PR adds BrukerTiffImagingInterface, a new interface built on the unified BrukerTiffImagingExtractor from roiextractors (roiextractors#567). A single class now covers what was previously split across BrukerTiffSinglePlaneImagingInterface and BrukerTiffMultiPlaneImagingInterface: single-plane data writes a 2D TwoPhotonSeries and volumetric data writes a single 4D TwoPhotonSeries automatically. For multi-channel and multi-plane folders, a new BrukerTiffConverter (a thin ConverterPipe) auto-enumerates channels from the folder's Bruker .xml and, via plane_separation_type, optionally one interface per depth plane, replacing both BrukerTiffSinglePlaneConverter and BrukerTiffMultiPlaneConverter.

The new interface emits only the new dict-based metadata format (#1653): Devices, Ophys.ImagingPlanes, Ophys.MicroscopySeries. Together with the PR for the Miniscope migration (#1731), this is the last optical-physiology interface to move onto it. That is, the migration for optical physiology will be finished after this.

BrukerTiffSinglePlaneImagingInterface, BrukerTiffMultiPlaneImagingInterface, BrukerTiffSinglePlaneConverter, and BrukerTiffMultiPlaneConverter are all deprecated for removal in or after December 2026. The last one previously had no replacement because disjoint volumetric output (one TwoPhotonSeries and ImagingPlane per z-plane, required by NWB when excitation_lambda/indicator/location differ across depths and depended on by per-plane segmentation pipelines like pinto-lab-to-nwb) could not be produced by the unified interface. It now can: a plane_index selector built on roiextractors' select_plane writes each plane as its own 2D series, with the plane's focal depth read from the active zDevice in the Bruker XML rather than the aggregate z-swing. A test asserts the per-plane data and origin_coords depth match the deprecated converter's output. The same correction fixes the contiguous case, whose origin_coords z had been the z-swing (a spacing) instead of a plane position; the swing now goes to grid_spacing/field_of_view where it belongs. To avoid waiting on a roiextractors release for per-plane metadata, the interface keeps a reference to the full extractor for the XML reads (marked to collapse once roiextractors#578 lands a public per-plane metadata API).

@h-mayorquin
h-mayorquin marked this pull request as ready for review July 3, 2026 20:04
@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.03483% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.77%. Comparing base (d1e1766) to head (6c38021).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...rfaces/ophys/brukertiff/brukertiffdatainterface.py 93.52% 9 Missing ⚠️
...interfaces/ophys/brukertiff/brukertiffconverter.py 93.75% 3 Missing ⚠️
...c/neuroconv/tools/testing/data_interface_mixins.py 83.33% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1773      +/-   ##
==========================================
+ Coverage   82.61%   82.77%   +0.15%     
==========================================
  Files         177      177              
  Lines       14261    14455     +194     
==========================================
+ Hits        11782    11965     +183     
- Misses       2479     2490      +11     
Flag Coverage Δ
unittests 82.77% <93.03%> (+0.15%) ⬆️

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

Files with missing lines Coverage Δ
src/neuroconv/converters/__init__.py 100.00% <ø> (ø)
src/neuroconv/datainterfaces/__init__.py 100.00% <ø> (ø)
src/neuroconv/utils/dict.py 90.90% <100.00%> (+0.21%) ⬆️
...c/neuroconv/tools/testing/data_interface_mixins.py 93.34% <83.33%> (-0.07%) ⬇️
...interfaces/ophys/brukertiff/brukertiffconverter.py 93.45% <93.75%> (-0.99%) ⬇️
...rfaces/ophys/brukertiff/brukertiffdatainterface.py 90.59% <93.52%> (+1.88%) ⬆️

... and 1 file with indirect coverage changes

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant