heudiconv icon indicating copy to clipboard operation
heudiconv copied to clipboard

heudiconv extensions

Open mgxd opened this issue 6 years ago • 3 comments

Idea brought from #381 - allow the use of extensions to do additional processing during conversions

mgxd avatar Oct 23 '19 15:10 mgxd

Sounds great. We should identify core steps and probably go with a mechanism similar to git hooks, just pick them up across different levels (system, user, current dataset). Or may be there is a better way?

yarikoptic avatar Oct 23 '19 22:10 yarikoptic

Having an extension mechanism would be great. What I think would make sense for #381 would be to somehow benefit from the dicom grouping and organization work which heudiconv already does, but to then allow some user-defined code to run over the grouping and add output results to the bids directory.

I'm not entirely sure that covers our use case though. @darrencl you are the one who knows the gory detail of how our script was implemented; perhaps you can follow along here as well.

c42f avatar Oct 24 '19 03:10 c42f

I agree that it is useful to allow users run their code on groupings produced by heudiconv. Getting access to particular item of seqinfo or filegroup (in our case, the MRS) and being able to run custom processing on that may be enough for our script to integrate with heudiconv.

On a side note, if heudiconv are planning to support the extension which would run over various BIDS extensions, including MRS, this following checking needs to be turned off or modified.

https://github.com/nipy/heudiconv/blob/dcc590d0be8c514211c8a7323467acce2b338e9c/heudiconv/dicoms.py#L151-L154

darrencl avatar Oct 24 '19 05:10 darrencl