Can I use dcm2bids On .nii Files?

Hello all,

I have some anatomical and functional .nii files for a couple subjects. I’d like to use dcm2bids on these files to BIDS format them while also creating JSON files to accompany the resulting .nii.gz files.

I’m having trouble finding an argument to allow me to input .nii files to dcm2bids. I wanted to ask folks if this is possible in the first place, and if so, how do I go about doing this?

With Thanks and Sincerely,
P. Reyes

In brief, you can’t. You need to have the original DICOMs to construct a BIDS sidecar. If you do not have the DICOMs, you could reconstruct the sidecar from the MRI sequence details.

The BIDS JSON sidecar was explicitly designed to store meta-data that is not available in the NIfTI .nii images. The NIfTI format is very simple and minimal. NIfTI was also designed before modern methods like multi-band and methods like TOPUP were developed. Therefore, the modern BIDS sidecar was created to store the meta-data required for modern image processing pipelines. In general, the data in the NIfTI image and the BIDS sidecar are designed to be mutually exclusive, to avoid issues of precedence if a conflict exists. For this reason, one can not construct a BIDS sidecar from a NIfTI image.

Typically, one uses a tool like dcm2niix to convert a DICOM series to a NIfTI image and a BIDS sidecar. This is often done by a tool that renames the output into a BIDS structure (e.g. heudiconv, dcm2bids). The DICOM format is very complex, and differs between manufacturers and across time (e.g. a Siemens enhanced DICOM is very different from a classic Siemens DICOM image).

Here is an example BIDS JSON:

	"Modality": "MR",
	"MagneticFieldStrength": 3,
	"ImagingFrequency": 127.698,
	"Manufacturer": "GE",
	"PulseSequenceName": "epiRT",
	"InternalPulseSequenceName": "EPI",
	"ManufacturersModelName": "SIGNA Architect",
	"InstitutionName": "rfsamay",
	"DeviceSerialNumber": "000000000RFSAMAY",
	"StationName": "123234",
	"BodyPartExamined": "BRAIN",
	"PatientPosition": "HFS",
	"SoftwareVersions": "28\\LX\\MR Software release:DV28.0_R02_1947.a",
	"MRAcquisitionType": "2D",
	"SeriesDescription": "epiRT IntAsc GD3s",
	"ProtocolName": "epiRT-GroupDelay",
	"ScanningSequence": "EP\\GR",
	"SequenceVariant": "SS",
	"ScanOptions": "SAT_GEMS\\EPI_GEMS\\ACC_GEMS\\FS",
	"ImageType": ["ORIGINAL", "PRIMARY", "EPI", "NONE"],
	"SeriesNumber": 2,
	"AcquisitionTime": "18:15:22.000000",
	"AcquisitionNumber": 1,
	"SliceThickness": 3,
	"SpacingBetweenSlices": 3,
	"SAR": 0.0501479,
	"EchoTime": 0.03,
	"RepetitionTime": 5,
	"FlipAngle": 80,
	"PhaseEncodingPolarityGE": "Flipped",
	"CoilString": "48HP",
	"PercentPhaseFOV": 100,
	"PercentSampling": 100,
	"AcquisitionMatrixPE": 64,
	"ReconMatrixPE": 64,
	"ParallelReductionFactorInPlane": 2,
	"EffectiveEchoSpacing": 0.000267683,
	"TotalReadoutTime": 0.016864,
	"PixelBandwidth": 7812.5,
	"PhaseEncodingDirection": "j",
	"SliceTiming": [
		1.9375	],
	"ImageOrientationPatientDICOM": [
		0	],
	"InPlanePhaseEncodingDirectionDICOM": "COL",
	"ConversionSoftware": "dcm2niix",
	"ConversionSoftwareVersion": "v1.0.20210308"