Open yarikoptic opened 6 years ago
That would be a great tool. Happy to contribute!
I think this kind of functionality could quite comfortably live inside of pybids. Note that per discussion in INCF/pybids#63, it's now possible to re-map entire file structures (both within BIDS and to/from other structures) in a pretty elegant way via grabbids/grabbit. The only thing we're missing is a set of output patterns that define all the valid BIDS paths.
This doesn't preclude a utility of the kind you're proposing, of course. From a UI standpoint, users don't want to have to muck around with project-wide remapping, they just want to call session_rename
or something. But implementation-wise, I think it would be very nice from an abstraction and maintainability standpoint to implement these kinds of tools as wrappers around the existing grabbids/grabbit functionality.
YES, definitely pybids/grabbids/grabbit should be used as much as possible! Although it sounds only logical, and makes many things easier, and precedents exist (nibabel providing nib-* utilites), I didn't dare to suggest it to live inside pybids, to not mud the purity of it:
but yeah, for a quick start could also be done within pybids -- so "to be decided" I guess ;)
For a while I felt the need, and at some point expressed it (but forgot where), to get a command line (or may be eventually some GUI) utility to manipulate a BIDS dataset. Quite often due to inherent redundancy, some trivial operations are not that trivial. E.g.
subject-rename
for now) requiressub-
directorysourcedata/
(and who knows -- may be.heudiconv/
)sub-
prefixsourcedata/
_scans
file as well since that is where those files are listed as wellrename
) - could be used bysubject-rename
-- since a file might have a side car file, and then listed in_scans
, might come handy_test
session-rename
)session-rename '' session
) -- whenever dataset (or a specific subject?) was collected without any session'ing, and then multiple sessions decided to be takenIdeally the tool should be aware of git and/or git-annex, i.e. that files might be under VCS and then should use corresponding VCS functions.
Originally I thought to propose this development within pybids, but per-se such utility (
bids
) does not have to (although likely will) be implemented using pybids. Some functionalities, which operate on BIDS-compliant datasets, could be achieved via re-layouting using pybids, but then it should also become capable to capture those under.heudiconv
andsourcedata/
which is not strongly "prescribed" in BIDS (there is only a recommendation to follow BIDS naming there as well)