Customizing BIDS JSON fields using HeuDiConv

Hi all,

I was hoping to get some guidance with heudiconv and dcm2niix. To give some context, I am currently running heudiconv with custom heuristics to convert our data into BIDS format. I was wondering if there was a way to customize the json fields for specific scans during conversion (e.g., add user-defined json fields and remove fields for specific scans).

In particular, I was hoping to do the following:

  • For all our bold.json files, Remove AcquisitionDuration since AcquisitionDuration and RepetitionTime are mutually exclusive
  • Add calculated fields (computed based on DICoM tags) like:
    • SliceTiming to bold.json
    • TotalReadoutTime to epi.json

Is there a built-in or recommended way to modify these json sidecars using tools from heudiconv or dcm2niix? Or do we need to handle this in a post-processing script/step?

Any tips and resources would be greatly appreciated!

Hi @mtrinh2 and welcome to neurostars!

I cannot speak to HeuDiConv in particular, but the python JSON library is easy to use and can manipulate sidecar data. Dcm2bids, an alternative software, does have an option to add sidecar fields directly.

Best,
Steven