Record changing variable on multiple sessions
Summary
I would like to ensure that the current version of heudiconv supports recording the changing variable on every session on _sessions.tsv file under each subject? This file is described in this BIDS specification. The use case of this, for example, is recording the patient weight or height, which obviously will likely to change throughout the sessions.
Correct me if I am wrong, but by reading the --help, I could not really find any option that enable this output.
Platform details:
Choose one:
- [x] Local environment: Ubuntu 18.04, Python 3.7.3
- [ ] Container
- Heudiconv version: 0.6.0.dev1
I just spotted the custom_callable option which can be supplied to the heuristic. This might be a reasonable workaround for the moment:
https://github.com/nipy/heudiconv/blob/02f5980c697b69494a80cfa4f68009a8ee10502b/heudiconv/convert.py#L334
However this isn't the most convenient way to do it though because the custom callable will be called multiple times per session. Presumably the better place to insert this kind of functionality is roughly around here:
https://github.com/nipy/heudiconv/blob/02f5980c697b69494a80cfa4f68009a8ee10502b/heudiconv/convert.py#L213
I think we can probably implement this and submit a PR if the maintainers would like to have this.
If so, advice regarding the best way to do it would be appreciated as we (@darrencl and myself) have only just started to work with heudiconv. In particular I'd like to know what API you think would make sense for condensing metadata from multiple dicom file groups.