Heudiconv missed MPRAGE

I converted DICOM to BIDS with heuristic converter, it’s seems it missed mprage mri series. Could heudiconv merge T1 with mprage series? Here is the dicominfo and results of heudiconv dcm2niix conversion:

After conversion i have only sub_010_T1w.nii.gz and MPrage is missed.

heudistic file:
from collections import defaultdict

def create_key(template, outtype=(‘nii.gz’,), annotation_classes=None):
if template is None or not template:
raise ValueError(‘Template must be a valid format string’)
return template, outtype, annotation_classes

def infotodict(seqinfo):

"""Heuristic evaluator for determining which runs belong where

allowed template fields - follow python string module:

item: index within category
subject: participant id
seqitem: run number during scanning
subindex: sub index within group
key_template = 'sub-{{subject}}/{}/sub-{{subject}}_{}'

info = defaultdict(list)

for header in seqinfo:
    # Main assumption: if resolution of pixels averaged over dimensions
    # less than 2 mm then it's anatomical slices
    if 'EPI' not in header.image_type and 'EPI' not in header.sequence_name:
        key = create_key(key_template.format('anat', 'T1w'))
        task = 'task-ser' + header.series_description.lower().replace(' ', '-')
        task += '_bold'
        key = create_key(key_template.format('func', task))
return info

Hi @Relyativist - heudiconv shouldn’t merge across series. To check what your info looks like, you can refer to the *.auto.txt file that resides in the same directory as the dicominfo.

One thing to keep in mind is you are grouping two series into having identical template names (T1 and MPRAGE) - you may want to differentiate those with another identifier (perhaps _run or _acq)