MP2RAGE to BIDS

Hi all, I have a 7T dataset with an MP2RAGE sequence that I want to transform to BIDS. I am aware of the BIDS specification for “Quantitative MRI” (here: Quantitative MRI - Brain Imaging Data Structure v1.9.0) but I still struggle to map my DICOMs to the appropriate BIDS files.

Here are the series_description entries after an initial heudiconv run with -f convertall:

t1_mp2rage_sag_0.6mm_TR4800_CS4_INV1_ND
t1_mp2rage_sag_0.6mm_TR4800_CS4_UNI-DEN_ND
t1_mp2rage_sag_0.6mm_TR4800_CS4_INV2_ND
t1_mp2rage_sag_0.6mm_TR4800_CS4_INV1
t1_mp2rage_sag_0.6mm_TR4800_CS4_INV2
t1_mp2rage_sag_0.6mm_TR4800_CS4_UNI-DEN

The BIDS file collection for MP2RAGE is supposed to look like this:

└─ sub-01/
   └─ anat/
      ├─ sub-01_inv-1_part-mag_MP2RAGE.nii.gz 
      ├─ sub-01_inv-1_part-phase_MP2RAGE.nii.gz 
      ├─ sub-01_inv-1_MP2RAGE.json 
      ├─ sub-01_inv-2_part-mag_MP2RAGE.nii.gz 
      ├─ sub-01_inv-2_part-phase_MP2RAGE.nii.gz 
      └─ sub-01_inv-2_MP2RAGE.json 

Any ideas which of my DICOMs go where in BIDS? Thanks in advance for any help!

Hi @lennart,

It is hard for us to help without seeing the JSONS output from dcm2niix.

Best,
Steven

1 Like

Hi @lennart,

The MP2RAGE images have two inversions, named inversion 1 and inversion 2. These are likely the series description ending in INV1 and INV2 respectively. Some scanners create a derived image from these two source images that will be called the uniform image, which is likely the one ending in UNI. I’m not sure about the ND name, but often this is used for non-distortion (ND) corrected on the scanner. If you acquired one image with distortion correction and one without (ND) distortion correction that might explain the two sets of images.
I’m guessing the DEN might mean derived image, but not sure about the suffix.

If you ignored the ND files, then you already have a mapping for the inv1 and inv2 images as you referenced above. The uniform image is a derived image so BIDS says it goes in the derivatives directory. See this section for reference: Quantitative MRI - Brain Imaging Data Structure v1.9.0
I personally name them something like sub-ABC_ses-123_MP2RAGE-UNI.nii.gz - since its in Derivatives it doesn’t have to conform to pass the bids check so you have more latitude on your naming scheme.

I guess you could use an acq-ND for the ND images, or something similar, if you wanted the non-distortion correction acquisition as well.

Hope that’s helpful.

1 Like

Hi @Steven and @JarodRoland,

thank you very much for your responses and help. Sorry for my delayed response, I had to pause work on this for a few days but now ran heudiconv -f convertall and got the .json files for all runs.

Here are the .json files for the six MP2RAGE DICOMS:

run010.json
{
  "AcquisitionDuration": 491.317,
  "AcquisitionMatrixPE": 384,
  "AcquisitionNumber": 1,
  "AcquisitionTime": "16:43:26.625000",
  "BaseResolution": 384,
  "BodyPartExamined": "BRAIN",
  "CoilCombinationMethod": "Adaptive Combine",
  "CoilString": "8Tx32Rx_Head_C",
  "ConversionSoftware": "dcm2niix",
  "ConversionSoftwareVersion": "v1.0.20220720",
  "DeviceSerialNumber": "237008",
  "DwellTime": 5.2e-06,
  "EchoTime": 0.00291,
  "FlipAngle": 5,
  "HeudiconvVersion": "1.1.6",
  "ImageComments": "Inv1 Image",
  "ImageOrientationPatientDICOM": [-0.0613295, 0.998118, -3.07892e-09, 0.0392841, 0.00241382, -0.999225],
  "ImageType": [
    "ORIGINAL",
    "PRIMARY",
    "T1",
    "NONE"
],
  "ImageTypeText": [
    "ORIGINAL",
    "PRIMARY",
    "M",
    "ND"
],
  "ImagingFrequency": 297.194,
  "InPlanePhaseEncodingDirectionDICOM": "ROW",
  "InstitutionAddress": " ,,,DE,",
  "InversionTime": 0.9,
  "MRAcquisitionType": "3D",
  "MTState": false,
  "MagneticFieldStrength": 7,
  "Manufacturer": "Siemens",
  "ManufacturersModelName": "MAGNETOM Terra.X",
  "Modality": "MR",
  "NonlinearGradientCorrection": false,
  "PartialFourier": 1,
  "PatientPosition": "HFS",
  "PercentPhaseFOV": 100,
  "PercentSampling": 100,
  "PhaseResolution": 1,
  "PixelBandwidth": 250,
  "ProcedureStepDescription": "Klips highspeed",
  "ProtocolName": "t1_mp2rage_sag_0.6mm_TR4800_CS4",
  "PulseSequenceDetails": "%SiemensSeq%\\tfl",
  "PulseSequenceName": "*tfl3d1_232ns",
  "ReceiveCoilActiveElements": "AC",
  "ReceiveCoilName": "8Tx32Rx_Head_C",
  "ReconMatrixPE": 384,
  "RefLinesPE": 32,
  "RepetitionTime": 4.8,
  "ScanOptions": "IR",
  "ScanningSequence": "GR\\IR",
  "SequenceVariant": "SK\\SP\\MP",
  "SeriesDescription": "t1_mp2rage_sag_0.6mm_TR4800_CS4_INV1_ND",
  "SeriesNumber": 12,
  "ShimSetting": [206, 656, 979, -51, -21, 142, 116, -84],
  "SliceThickness": 0.6,
  "SoftwareVersions": "syngo MR XA60",
  "StationName": "AWP237008",
  "TxRefAmp": 240.117
}
run011.json
{
  "AcquisitionMatrixPE": 384,
  "AcquisitionNumber": 1,
  "AcquisitionTime": "16:43:26.625000",
  "BaseResolution": 384,
  "BodyPartExamined": "BRAIN",
  "CoilCombinationMethod": "Adaptive Combine",
  "CoilString": "8Tx32Rx_Head_C",
  "ConversionSoftware": "dcm2niix",
  "ConversionSoftwareVersion": "v1.0.20220720",
  "DeviceSerialNumber": "237008",
  "DwellTime": 5.2e-06,
  "EchoTime": 0.00291,
  "HeudiconvVersion": "1.1.6",
  "ImageComments": "UNIFORM-weighted Image (lambda = 0.2)",
  "ImageOrientationPatientDICOM": [-0.0613295, 0.998118, -3.07892e-09, 0.0392841, 0.00241382, -0.999225],
  "ImageType": [
    "DERIVED",
    "PRIMARY",
    "T1",
    "UNIFORM"
],
  "ImageTypeText": [
    "DERIVED",
    "PRIMARY",
    "M",
    "ND",
    "UNI"
],
  "ImagingFrequency": 297.194,
  "InPlanePhaseEncodingDirectionDICOM": "ROW",
  "InstitutionAddress": " ,,,DE,",
  "MRAcquisitionType": "3D",
  "MTState": false,
  "MagneticFieldStrength": 7,
  "Manufacturer": "Siemens",
  "ManufacturersModelName": "MAGNETOM Terra.X",
  "Modality": "MR",
  "NonlinearGradientCorrection": false,
  "PartialFourier": 1,
  "PatientPosition": "HFS",
  "PercentPhaseFOV": 100,
  "PercentSampling": 100,
  "PhaseResolution": 1,
  "PixelBandwidth": 250,
  "ProcedureStepDescription": "Klips highspeed",
  "ProtocolName": "t1_mp2rage_sag_0.6mm_TR4800_CS4",
  "PulseSequenceDetails": "%SiemensSeq%\\tfl",
  "PulseSequenceName": "*tfl3d1_232ns",
  "RawImage": false,
  "ReceiveCoilActiveElements": "AC",
  "ReceiveCoilName": "8Tx32Rx_Head_C",
  "ReconMatrixPE": 384,
  "RefLinesPE": 32,
  "RepetitionTime": 4.8,
  "ScanOptions": "IR",
  "ScanningSequence": "GR\\IR",
  "SequenceVariant": "SK\\SP\\MP",
  "SeriesDescription": "t1_mp2rage_sag_0.6mm_TR4800_CS4_UNI-DEN_ND",
  "SeriesNumber": 13,
  "ShimSetting": [206, 656, 979, -51, -21, 142, 116, -84],
  "SliceThickness": 0.6,
  "SoftwareVersions": "syngo MR XA60",
  "StationName": "AWP237008",
  "TxRefAmp": 240.117
}
run012.json
{
  "AcquisitionDuration": 491.317,
  "AcquisitionMatrixPE": 384,
  "AcquisitionNumber": 1,
  "AcquisitionTime": "16:43:28.475000",
  "BaseResolution": 384,
  "BodyPartExamined": "BRAIN",
  "CoilCombinationMethod": "Adaptive Combine",
  "CoilString": "8Tx32Rx_Head_C",
  "ConversionSoftware": "dcm2niix",
  "ConversionSoftwareVersion": "v1.0.20220720",
  "DeviceSerialNumber": "237008",
  "DwellTime": 5.2e-06,
  "EchoTime": 0.00291,
  "FlipAngle": 3,
  "HeudiconvVersion": "1.1.6",
  "ImageComments": "Inv2 Image",
  "ImageOrientationPatientDICOM": [-0.0613295, 0.998118, -3.07892e-09, 0.0392841, 0.00241382, -0.999225],
  "ImageType": [
    "ORIGINAL",
    "PRIMARY"
],
  "ImageTypeText": [
    "ORIGINAL",
    "PRIMARY",
    "M",
    "ND"
],
  "ImagingFrequency": 297.194,
  "InPlanePhaseEncodingDirectionDICOM": "ROW",
  "InstitutionAddress": " ,,,DE,",
  "InversionTime": 2.75,
  "MRAcquisitionType": "3D",
  "MTState": false,
  "MagneticFieldStrength": 7,
  "Manufacturer": "Siemens",
  "ManufacturersModelName": "MAGNETOM Terra.X",
  "Modality": "MR",
  "NonlinearGradientCorrection": false,
  "PartialFourier": 1,
  "PatientPosition": "HFS",
  "PercentPhaseFOV": 100,
  "PercentSampling": 100,
  "PhaseResolution": 1,
  "PixelBandwidth": 250,
  "ProcedureStepDescription": "Klips highspeed",
  "ProtocolName": "t1_mp2rage_sag_0.6mm_TR4800_CS4",
  "PulseSequenceDetails": "%SiemensSeq%\\tfl",
  "PulseSequenceName": "*tfl3d1_232ns",
  "ReceiveCoilActiveElements": "AC",
  "ReceiveCoilName": "8Tx32Rx_Head_C",
  "ReconMatrixPE": 384,
  "RefLinesPE": 32,
  "RepetitionTime": 4.8,
  "ScanOptions": "IR",
  "ScanningSequence": "GR\\IR",
  "SequenceVariant": "SK\\SP\\MP",
  "SeriesDescription": "t1_mp2rage_sag_0.6mm_TR4800_CS4_INV2_ND",
  "SeriesNumber": 14,
  "ShimSetting": [206, 656, 979, -51, -21, 142, 116, -84],
  "SliceThickness": 0.6,
  "SoftwareVersions": "syngo MR XA60",
  "StationName": "AWP237008",
  "TxRefAmp": 240.117
}
run013.json
{
  "AcquisitionDuration": 491.317,
  "AcquisitionMatrixPE": 384,
  "AcquisitionNumber": 1,
  "AcquisitionTime": "16:43:26.625000",
  "BaseResolution": 384,
  "BodyPartExamined": "BRAIN",
  "CoilCombinationMethod": "Adaptive Combine",
  "CoilString": "8Tx32Rx_Head_C",
  "ConversionSoftware": "dcm2niix",
  "ConversionSoftwareVersion": "v1.0.20220720",
  "DeviceSerialNumber": "237008",
  "DwellTime": 5.2e-06,
  "EchoTime": 0.00291,
  "FlipAngle": 5,
  "HeudiconvVersion": "1.1.6",
  "ImageComments": "Inv1 Image",
  "ImageOrientationPatientDICOM": [-0.0613295, 0.998118, -3.07892e-09, 0.0392841, 0.00241382, -0.999225],
  "ImageType": [
    "ORIGINAL",
    "PRIMARY",
    "T1",
    "NONE"
],
  "ImageTypeText": [
    "ORIGINAL",
    "PRIMARY",
    "M",
    "DIS3D",
    "DIS2D"
],
  "ImagingFrequency": 297.194,
  "InPlanePhaseEncodingDirectionDICOM": "ROW",
  "InstitutionAddress": " ,,,DE,",
  "InversionTime": 0.9,
  "MRAcquisitionType": "3D",
  "MTState": false,
  "MagneticFieldStrength": 7,
  "Manufacturer": "Siemens",
  "ManufacturersModelName": "MAGNETOM Terra.X",
  "Modality": "MR",
  "NonlinearGradientCorrection": true,
  "PartialFourier": 1,
  "PatientPosition": "HFS",
  "PercentPhaseFOV": 100,
  "PercentSampling": 100,
  "PhaseResolution": 1,
  "PixelBandwidth": 250,
  "ProcedureStepDescription": "Klips highspeed",
  "ProtocolName": "t1_mp2rage_sag_0.6mm_TR4800_CS4",
  "PulseSequenceDetails": "%SiemensSeq%\\tfl",
  "PulseSequenceName": "*tfl3d1_232ns",
  "ReceiveCoilActiveElements": "AC",
  "ReceiveCoilName": "8Tx32Rx_Head_C",
  "ReconMatrixPE": 384,
  "RefLinesPE": 32,
  "RepetitionTime": 4.8,
  "ScanOptions": "IR",
  "ScanningSequence": "GR\\IR",
  "SequenceVariant": "SK\\SP\\MP",
  "SeriesDescription": "t1_mp2rage_sag_0.6mm_TR4800_CS4_INV1",
  "SeriesNumber": 15,
  "ShimSetting": [206, 656, 979, -51, -21, 142, 116, -84],
  "SliceThickness": 0.6,
  "SoftwareVersions": "syngo MR XA60",
  "StationName": "AWP237008",
  "TxRefAmp": 240.117
}
run014.json
{
  "AcquisitionDuration": 491.317,
  "AcquisitionMatrixPE": 384,
  "AcquisitionNumber": 1,
  "AcquisitionTime": "16:43:28.475000",
  "BaseResolution": 384,
  "BodyPartExamined": "BRAIN",
  "CoilCombinationMethod": "Adaptive Combine",
  "CoilString": "8Tx32Rx_Head_C",
  "ConversionSoftware": "dcm2niix",
  "ConversionSoftwareVersion": "v1.0.20220720",
  "DeviceSerialNumber": "237008",
  "DwellTime": 5.2e-06,
  "EchoTime": 0.00291,
  "FlipAngle": 3,
  "HeudiconvVersion": "1.1.6",
  "ImageComments": "Inv2 Image",
  "ImageOrientationPatientDICOM": [-0.0613295, 0.998118, -3.07892e-09, 0.0392841, 0.00241382, -0.999225],
  "ImageType": [
    "ORIGINAL",
    "PRIMARY"
],
  "ImageTypeText": [
    "ORIGINAL",
    "PRIMARY",
    "M",
    "DIS3D",
    "DIS2D"
],
  "ImagingFrequency": 297.194,
  "InPlanePhaseEncodingDirectionDICOM": "ROW",
  "InstitutionAddress": " ,,,DE,",
  "InversionTime": 2.75,
  "MRAcquisitionType": "3D",
  "MTState": false,
  "MagneticFieldStrength": 7,
  "Manufacturer": "Siemens",
  "ManufacturersModelName": "MAGNETOM Terra.X",
  "Modality": "MR",
  "NonlinearGradientCorrection": true,
  "PartialFourier": 1,
  "PatientPosition": "HFS",
  "PercentPhaseFOV": 100,
  "PercentSampling": 100,
  "PhaseResolution": 1,
  "PixelBandwidth": 250,
  "ProcedureStepDescription": "Klips highspeed",
  "ProtocolName": "t1_mp2rage_sag_0.6mm_TR4800_CS4",
  "PulseSequenceDetails": "%SiemensSeq%\\tfl",
  "PulseSequenceName": "*tfl3d1_232ns",
  "ReceiveCoilActiveElements": "AC",
  "ReceiveCoilName": "8Tx32Rx_Head_C",
  "ReconMatrixPE": 384,
  "RefLinesPE": 32,
  "RepetitionTime": 4.8,
  "ScanOptions": "IR",
  "ScanningSequence": "GR\\IR",
  "SequenceVariant": "SK\\SP\\MP",
  "SeriesDescription": "t1_mp2rage_sag_0.6mm_TR4800_CS4_INV2",
  "SeriesNumber": 16,
  "ShimSetting": [206, 656, 979, -51, -21, 142, 116, -84],
  "SliceThickness": 0.6,
  "SoftwareVersions": "syngo MR XA60",
  "StationName": "AWP237008",
  "TxRefAmp": 240.117
}
run015.json
{
  "AcquisitionMatrixPE": 384,
  "AcquisitionNumber": 1,
  "AcquisitionTime": "16:43:26.625000",
  "BaseResolution": 384,
  "BodyPartExamined": "BRAIN",
  "CoilCombinationMethod": "Adaptive Combine",
  "CoilString": "8Tx32Rx_Head_C",
  "ConversionSoftware": "dcm2niix",
  "ConversionSoftwareVersion": "v1.0.20220720",
  "DeviceSerialNumber": "237008",
  "DwellTime": 5.2e-06,
  "EchoTime": 0.00291,
  "HeudiconvVersion": "1.1.6",
  "ImageComments": "UNIFORM-weighted Image (lambda = 0.2)",
  "ImageOrientationPatientDICOM": [-0.0613295, 0.998118, -3.07892e-09, 0.0392841, 0.00241382, -0.999225],
  "ImageType": [
    "DERIVED",
    "PRIMARY",
    "T1",
    "UNIFORM"
],
  "ImageTypeText": [
    "DERIVED",
    "PRIMARY",
    "M",
    "UNI",
    "DIS3D",
    "DIS2D"
],
  "ImagingFrequency": 297.194,
  "InPlanePhaseEncodingDirectionDICOM": "ROW",
  "InstitutionAddress": " ,,,DE,",
  "MRAcquisitionType": "3D",
  "MTState": false,
  "MagneticFieldStrength": 7,
  "Manufacturer": "Siemens",
  "ManufacturersModelName": "MAGNETOM Terra.X",
  "Modality": "MR",
  "NonlinearGradientCorrection": true,
  "PartialFourier": 1,
  "PatientPosition": "HFS",
  "PercentPhaseFOV": 100,
  "PercentSampling": 100,
  "PhaseResolution": 1,
  "PixelBandwidth": 250,
  "ProcedureStepDescription": "Klips highspeed",
  "ProtocolName": "t1_mp2rage_sag_0.6mm_TR4800_CS4",
  "PulseSequenceDetails": "%SiemensSeq%\\tfl",
  "PulseSequenceName": "*tfl3d1_232ns",
  "RawImage": false,
  "ReceiveCoilActiveElements": "AC",
  "ReceiveCoilName": "8Tx32Rx_Head_C",
  "ReconMatrixPE": 384,
  "RefLinesPE": 32,
  "RepetitionTime": 4.8,
  "ScanOptions": "IR",
  "ScanningSequence": "GR\\IR",
  "SequenceVariant": "SK\\SP\\MP",
  "SeriesDescription": "t1_mp2rage_sag_0.6mm_TR4800_CS4_UNI-DEN",
  "SeriesNumber": 17,
  "ShimSetting": [206, 656, 979, -51, -21, 142, 116, -84],
  "SliceThickness": 0.6,
  "SoftwareVersions": "syngo MR XA60",
  "StationName": "AWP237008",
  "TxRefAmp": 240.117}

According to BIDS, there should be a part-mag and part-phase image .nii.gz for each inversion but it looks like I only have image per inversion (based on the .json files, it looks like I only have the part-mag (magnitude) images)? Or can this be split up further to obtain the part-mag and part-phase parts? Thanks!

I’ve never used MP2RAGE for Quantitative MRI, so can’t comment on the phase and magnitude images, but what you have looks like what I’m used to working with, which is simply INV1, INV2, and UNI images.

In your JSON files you have one set of images with "NonlinearGradientCorrection": false and one set with "NonlinearGradientCorrection": true, which explains the ND suffix in the associated series descriptions.
I don’t think dcm2bids has a way to put images in the derivatives directory, so you may have to move the UNI files yourself.

A config file similar to below may be a good start. I have NOT tested this, so definitely look out for errors:

{
	{
		"datatype": "anat",
		"suffix": "MP2RAGE",
		"custom_entities": "inv-1",
		"criteria": {
			"SeriesDescription": "t1_mp2rage_sag_0.6mm_TR4800_CS4_INV1"
		}
	},
	{
		"datatype": "anat",
		"suffix": "MP2RAGE",
		"custom_entities": "inv-2",
		"criteria": {
			"SeriesDescription": "t1_mp2rage_sag_0.6mm_TR4800_CS4_INV2"
		}
	},
	{
		"datatype": "anat",
		"suffix": "MP2RAGE",
		"custom_entities": "rec-uni",
		"criteria": {
			"SeriesDescription": "t1_mp2rage_sag_0.6mm_TR4800_CS4_UNI-DEN"
		}
	},
	{
		"datatype": "anat",
		"suffix": "MP2RAGE",
		"custom_entities": "acq-nd_inv-1",
		"criteria": {
			"SeriesDescription": "t1_mp2rage_sag_0.6mm_TR4800_CS4_INV1_ND"
		}
	},
	{
		"datatype": "anat",
		"suffix": "MP2RAGE",
		"custom_entities": "acq-nd_inv-2",
		"criteria": {
			"SeriesDescription": "t1_mp2rage_sag_0.6mm_TR4800_CS4_INV2_ND"
		}
	},
	{
		"datatype": "anat",
		"suffix": "MP2RAGE",
		"custom_entities": "acq-nd_rec-uni",
		"criteria": {
			"SeriesDescription": "t1_mp2rage_sag_0.6mm_TR4800_CS4_UNI-DEN_ND"
		}
	}
}
1 Like

Awesome, thank you so much @JarodRoland!

Since I’ve never worked with MP2RAGE / Quantitative MRI before, I was unsure what the BIDS output is expected to look like, so hearing that this is in line with what you are used to working with is reassuring.

I will set up my BIDS conversion as you suggested with the config file.

Thanks again!