Hello Neurostars experts,
I am trying to convert a dataset using heudiconv with the script
implement_heudiconv.txt (2.0 KB)
to convert my dataset from DICOM to BIDS. However, I am getting the following Warning when testing for the BIDS validity, that seems concerning, given that the file size seems way smaller that what it is supposed to be: only 5 TRs instead of 147…??? What could be happening here?
I use Docker on a MacOs Monterey V. 12.6.2
sub-F019_task-phantom_run-006_bold.nii.gz2991.503 KB | application/x-gzip
Location:
Nifti/sub-F019/func/sub-F019_task-phantom_run-006_bold.nii.gz
Reason:
The most common set of dimensions is: 112,112,38,147 (voxels), This file has the dimensions: 112,112,46,5 (voxels).
Code within the heuristic.py file:
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
"""
# paths done in BIDS format
t1w = create_key('sub-{subject}/anat/sub-{subject}_run-{item:03d}_T1w')
phantom = create_key('sub-{subject}/func/sub-{subject}_task-phantom_run-{item:03d}_bold')
loc = create_key('sub-{subject}/func/sub-{subject}_task-localizer_run-{item:03d}_bold')
prf = create_key('sub-{subject}/func/sub-{subject}_task-prf_run-{item:03d}_bold')
rest = create_key('sub-{subject}/func/sub-{subject}_task-rest_run-{item:03d}_bold')
info = {t1w: [], phantom: [], loc: [], prf: [], rest: []}
# last_run = len(seqinfo)
for s in seqinfo:
"""
The namedtuple `s` contains the following fields:
* total_files_till_now
* example_dcm_file
* series_id
* dcm_dir_name
* unspecified2
* unspecified3
* dim1
* dim2
* dim3
* dim4
* TR
* TE
* protocol_name
* is_motion_corrected
* is_derived
* patient_id
* study_description
* referring_physician_name
* series_description
* image_type
"""
if 'T1' in s.series_description:
info[t1w].append(s.series_id)
if 'Exp' in s.series_description:
info[phantom].append(s.series_id)
if ('LOC' in s.series_description) and ('Localizer' in s.study_description):
info[loc].append(s.series_id)
if ('LOC' in s.series_description) and ('Prf' in s.study_description):
info[prf].append(s.series_id)
if 'Rest' in s.series_description:
info[rest].append(s.series_id)
return info
dicominfo.tsv file:
total_files_till_now example_dcm_file series_id dcm_dir_name series_files unspecified dim1 dim2 dim3 dim4 TR TE protocol_name is_motion_corrected is_derived patient_id study_description referring_physician_name series_description sequence_name image_type accession_number patient_age patient_sex date series_uid time
55786 Tong_349954.01.01.13-06-23.WIP_Survey_32ch_HeadCoil.01-classic1.DCM 7101-WIP Survey_32ch_HeadCoil DICOM-Classic 9 256 256 9 1 0.0101482 4.934 WIP Survey_32ch_HeadCoil FALSE FALSE Tong_349954 Survey_32ch_HeadCoil ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.7101.1679601576.1.296485376 None
55846 Tong_349954.02.01.13-08-33.WIP_B0_unshimmed.01-classic1.DCM 7201-WIP B0 unshimmed DICOM-Classic 60 64 64 60 1 0.004 1.577 WIP B0 unshimmed FALSE FALSE Tong_349954 B0 unshimmed ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.7201.1679601576.1.296485376 None
55906 Tong_349954.03.01.13-13-03.WIP_B0_shimmed.01-classic1.DCM 7301-WIP B0 shimmed DICOM-Classic 60 64 64 60 1 0.004 1.577 WIP B0 shimmed FALSE FALSE Tong_349954 B0 shimmed ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.7301.1679601575.1.296485376 None
56206 Tong_349954.04.01.13-13-52.WIP_RL_MPRAGE0.6mm_PEdirRL_SENSE.01-classic1.DCM 7401-WIP RL_MPRAGE0.6mm_PEdirRL SENSE DICOM-Classic 300 448 448 300 1 0.0056053 2.558 WIP RL_MPRAGE0.6mm_PEdirRL SENSE FALSE FALSE Tong_349954 WIP RL_MPRAGE0.6mm_PEdirRL SENSE ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.7401.1679601565.1.296485376 None
56248 Tong_349954.05.01.13-18-00.WIP_ssEPI_FFE_testIM.01-classic1.DCM 7501-WIP ssEPI_FFE_testIM DICOM-Classic 42 112 112 42 1 1.999998047 25.001 WIP ssEPI_FFE_testIM FALSE FALSE Tong_349954 ssEPI_FFE_testIM ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.7501.1679601574.1.296485376 None
56294 Tong_349954.06.01.13-18-52.WIP_func_noEPI.01-classic1.DCM 7601-WIP func_noEPI DICOM-Classic 46 112 112 46 1 2.000001831 25 WIP func_noEPI FALSE FALSE Tong_349954 func_noEPI ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.7601.1679601564.1.296485376 None
61994 Tong_349954.07.01.13-22-04.WIP_ssEPI_LOC_150.01-classic1.DCM 7701-WIP ssEPI_LOC_150 DICOM-Classic 5700 112 112 5700 1 2.000000854 25 WIP ssEPI_LOC_150 FALSE FALSE Tong_349954 Localizer ssEPI_LOC_150 ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.7701.1679601036.1.296485376 None
62224 Tong_349954.08.01.13-29-06.WIP_ssEPI_LOC_TU.01-classic1.DCM 7801-WIP ssEPI_LOC_TU DICOM-Classic 230 112 112 230 1 1.999999512 25.001 WIP ssEPI_LOC_TU FALSE FALSE Tong_349954 ssEPI_LOC_TU ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.7801.1679601029.1.296485376 None
67810 Tong_349954.09.01.13-29-56.WIP_ssEPI_Exp_147.01-classic1.DCM 7901-WIP ssEPI_Exp_147 DICOM-Classic 5586 112 112 5586 1 2.000000854 25 WIP ssEPI_Exp_147 FALSE FALSE Tong_349954 Phantom ssEPI_Exp_147 ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.7901.1679600525.1.296485376 None
68040 Tong_349954.10.01.13-38-15.WIP_ssEPI_Exp_TU.01-classic1.DCM 8001-WIP ssEPI_Exp_TU DICOM-Classic 230 112 112 230 1 1.999999512 25.001 WIP ssEPI_Exp_TU FALSE FALSE Tong_349954 ssEPI_Exp_TU ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.8001.1679600519.1.296485376 None
73626 Tong_349954.11.01.13-39-05.WIP_ssEPI_Exp_147.01-classic1.DCM 8101-WIP ssEPI_Exp_147 DICOM-Classic 5586 112 112 5586 1 2.000000854 25 WIP ssEPI_Exp_147 FALSE FALSE Tong_349954 Phantom ssEPI_Exp_147 ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.8101.1679600004.1.296485632 None
73856 Tong_349954.12.01.13-46-24.WIP_ssEPI_Exp_TU.01-classic1.DCM 8201-WIP ssEPI_Exp_TU DICOM-Classic 230 112 112 230 1 1.999999512 25.001 WIP ssEPI_Exp_TU FALSE FALSE Tong_349954 ssEPI_Exp_TU ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.8201.1679599998.1.296485632 None
79556 Tong_349954.13.01.13-47-14.WIP_ssEPI_LOC_150.01-classic1.DCM 8301-WIP ssEPI_LOC_150 DICOM-Classic 5700 112 112 5700 1 2.000000854 25 WIP ssEPI_LOC_150 FALSE FALSE Tong_349954 Prf_CW ssEPI_LOC_150 ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.8301.1679599438.1.296485632 None
79786 Tong_349954.14.01.13-55-27.WIP_ssEPI_LOC_TU.01-classic1.DCM 8401-WIP ssEPI_LOC_TU DICOM-Classic 230 112 112 230 1 1.999999512 25.001 WIP ssEPI_LOC_TU FALSE FALSE Tong_349954 ssEPI_LOC_TU ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.8401.1679599431.1.296485632 None
85486 Tong_349954.15.01.13-56-16.WIP_ssEPI_LOC_150.01-classic1.DCM 8501-WIP ssEPI_LOC_150 DICOM-Classic 5700 112 112 5700 1 2.000000854 25 WIP ssEPI_LOC_150 FALSE FALSE Tong_349954 Prf_CCW ssEPI_LOC_150 ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.8501.1679598877.1.296485632 None
85716 Tong_349954.16.01.14-04-49.WIP_ssEPI_LOC_TU.01-classic1.DCM 8601-WIP ssEPI_LOC_TU DICOM-Classic 230 112 112 230 1 1.999999512 25.001 WIP ssEPI_LOC_TU FALSE FALSE Tong_349954 ssEPI_LOC_TU ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.8601.1679598869.1.296485632 None
85890 Tong_349954.17.01.14-06-27.WIP_T1_LGN_SENSE.01-classic1.DCM 8701-WIP T1_LGN SENSE DICOM-Classic 174 256 256 174 1 0.0040366 1.814 WIP T1_LGN SENSE FALSE FALSE Tong_349954 WIP T1_LGN SENSE ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.8701.1679598867.1.296485632 None
91590 Tong_349954.18.01.14-10-28.WIP_ssEPI_LOC_150.01-classic1.DCM 8801-WIP ssEPI_LOC_150 DICOM-Classic 5700 112 112 5700 1 2.000000854 25 WIP ssEPI_LOC_150 FALSE FALSE Tong_349954 Prf_CCW ssEPI_LOC_150 ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.8801.1679598313.1.296485632 None
91820 Tong_349954.19.01.14-17-55.WIP_ssEPI_LOC_TU.01-classic1.DCM 8901-WIP ssEPI_LOC_TU DICOM-Classic 230 112 112 230 1 1.999999512 25.001 WIP ssEPI_LOC_TU FALSE FALSE Tong_349954 ssEPI_LOC_TU ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.8901.1679598306.1.296485632 None
97406 Tong_349954.20.01.14-18-46.WIP_ssEPI_Exp_147.01-classic1.DCM 9001-WIP ssEPI_Exp_147 DICOM-Classic 5586 112 112 5586 1 2.000000854 25 WIP ssEPI_Exp_147 FALSE FALSE Tong_349954 Phantom ssEPI_Exp_147 ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.9001.1679597769.1.296485632 None
97636 Tong_349954.21.01.14-28-51.WIP_ssEPI_Exp_TU.01-classic1.DCM 9101-WIP ssEPI_Exp_TU DICOM-Classic 230 112 112 230 1 1.999999512 25.001 WIP ssEPI_Exp_TU FALSE FALSE Tong_349954 ssEPI_Exp_TU ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.9101.1679597762.1.296485632 None
103222 Tong_349954.22.01.14-29-41.WIP_ssEPI_Exp_147.01-classic1.DCM 9201-WIP ssEPI_Exp_147 DICOM-Classic 5586 112 112 5586 1 2.000000854 25 WIP ssEPI_Exp_147 FALSE FALSE Tong_349954 Phantom ssEPI_Exp_147 ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.9201.1679597228.1.296485632 None
103452 Tong_349954.23.01.14-37-30.WIP_ssEPI_Exp_TU.01-classic1.DCM 9301-WIP ssEPI_Exp_TU DICOM-Classic 230 112 112 230 1 1.999999512 25.001 WIP ssEPI_Exp_TU FALSE FALSE Tong_349954 ssEPI_Exp_TU ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.9301.1679597221.1.296485632 None
109038 Tong_349954.24.01.14-38-20.WIP_ssEPI_Exp_147.01-classic1.DCM 9401-WIP ssEPI_Exp_147 DICOM-Classic 5586 112 112 5586 1 2.000000854 25 WIP ssEPI_Exp_147 FALSE FALSE Tong_349954 Phantom ssEPI_Exp_147 ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.9401.1679596684.1.296485632 None
109268 Tong_349954.25.01.14-45-03.WIP_ssEPI_Exp_TU.01-classic1.DCM 9501-WIP ssEPI_Exp_TU DICOM-Classic 230 112 112 230 1 1.999999512 25.001 WIP ssEPI_Exp_TU FALSE FALSE Tong_349954 ssEPI_Exp_TU ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.9501.1679596677.1.296485632 None
114854 Tong_349954.26.01.14-45-54.WIP_ssEPI_Exp_147.01-classic1.DCM 9601-WIP ssEPI_Exp_147 DICOM-Classic 5586 112 112 5586 1 2.000000854 25 WIP ssEPI_Exp_147 FALSE FALSE Tong_349954 Phantom ssEPI_Exp_147 ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.9601.1679596125.1.296485632 None
115084 Tong_349954.27.01.14-52-48.WIP_ssEPI_Exp_TU.01-classic1.DCM 9701-WIP ssEPI_Exp_TU DICOM-Classic 230 112 112 230 1 1.999999512 25.001 WIP ssEPI_Exp_TU FALSE FALSE Tong_349954 ssEPI_Exp_TU ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.9701.1679596118.1.296485632 None
117364 Tong_349954.28.01.14-53-39.WIP_ssEPI_Rest.01-classic1.DCM 9801-WIP ssEPI_Rest DICOM-Classic 2280 112 112 2280 1 2.000000854 25 WIP ssEPI_Rest FALSE FALSE Tong_349954 ssEPI_Rest ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.9801.1679596024.1.296485632 None
117594 Tong_349954.29.01.14-57-40.WIP_ssEPI_Rest_TU.01-classic1.DCM 9901-WIP ssEPI_Rest_TU DICOM-Classic 230 112 112 230 1 1.999999512 25.001 WIP ssEPI_Rest_TU FALSE FALSE Tong_349954 ssEPI_Rest_TU ('ORIGINAL', 'PRIMARY', 'M_FFE', 'M', 'FFE') 025Y F None 0.0.0.0.3.27248.9901.1679596021.1.296485632 None
I also noticed that the number of niftii files, and therefore runs is twice higher for the experiment functional runs (goes from run-001 to run-014 instead of run-001 to run-007.
Is there anything I did wrong in the process?
Any help would be highly appreciated.
Thanks!
Best,
-Loïc