Skip to content

Conversation

@rob-luke
Copy link
Member

What does this implement/fix?

PR #9401 introduced the argument optode_frame to read_raw_snirf. This was being used to transform the coordinates of sensors, but was not being stored in info['chs']. Also added a test.

@rob-luke rob-luke changed the title FIX: Honor optode_frame argument in read_raw_snirf WIP: Honor optode_frame argument in read_raw_snirf Jun 11, 2021
@rob-luke rob-luke changed the title WIP: Honor optode_frame argument in read_raw_snirf MRG: Honor optode_frame argument in read_raw_snirf Jun 11, 2021
@rob-luke
Copy link
Member Author

@larsoner @agramfort could you please review.

assert read_raw_snirf(nirx_nirsport2_103, optode_frame="unknown").\
info['chs'][10]['coord_frame'] == 0
assert read_raw_snirf(nirx_nirsport2_103, optode_frame="head").\
info['chs'][10]['coord_frame'] == 4
Copy link
Member

Choose a reason for hiding this comment

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

can you replace the 4 by FIFF.FIFFV_COORD_HEAD ?

assert read_raw_snirf(nirx_nirsport2_103, optode_frame="asdf").\
info['chs'][10]['coord_frame'] == 0
assert read_raw_snirf(nirx_nirsport2_103, optode_frame="mri").\
info['chs'][10]['coord_frame'] == 4
Copy link
Member

Choose a reason for hiding this comment

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

why is it not

FIFF.FIFFV_COORD_MRI

? if there is a good reason can you put FIFFV_COORD_HEAD and explain why?

Copy link
Member

Choose a reason for hiding this comment

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

why is it not FIFF.FIFFV_COORD_MRI

Because we currently convert everything to head coordinates.

As of a year ago there wasn't even a way to store the coordinate frame of individual channels. Now there is (via the extended channel info blocks). In some/many places in MNE, we also still assume that non-MEG channels are in the HEAD coordinate frame. This is gradually being changed but we're not there yet.

@rob-luke
Copy link
Member Author

rob-luke commented Jun 14, 2021

Thanks for the review @agramfort. I have changed to testing against FIFF. Is @larsoner's description above sufficient? Or do you think we should change to returning something other than head? I am happy to implement whatever is appropriate.

Edit: I think the failing CI is due to a timeout, not this PR.

Copy link
Member

@agramfort agramfort left a comment

Choose a reason for hiding this comment

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

+1 for MRG provided CIs are green.

thx @rob-luke

@rob-luke
Copy link
Member Author

Unfortunately the CI is failing as its hitting a 60 min timeout, so I will not merge myself. @larsoner could you merge if this is acceptable.

@larsoner larsoner merged commit 8432c29 into mne-tools:main Jun 14, 2021
@larsoner
Copy link
Member

Thanks @rob-luke !

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.

3 participants