From 464e46809d581ceef195fac26ebe9d83f2cc19e3 Mon Sep 17 00:00:00 2001 From: bpinsard Date: Thu, 30 May 2024 11:30:59 -0400 Subject: [PATCH] add complex part to ImageType for use in heuristics, it is done in dcm2niix when converting --- heudiconv/dicoms.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/heudiconv/dicoms.py b/heudiconv/dicoms.py index ef51086a..ba32b2d6 100644 --- a/heudiconv/dicoms.py +++ b/heudiconv/dicoms.py @@ -76,6 +76,15 @@ def create_seqinfo(mw: dw.Wrapper, series_files: list[str], series_id: str) -> S else: sequence_name = "" + # GE data + # see https://github.com/rordenlab/dcm2niix/tree/master/GE#complex-image-component + if dcminfo.get([0x43, 0x102F]): + GE_CPLX_CODING = ["PHASE", "MAGNITUDE", "REAL", "IMAGINARY"] + cplx_idx = int(dcminfo.get([0x43, 0x102F]).value) + part = GE_CPLX_CODING[cplx_idx] + if part not in image_type: + image_type = image_type + (part,) + # initialized in `group_dicoms_to_seqinfos` global total_files total_files += len(series_files)