Closed obergmartin closed 7 months ago
Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴🏽♂️
After thinking through this for a while I have come to thinking that while this would be BIDS abuse and could be useful for organizing (non-BIDS compliant) derivatives, it isn't needed and BIDS should keep doing what it does and doing it well. Although I'm moving on, I would be interested if anyone reading in the future this has any thoughts.
Hi @obergmartin sorry for the late response. I am glad you found a solution that is working for you.
For the record, I wouldn't have liked to code such a "trick" into BIDSPath, because the more such "use case tricks" we support, the less clear the overall functionality becomes. Furthermore, I think that using some additional lines of custom code can easily achieve what you had in mind (which is probably what you ended up with).
One note for future issues that you write. You wrote:
can we change path.py line 994 (in BIDSPath.update) to something like:
You can simply navigate to the file in the repo, find the line, and generate a permalink to it, see this screenshot:
Once you have done that, you can paste the link here and it renders nicely:
This can be helpful for people reading your issue, as they can directly jump into the code :-)
Describe the problem
Would it be too much of an abuse of mne_bids.BIDSPath to allow "/" as a directory separator in the
datatype
field whencheck=False
is passed as a parameter? I'm trying to organize my derivative files and would like to usedatatype
as a subdirectory field.This is the current error:
Specifically, I'd like to nest preprocessing steps and their intermediate outputs in a directory heirarchy, eg: Rereference/ComputeICA/RejectICA/Epoch, but, for example, allow different rejected IC combinations in order to examine the differences in data quality between choices. Thus I would also have: ComputeICA/RejectICA2/Epoch as a directory hierarchy.
Describe your solution
can we change path.py line 994 (in BIDSPath.update) to something like:
if key in ["suffix", "datatype"] and not self.check:
That allows this code to execute:
with the desired output:
PosixPath('derivatives/pipeline-test/sub-999/First/Second/sub-999_desc-test_eeg.fif')
Describe possible alternatives
I know this is a bit of an abuse of the BIDSPath, but I do like having mne_bids do the ordering of all the other key-values pairs. I've read in the docs that BIDS derivative files can be non-compliant. It doesn't seem too much of a stretch to use datatype as a proxy for derivative preprocessing steps since is is a new "type" of data resulting from preprocessing. But I'm also interested in hearing other ideas or suggestions.
Additional context
I know this allows for more that my specific use case, but with the great power of
check=False
comes great responsibility!