Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set max_channel property of MdaSortingExtractor #3701

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

rly
Copy link

@rly rly commented Feb 17, 2025

Fix #3695

@alejoe91 alejoe91 added the extractors Related to extractors module label Feb 17, 2025
Co-authored-by: Alessio Buccino <alejoe9187@gmail.com>
rly and others added 2 commits February 18, 2025 12:08
Co-authored-by: Alessio Buccino <alejoe9187@gmail.com>
Co-authored-by: Alessio Buccino <alejoe9187@gmail.com>
@rly
Copy link
Author

rly commented Feb 18, 2025

I think the comment about max_channel values being 1-indexed and being based on the input data to the sorter is useful to document somewhere. Perhaps in the docstring of MdaSortingExtractor?

@rly
Copy link
Author

rly commented Feb 18, 2025

I haven't run tests locally. I was hoping to see if the workflows pass.

If sorting was run on a subset of channels of the recording, then the max_channel values are
based on that subset, so care must be taken when associating these values with a recording.
If additional sorting segments are added to this sorting extractor after initialization,
then max_channel will not be updated. The max_channel indices begin at 1.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we then set the property with a -1?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably. Though if you are familiar with the MDA format, you might know and expect that the channel indices begin at 1. I leave that for you to decide

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No strong preference here! Just thinking that if downstream or during NWB export we assume these are channel indices we would assume they start from 0.

@magland any thought here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Letàs leave 1-based, since this is a reader :)

@rly rly marked this pull request as ready for review February 19, 2025 06:48
@rly
Copy link
Author

rly commented Feb 21, 2025

Is there a way to add a description to the max_channel property so that when it is converted to NWB, the description of the Units.max_channel property is set to that description? It would be nice to document what "max_channel" is in the file itself.

@alejoe91
Copy link
Member

@rly no unfortunately we don't have property descriptions. I think that this could be done with a custom snippet on the NeuroConv side

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extractors Related to extractors module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Storing channel index from MDA sorting in MdaSortingExtractor for downstream use
2 participants