Skip to content

How to Use HeuDiConv

Yntiglei edited this page Jan 15, 2024 · 3 revisions

Overview

HeuDiConv is a python based program, it calls dcm2niix and can convert all your dicom file really quick.

There are plenty of HeuDiConv tutorial online, here are the ones I think it's good. However, how to use HeuDiConv by singulairy or use it by calling HeuDiConv is unknown, and it is not explicit how to properly build your heuritic.py file.

So this documentation will explain to you how to run HeudiConv through Singularity, through pip installs HeuDiConv package. And I will also include a detailed explanation of how to properly build your heuristic.py file.

How does HeuDiConv work?

HeuDiConv workflow is simple. once you have your dicom file ready, you will first run HeuDiConv step 1. The step1 code will not actually run the dcm2niix converter, it will analyze your dicom data and gives you a hidden folder called .heudiconv inside the info directory. You will find a dicominfo_ses-001.tsv. This tsv file is your major reference to build you heuristic.py

Then after you edit your heuristic.py file according to your analysis needs. You are going to run HeuDiConv step 2. It will call dcm2niix and actually transfer your dicom data to nifti. The naming strategy of step 2 is totally based on you heuristic.py file. So you need to have BIDS knowledge to edit your heuristic.py file.

How to edit heuristic.py file?

The logic of heuristic.py file is also simple.

First, you need to identify all the nii file you needed according to your analysis needs or your MRI scanning plan. You will highly likely to have: T1w, T2w, dwi, fMRI, and qMRI data.

Second, you are going to filter the corresponding dicom file using the dicom.tsv You can use s.xxx to do it

The code