-
Notifications
You must be signed in to change notification settings - Fork 92
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
MRG: Make get_head_mri_trans() respect datatype and suffix attributes of MEG BIDSPath #969
MRG: Make get_head_mri_trans() respect datatype and suffix attributes of MEG BIDSPath #969
Conversation
get_head_mri_trans() currently blindly replaces the datatype and suffix of the provided MEG BIDSPath with 'meg'. However, when working with derivative data, the suffix might be different, causing the function to fail as it will create a BIDSPath that points to a non-existent file. The change here makes it such that if the provided MEG BIDSPath has a suffix and / or datatype attribute set, they will not be modified. Only if the attributes are not set, we will fall back to 'meg'.
Codecov Report
@@ Coverage Diff @@
## main #969 +/- ##
==========================================
- Coverage 94.58% 94.57% -0.01%
==========================================
Files 25 25
Lines 3584 3597 +13
==========================================
+ Hits 3390 3402 +12
- Misses 194 195 +1
Continue to review full report at Codecov.
|
can you add a test to make the pb more explicit to me? 🙏 |
@agramfort Yes, this is all still very much WIP, just wanted to get this started so I don't forget about it |
@alexrockhill @agramfort Do you have any idea why in |
@agramfort I've added a test that hopefully demonstrates why this change is needed, at least until we've fully sketched out derivatives in BIDS and the BIDS-Pipeline. |
Can you explain what you mean by this? I don't follow. |
I will try to add a test that provokes a failure by using an unsupported coordinate system |
Ah I get what you mean now. I think the larger issue is that we have I'm not sure why it matters so much about the landmarks, I thought those were just used in the case of EEG data stored in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok to merge when green
thx @hoechenberger
@alexrockhill never mind, I discussed this with @agramfort and I think this approach here fixes things for us. We're dealing with files that do not conform to the BIDS naming conventions (they are derivatives) and we needed a way to use |
get_head_mri_trans()
currently blindly replaces the datatype and suffix of the provided MEGBIDSPath
with'meg'
. However, when working with derivative data, the suffix (and maybe the datatype too? needs to be discussed!) might be different, causing the function to fail as it will create aBIDSPath
that points to a non-existent file.The change here makes it such that if the provided MEG
BIDSPath
already has a suffix and / or datatype attribute set, they will not be modified. Only if the attributes are not set, we will fall back to'meg'
.This change is required to use
get_head_mri_trans()
with Maxwell-filtered data produced by the MNE-BIDS-Pipeline.The problem was discovered yesterday while working with @SophieHerbst.
WIP:
Merge checklist
Maintainer, please confirm the following before merging: