Open manuelakuhn opened 3 years ago
Hm.
While developing a rule file I came across the problem that there seems to be no possibility to reset the studyspec.json file.
What about git checkout HEAD~1 -- studyspec.json
(or whatever state you want to reset to)? May be I miss something, but not clear to me what else would be required/desired.
Although this is doable I see multiple problems with it:
1) You always have to keep track when you did what, especially if you do something else in between or find out that your rule does not quite fit way later in data taking and converting. To give a more drastic example: When a problem is introduced in some older commit, and afterwards some correct rule additions where made, a simple checkout would be not enough. 2) In addition this is quite inconvenient. The number of steps needed is already quite large compared to other bids conversion tools. 3) Especially concerning inexperienced users having to revert to an older commit seems overly complicated to me.
I was more thinking of a flag to give to dicom2spec with which the studyspec can be reset. Something like
$ datalad hirni-dicom2spec --reset -s acq1/studyspec.json acq1/dicoms
would create the studyspec anew.
Okay. So, not reset to some previous state, but just recreate from scratch. Yes, that should be easy and useful.
While developing a rule file I came across the problem that there seems to be no possibility to reset the
studyspec.json
file. Writing own rule files is quite some back and forth, especially if it is the first time to do it, but because the studyspec file always builds on top of the already existing one the behaviour can be unexpected (and sometimes not revertible).An option to reset the studyspec to the state it was before any rule was applied would help here.
Unfortunately I do not know anymore what I did exactly when I first encounter this problem but I was able to create a (somewhat artificial) minimal example:
create rule + apply rule
-> result
change rule by adding
run
clean up and recreate bids:
-> file names change
revert back changes in rule file + try again:
-> output not reverted, would expect same output as in 1. but got output same as 2.: