DICOM to Nifti Heudiconv-Multiple Heuristic files

Hi everyone,

I am trying to create an automated pipeline and have never created one before. I am currently attempting to do DICOM to Nifti conversion through Heudiconv but have different heuristic -f files for various data collection sites that organize the format to BIDS based on how data is collected at the site. I currently have a bash .sh script but that is not the most efficient because I’m constantly having to change the -f path.

Eventually what I would like to do is create my automated script in Python and run the bash script to do dicom to nifti through python as a function in subprocess but utilize different heuristic files for each site.

How is the best way to specify different heuristic files? Does anyone have an example script they can share where they have used multiple heuristic files to do DICOM to BIDS conversion?

Thanks.

–Subbi M.

  1. if your proceed with “map to reproin” heuristic (see heuristic option: sequence names remappings and other control · Issue #18 · ReproNim/reproin · GitHub … we need to add example on howto to Reproin — heudiconv 1.1.2 documentation tutorial…), then you could simply have a single heuristic unless there are some “collisions”
    in mappings
  2. in the reproin/bin/reproin at master · ReproNim/reproin · GitHub helper I use (largely generic but might have some hardcoded paths ATM) I rely on the fact that if there is .heudiconv/heuristic.py then I use that heuristic instead of plain reproin heuristic

Hi,

I’m not familiar with this. Would it be easier to create functions one for each site in Python and then run heudiconv through there?

Has anyone worked with using config files to denote multiple heuristic files. I’m new to creating config files.

I basically have 4 different sites and each site has a different heuristic.py to convert DICOM to BIDS.

Thanks.

–Subbi M.

That’s my point – you might not need different heuristics. You might come up with a mapping which covers them all. e.g. see qaqc-sample/heudiconv_app/assets/a2cps.py at main · a2cps/qaqc-sample · GitHub which I believe a heuristic used across 5 (?) sites in a2cps study, and maps differing names into “reproin”.

But also, if sites have different study descriptions in their DICOMs, you could have different mappings per each one of them (instead of “catch all” "": ).