Dcm2bids problem

Dear BIDS users,
I am trying to use dcm2bids and after having created my config file like:

{
  "descriptions": [
    {
      "datatype": "anat",
      "suffix": "T2w",
      "criteria": {
        "SequenceName": "*spc_210"
      }
    },
    {
      "id": "id_task_P_MS",
      "datatype": "func",
      "suffix": "bold",
      "custom_entities": "task-MS",
      "criteria": {
        "SeriesDescription": "*_P_MS",
        "SequenceName": "*epfid2d1_76"
      }
    },
    { "id": "id_task_Active",
      "datatype": "func",
      "suffix": "bold",
      "custom_entities": "task-active",
      "criteria": {
        "SeriesDescription": "*_Active",
        "SequenceName": "*epfid2d1_76"
      }
    },
      {
      "id": "id_task_P_TLH",
      "datatype": "func",
      "suffix": "bold",
      "custom_entities": "task-TLH",
      "criteria": {
        "SeriesDescription": "*_P_TLH",
        "SequenceName": "*epfid2d1_76"
      }
    },
    {
      "datatype": "anat",
      "suffix": "T1w",
      "criteria": {
        "SequenceName": "*tfl3d1_16"
      }
    },
    {
      "datatype": "fmap",
      "suffix": "fmap",
      "custom_entities": "map-AP",
      "criteria": {
        "SequenceName": "*epse2d1_*",
        "PhaseEncodingDirection": "j"
      }
    },
    {
      "datatype": "fmap",
      "suffix": "fmap",
      "custom_entities": "map-PA",
      "criteria": {
        "SequenceName": "*epse2d1_*",
        "PhaseEncodingDirection": "j-"
      }
    }
  ]
}

everything seems to be fine but when I am looking for my fmap images with:

layout= BIDSLayout(bids_dir)
topup_dir = layout.get(return_type='filename', target='subject', suffix='fmap', extension='nii.gz')

I have nothing.

I had the same problem for T1 image and changing T1 for T1w did work.
I tried for the fmap images to use epi but it didn’t work either.
I can’t find the documentation to help me understand what’s going on and their is suprisingly no error message when it didn’t work
thank you for your help

Hi @Doughboys,

  1. What version of dcm2bids are you using? Can you also share your command?
  2. Can you return the output of tree run on your subject folder after running dcm2bids?
  3. Can you share relevant JSON files from the dcm2niix process that you are using to define your critera?
  4. Do you get any errors while running dcm2bids? Any informative log files?

Best,
Steven

Hi @Doughboys,

In addition to what @Steven suggested

"custom_entities": "map-PA" should be "custom_entities": "dir-PA"

map is not a correct label and it may explain why pybids doesn’t see these files.

Hope it helps,

Best,
Arnaud

Dear @abore and @Steven,

Thank you very much for your help

  1. What version of dcm2bids are you using? Can you also share your command?
|dcm2bids version:|3.1.1|
|Based on BIDS version:|v1.8.0|
  1. Can you return the output of tree run on your subject folder after running dcm2bids?
    Sorry, I am not sure what you mean here? I tried to find the command in the doc of pybids but I could’nt

  2. Can you share relevant JSON files from the dcm2niix process that you are using to define your critera?

{
    "Modality": "MR",
    "MagneticFieldStrength": 3,
    "ImagingFrequency": 123.263,
    "Manufacturer": "Siemens",
    "ManufacturersModelName": "Prisma",
    "BodyPartExamined": "BRAIN",
    "PatientPosition": "HFP",
    "ProcedureStepDescription": "PRIMATES^DYNT2M",
    "SoftwareVersions": "syngo MR E11",
    "MRAcquisitionType": "2D",
    "SeriesDescription": "se_epi_PA",
    "ProtocolName": "se_epi_PA",
    "ScanningSequence": "EP",
    "SequenceVariant": "SK",
    "ScanOptions": "FS",
    "SequenceName": "epse2d1_62",
    "ImageType": [
        "ORIGINAL",
        "PRIMARY",
        "M",
        "ND",
        "MOSAIC"
    ],
    "SeriesNumber": 7,
    "AcquisitionTime": "18:26:59.582500",
    "AcquisitionNumber": 1,
    "ImageComments": "Session:IRM_DYNT2M_PA09244_20230426_1830",
    "SliceThickness": 1.25,
    "SpacingBetweenSlices": 1.375,
    "SAR": 0.0370679,
    "EchoTime": 0.0638,
    "RepetitionTime": 3.43,
    "FlipAngle": 90,
    "PartialFourier": 1,
    "BaseResolution": 88,
    "ShimSetting": [
        -4617,
        -3674,
        4508,
        498,
        -533,
        -4178,
        -3,
        -526
    ],
    "TxRefAmp": 63.5939,
    "PhaseResolution": 1,
    "ReceiveCoilName": "8ChConnectorBox",
    "ReceiveCoilActiveElements": "RX1-8",
    "PulseSequenceDetails": "%CustomerSeq%\\cmrr_mbep2d_se",
    "WipMemBlock": "0afa0085-c433-4b23-95f7-6ce1c1e05452||Sequence: R016 ve11c/master r/e634e98; Dec 19 2017 11:22:56 by eja",
    "CoilCombinationMethod": "Sum of Squares",
    "ConsistencyInfo": "N4_VE11C_LATEST_20160120",
    "MatrixCoilMode": "SENSE",
    "PercentPhaseFOV": 70.4545,
    "PercentSampling": 100,
    "EchoTrainLength": 62,
    "PhaseEncodingSteps": 62,
    "AcquisitionMatrixPE": 62,
    "ReconMatrixPE": 62,
    "BandwidthPerPixelPhaseEncode": 17.343,
    "EffectiveEchoSpacing": 0.000930002,
    "DerivedVendorReportedEchoSpacing": 0.000930002,
    "TotalReadoutTime": 0.0567301,
    "PixelBandwidth": 1625,
    "DwellTime": 3.5e-06,
    "PhaseEncodingDirection": "j",
    "SliceTiming": [
        1.705,
        0,
        1.8125,
        0.1075,
        1.9175,
        0.2125,
        2.025,
        0.32,
        2.13,
        0.425,
        2.2375,
        0.5325,
        2.345,
        0.64,
        2.45,
        0.745,
        2.5575,
        0.8525,
        2.665,
        0.96,
        2.77,
        1.065,
        2.8775,
        1.1725,
        2.9825,
        1.2775,
        3.09,
        1.385,
        3.1975,
        1.4925,
        3.3025,
        1.5975
    ],
    "ImageOrientationPatientDICOM": [
        1,
        0,
        0,
        0,
        -0.0139622,
        -0.999903
    ],
    "ImageOrientationText": "Cor>Tra(0.8)",
    "InPlanePhaseEncodingDirectionDICOM": "COL",
    "ConversionSoftware": "dcm2niix",
    "ConversionSoftwareVersion": "v1.0.20220505",
    "Dcm2bidsVersion": "3.1.1"
}
  1. Do you get any errors while running dcm2bids? Any informative log files?
2023-11-29 11:05:49.452 - INFO     - dcm2niix_gen.execute | Check log file for dcm2niix output

2023-11-29 11:05:49.462 - INFO     - sidecar.build_acquisitions | SIDECAR PAIRING
2023-11-29 11:05:49.462 - INFO     - sidecar.build_acquisitions | No Pairing  <-  001_scans_LOCAHASTE_3_PLANS_15s_FOV154_20230426175533_cRX2_i00010
2023-11-29 11:05:49.462 - INFO     - sidecar.build_acquisitions | No Pairing  <-  001_scans_LOCAHASTE_3_PLANS_15s_FOV154_20230426175533_cRX4_i00006
2023-11-29 11:05:49.462 - INFO     - sidecar.build_acquisitions | No Pairing  <-  001_scans_LOCAHASTE_3_PLANS_15s_FOV154_20230426175533_cRX8_i00001
2023-11-29 11:05:49.462 - INFO     - sidecar.build_acquisitions | No Pairing  <-  002_scans_LOCAHASTE_3_PLANS_15s_FOV154_20230426175533_i00010
2023-11-29 11:05:49.462 - INFO     - sidecar.build_acquisitions | No Pairing  <-  002_scans_LOCAHASTE_3_PLANS_15s_FOV154_20230426175533_i00006
2023-11-29 11:05:49.462 - INFO     - sidecar.build_acquisitions | No Pairing  <-  002_scans_LOCAHASTE_3_PLANS_15s_FOV154_20230426175533_i00001
2023-11-29 11:05:49.462 - INFO     - sidecar.build_acquisitions | No Pairing  <-  003_scans_t1_starvibe_tra_0.9mm_20230426175533
2023-11-29 11:05:49.462 - INFO     - sidecar.build_acquisitions | No Pairing  <-  004_scans_EPFID_TR1700_TE18.4_32c_AP_QC_20230426175533
2023-11-29 11:05:49.462 - INFO     - sidecar.build_acquisitions | No Pairing  <-  005_scans_EPFID_TR1700_TE18.4_32c_PA_QC_20230426175533
2023-11-29 11:05:49.462 - INFO     - sidecar.build_acquisitions | sub-PA09244_ses-2_dir-PA_fmap  <-  006_scans_se_epi_AP_20230426175533
2023-11-29 11:05:49.463 - INFO     - sidecar.build_acquisitions | sub-PA09244_ses-2_dir-AP_fmap  <-  007_scans_se_epi_PA_20230426175533
2023-11-29 11:05:49.463 - INFO     - sidecar.build_acquisitions | sub-PA09244_ses-2_task-active_bold  <-  008_scans_RUN01_Active_20230426175533
2023-11-29 11:05:49.463 - INFO     - sidecar.build_acquisitions | sub-PA09244_ses-2_task-active_bold  <-  009_scans_RUN02_Active_20230426175533
2023-11-29 11:05:49.463 - INFO     - sidecar.build_acquisitions | No Pairing  <-  010_scans_LOCAHASTE_3_PLANS_15s_FOV154_20230426175533_cRX6_i00010
2023-11-29 11:05:49.463 - INFO     - sidecar.build_acquisitions | No Pairing  <-  010_scans_LOCAHASTE_3_PLANS_15s_FOV154_20230426175533_cRX1_i00006
2023-11-29 11:05:49.463 - INFO     - sidecar.build_acquisitions | No Pairing  <-  010_scans_LOCAHASTE_3_PLANS_15s_FOV154_20230426175533_cRX2_i00001
2023-11-29 11:05:49.463 - INFO     - sidecar.build_acquisitions | No Pairing  <-  011_scans_LOCAHASTE_3_PLANS_15s_FOV154_20230426175533_i00010
2023-11-29 11:05:49.463 - INFO     - sidecar.build_acquisitions | No Pairing  <-  011_scans_LOCAHASTE_3_PLANS_15s_FOV154_20230426175533_i00006
2023-11-29 11:05:49.463 - INFO     - sidecar.build_acquisitions | No Pairing  <-  011_scans_LOCAHASTE_3_PLANS_15s_FOV154_20230426175533_i00001
2023-11-29 11:05:49.463 - INFO     - sidecar.build_acquisitions | sub-PA09244_ses-2_task-active_bold  <-  012_scans_RUN03_Active_20230426175533
2023-11-29 11:05:49.463 - INFO     - sidecar.build_acquisitions | sub-PA09244_ses-2_task-active_bold  <-  013_scans_RUN04_Active_20230426175533
2023-11-29 11:05:49.463 - INFO     - sidecar.build_acquisitions | No Pairing  <-  014_scans_gre_field_mapping_20cpes_2.3mmiso_20230426175533_e1
2023-11-29 11:05:49.463 - INFO     - sidecar.build_acquisitions | No Pairing  <-  014_scans_gre_field_mapping_20cpes_2.3mmiso_20230426175533_e2
2023-11-29 11:05:49.463 - INFO     - sidecar.build_acquisitions | No Pairing  <-  015_scans_gre_field_mapping_20cpes_2.3mmiso_20230426175533_e2_ph
2023-11-29 11:05:49.464 - INFO     - sidecar.find_runs | sub-PA09244/ses-2/func/sub-PA09244_ses-2_task-active_bold has 4 runs
2023-11-29 11:05:49.464 - INFO     - sidecar.find_runs | Adding run information to the acquisition
2023-11-29 11:05:49.464 - INFO     - dcm2bids_gen.run | Moving acquisitions into BIDS folder "DynT2M_NHP/BIDS/sub-PA09244/ses-2".

2023-11-29 11:05:49.470 - INFO     - dcm2bids.main | Logs saved in DynT2M_NHP/BIDS/tmp_dcm2bids/log/sub-PA09244_ses-2_20231129-110327.log
2023-11-29 11:05:49.470 - INFO     - dcm2bids.main | --- dcm2bids end ---

No errors while running dcm2bids
I tried to change “custom_entities”: “map-PA” for “custom_entities”: “dir-PA” but it didn’t work.

The thing is that I didn’t managed to get any info in the doc:
https://unfmontreal.github.io/Dcm2Bids/docs/how-to/use-main-commands/
explaining why or the recommandation for using T1w instate of T1 for example.
I find it confusing that their is no error message or info in the log file. For example writting: “T1 does’nt fit the BIDS recommandations, so we ignor it” would be very useful.
But I am new in BIDS, so maybe I havn’t spotted to good documentation to correctly rename the files.

Thank you again!

Hi @Doughboys,

tree
Is a terminal command.

Also, for anything you want to post here that is code like (for example your json contents and output logs), please format them as code by surrounding them in tick marks

So it looks nice like this.

You can also use the </> button in the text editor to do this.

I reformatted your other post in this way.

Are you sure you shouldn’t be using the episuffix for your fmaps? It sounds like you are using a pair of spin echo reverse phase encoded acquisitions, which should use epi according to the BIDS documentation.

Thank you @Steven !!

The problem was the combination of “fmap” and “map-PA”,
replacing them with “dir-PA” and “epi” works.

Can you please indicate me where is the doc to find the good correspondances between the sequence and the way it should be lableled in BIDS?

Thank you again for solving this issu!!

Hi @Doughboys,

Great!

It is described in the BIDS specification here: Magnetic Resonance Imaging - Brain Imaging Data Structure v1.9.0

Best,
Steven