Skip to content

Use clean fiber photometry terms; add photometry table and device types - #1

Merged
rly merged 1 commit into
rly:add_ndtypesfrom
bendichter:add-ndtypes-fixes
Sep 2, 2026
Merged

Use clean fiber photometry terms; add photometry table and device types#1
rly merged 1 commit into
rly:add_ndtypesfrom
bendichter:add-ndtypes-fixes

Conversation

@bendichter

@bendichter bendichter commented Aug 27, 2026

Copy link
Copy Markdown

This implements the changes I proposed in dandi#1665, targeting your add_ndtypes branch so they land there rather than as a competing PR.

The photometry types now use "fiber photometry approach" and "fiber photometry technique" as plain single terms. The semicolon-joined strings would each have become a single unfacetable MeasurementTechniqueType name, and "calcium imaging" is inaccurate for the many photometry dandisets that use dLight or GRAB sensors to measure neurotransmitters rather than calcium (000251, 000351, and 001434 are examples). With single terms per type, the existing str | None fields are sufficient, so the map's structure is unchanged. If we later want a type to emit multiple terms, BareAsset.measurementTechnique and .approach are already lists in dandischema, so that would be a CLI-only change.

I also added the metadata table types from the deprecated ndx-photometry (FibersTable, ExcitationSourcesTable, PhotodetectorsTable, FluorophoresTable) and the container, table, and device types from ndx-fiber-photometry (FiberPhotometry, FiberPhotometryTable, OpticalFiber, ExcitationSource, Photodetector, Indicator), so files carrying only those still get marked. For reference, the smaller sessions in 001632 contain no photometry types at all, only the events tables, so they will remain unmarked regardless.

I dropped dandi/metadata/neurodata_typemap.py for now since nothing imports it and it would drift from the map in util.py. I think the expanded map is valuable and worth reintroducing once it is wired in as the single source of truth, ideally together with the organize.py change that would make the module field drive filename suffixes.

Tests updated accordingly, including a new case checking that the ndx-photometry tables alone produce the photometry approach. test_metadata.py passes locally.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Wuywpnnb3Q57q6oeMZ4God

Use "fiber photometry approach" and "fiber photometry technique" for the
photometry types.  Semicolon-joined strings like "fiber photometry
technique; optical technique" would become a single unfacetable term, and
"calcium imaging" is inaccurate for the many photometry datasets using
dLight or GRAB sensors to measure neurotransmitters rather than calcium.

Add the metadata table types from the deprecated ndx-photometry and the
container, table, and device types from ndx-fiber-photometry so files
carrying only those are still marked.

Drop the unused dandi/metadata/neurodata_typemap.py for now; the expanded
map can be reintroduced when it is wired into the code.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wuywpnnb3Q57q6oeMZ4God
@bendichter bendichter changed the title List-valued techniques/approaches and clean fiber photometry terms Use clean fiber photometry terms; add photometry table and device types Aug 27, 2026
@bendichter

Copy link
Copy Markdown
Author

@rly

@rly

rly commented Sep 2, 2026

Copy link
Copy Markdown
Owner

OpticalFiber, ExcitationSource, Photodetector, Indicator are not unique to the photometry extensions. They are all defined in ndx-ophys-devices and imported by ndx-microscopy or ndx-optogenetics, as well as ndx-fiber-photometry.

dandi-cli does not disambiguate based on namespace, but it should. That's a larger change, though, outside the scope of these PRs.

Since matching is done by exact string match and subtypes do not inherit, we can also add DeconvolvedFiberPhotometryResponseSeries and MultiCommandedVoltage from ndx-photometry and FiberPhotometryIndicators, FiberPhotometryViruses, FiberPhotometryVirusInjections from ndx-fiber-photometry, and CommandedVoltageSeries from both.

Re: the semicolon issue, this is a pre-existing pattern. For example, TwoPhotonSeries maps to "microscopy approach; cell population imaging" on master and published dandisets carry the compound string with the semicolon, e.g., https://dandiarchive.org/dandiset/000049. It would be best to change this to a list of strings, perhaps, in a separate PR.

I agree that "calcium imaging" is inappropriate for many photometry data. Whether calcium was imaged can be detected using Indicator.label / FluorophoresTable.label inside the file, but there's no straightforward way to do that within the current framework. I checked ten photometry dandisets and none contain a RoiResponseSeries, so nothing else will supply an imaging-family term for them. Once entries are lists, I would like photometry to emit both "fiber photometry approach" and "cell population imaging". For now, no imaging term is better than an inaccurate one.

OK to delete dandi/metadata/neurodata_typemap.py. I agree - we can discuss introducing that in a separate PR rather than have it hold up addition of photometry and other extension types to the map.

Since I know you're out of office, I'll make the above changes to your PR and merge it so that we keep the momentum going.

@rly

rly commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Thanks for bringing this back and suggesting dropping the neurodata_typemap for now!

@rly

rly commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Looks like I can't modify this PR directly even though maintainerCanModify: true because GitHub computes that permission against the root of the fork network, dandi/dandi-cli, where I have push: false. So I'll merge this into my branch and make commits on top of it.

@rly
rly merged commit a6b868f into rly:add_ndtypes Sep 2, 2026
4 of 5 checks passed
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