diff --git a/README.md b/README.md index 74baf8f..49b595d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,18 @@ # bids_conversion -Scripts to convert data from CCNA and CIMAQ using dcm2bids +Script to help convert dicom to bids from CCNA or CIMAQ using dcm2bids +Code originaly provided by Arnaud Boré +Modified by Pierre-Emmanuel Morin + +Requirements +* dcm2bids (https://github.com/UNFmontreal/Dcm2Bids) +* dcm2niix (https://github.com/rordenlab/dcm2niix) + +Run (two steps) +* python3 convert_bids_ccna_cimaq.py /input_directory /output_directory mode (ccna or cimaq) > file +* bash ./file + +Tips +* input_directory must contain the tarchive files (usually found in /data/$PROJECT/data/tarchive) +* the output directory will contain the untar tarchive files, the bids files (sub-PSCID/CandID) and a sub-folder containing the log and failed conversion +* tweaking of the config files will be required +* if you're splitting your input_directory into smaller ones, make sure all of a participant's files are grouped together. If not, you will have to reorganize the tree manually diff --git a/configs/config.json b/configs/config.json index 88e1a61..962db95 100644 --- a/configs/config.json +++ b/configs/config.json @@ -3,23 +3,23 @@ "lowerCase": "True", "descriptions": [ { - "dataType": "anat", - "modalityLabel": "T1w", + "datatype": "anat", + "suffix": "T1w", "criteria": { "SeriesDescription": "*T1*", "ProtocolName": "*T1*" } }, { - "dataType": "anat", - "modalityLabel": "T1w", + "datatype": "anat", + "suffix": "T1w", "criteria": { "ProtocolName": "MPRAGE*" } }, { - "dataType": "anat", - "modalityLabel": "FLAIR", + "datatype": "anat", + "suffix": "FLAIR", "criteria": { "SeriesDescription": "*FLAIR*" } diff --git a/configs/config_ge.json b/configs/config_ge.json index 63968a8..5f5c6ef 100644 --- a/configs/config_ge.json +++ b/configs/config_ge.json @@ -2,54 +2,56 @@ "lowerCase": "True", "descriptions": [ { - "dataType": "anat", - "modalityLabel": "T2star", + "datatype": "anat", + "suffix": "T2star", "criteria": { "SeriesDescription": "OAx_T2star_GRE" } }, { - "dataType": "anat", - "modalityLabel": "T2star", + "datatype": "anat", + "suffix": "T2star", "criteria": { "SeriesDescription": "T2_STAR*" } }, { - "dataType": "func", - "modalityLabel": "bold", - "customLabels": "task-rest", + "id": "task_rest", + "datatype": "func", + "suffix": "bold", + "custom_entities": "task-rest", "criteria": { "SeriesDescription": "*Connectivity*" } }, { - "dataType": "func", - "modalityLabel": "bold", - "customLabels": "task-rest", + "id": "task_rest", + "datatype": "func", + "suffix": "bold", + "custom_entities": "task-rest", "criteria": { "SeriesDescription": "*CONNECTIVITY*" } }, { - "dataType": "anat", - "modalityLabel": "T2", + "datatype": "anat", + "suffix": "T2", "criteria": { "SeriesDescription": "*PD*T2*", - "EchoNumber": 2 + "EchoNumber": 2 } }, { - "dataType": "anat", - "modalityLabel": "PD", + "datatype": "anat", + "suffix": "PD", "criteria": { "SeriesDescription": "*PD*T2*", - "EchoNumber": 1 + "EchoNumber": 1 } }, { - "dataType": "dwi", - "modalityLabel": "dwi", + "datatype": "dwi", + "suffix": "dwi", "criteria": { "SeriesDescription": "*DTI*" } diff --git a/configs/config_ge_ccna.json b/configs/config_ge_ccna.json index 863bcf7..e409404 100644 --- a/configs/config_ge_ccna.json +++ b/configs/config_ge_ccna.json @@ -2,60 +2,62 @@ "lowerCase": "True", "descriptions": [ { - "dataType": "anat", - "modalityLabel": "T2star", + "datatype": "anat", + "suffix": "T2star", "criteria": { "SeriesDescription": "OAx_T2star_GRE" } }, { - "dataType": "anat", - "modalityLabel": "T2star", + "datatype": "anat", + "suffix": "T2star", "criteria": { "SeriesDescription": "*T2_STAR*" } }, { - "dataType": "func", - "modalityLabel": "bold", - "customLabels": "task-rest", - "sidecarChanges": { - "TaskName": "rest" - }, + "id": "task_rest", + "datatype": "func", + "suffix": "bold", + "custom_entities": "task-rest", "criteria": { "SeriesDescription": "*Connectivity*" + }, + "sidecar_changes": { + "TaskName": "rest" } }, { - "dataType": "func", - "modalityLabel": "bold", - "customLabels": "task-rest", - "sidecarChanges": { - "TaskName": "rest" - }, + "id": "task_rest", + "datatype": "func", + "suffix": "bold", + "custom_entities": "task-rest", "criteria": { "SeriesDescription": "*CONNECTIVITY*" + }, + "sidecar_changes": { + "TaskName": "rest" } }, { - "dataType": "anat", - "modalityLabel": "T2w", + "datatype": "anat", + "suffix": "T2w", "criteria": { "SeriesDescription": "*PD*T2*", - "EchoNumber": 2 + "EchoNumber": 2 } }, { - "dataType": "anat", - "modalityLabel": "PD", + "datatype": "anat", + "suffix": "PD", "criteria": { "SeriesDescription": "*PD*T2*", - "EchoNumber": 1 + "EchoNumber": 1 } }, { - "dataType": "dwi", - "modalityLabel": "dwi", + "datatype": "dwi", + "suffix": "dwi", "criteria": { "SeriesDescription": "*DTI*" } diff --git a/configs/config_ge_cimaq.json b/configs/config_ge_cimaq.json index 3b13380..061dc3a 100644 --- a/configs/config_ge_cimaq.json +++ b/configs/config_ge_cimaq.json @@ -1,70 +1,70 @@ { "descriptions": [ { - "dataType": "anat", - "modalityLabel": "T2star", + "datatype": "anat", + "suffix": "T2star", "criteria": { "SeriesDescription": "OAx_T2star_GRE" } }, { - "dataType": "anat", - "modalityLabel": "T2star", + "datatype": "anat", + "suffix": "T2star", "criteria": { "SeriesDescription": "T2_STAR-RPT" } }, { - "dataType": "func", - "modalityLabel": "bold", - "customLabels": "task-rest", + "datatype": "func", + "suffix": "bold", + "custom_entities": "task-rest", "criteria": { "SeriesDescription": "*Connectivity*" } }, { - "dataType": "func", - "modalityLabel": "bold", - "customLabels": "task-rest", + "datatype": "func", + "suffix": "bold", + "custom_entities": "task-rest", "criteria": { "SeriesDescription": "*CONNECTIVITY*" } }, { - "dataType": "anat", - "modalityLabel": "T2", + "datatype": "anat", + "suffix": "T2", "criteria": { "SeriesDescription": "*PD*T2*", - "EchoTime": 0.089792 + "EchoTime": 0.089792 } }, { - "dataType": "anat", - "modalityLabel": "T2", + "datatype": "anat", + "suffix": "T2", "criteria": { "SeriesDescription": "*PD*T2*", - "EchoTime": 0.086328 + "EchoTime": 0.086328 } }, { - "dataType": "anat", - "modalityLabel": "PD", + "datatype": "anat", + "suffix": "PD", "criteria": { "SeriesDescription": "*PD*T2*", - "EchoTime": 0.011224 + "EchoTime": 0.011224 } }, { - "dataType": "anat", - "modalityLabel": "PD", + "datatype": "anat", + "suffix": "PD", "criteria": { "SeriesDescription": "*PD*T2*", - "EchoTime": 0.009592 + "EchoTime": 0.009592 } }, { - "dataType": "dwi", - "modalityLabel": "dwi", + "datatype": "dwi", + "suffix": "dwi", "criteria": { "SeriesDescription": "*DTI*" } diff --git a/configs/config_lower.json b/configs/config_lower.json index a052f5d..fbbb7ca 100644 --- a/configs/config_lower.json +++ b/configs/config_lower.json @@ -3,11 +3,11 @@ "lowerCase": "True", "descriptions": [ { - "dataType": "anat", - "modalityLabel": "T2star", + "datatype": "anat", + "suffix": "T2star", "criteria": { "SeriesDescription": "*T2*STAR*", - "ImageType": ["M"] + "ImageType": ["M"] } } ] diff --git a/configs/config_philips_ccna.json b/configs/config_philips_ccna.json index a945dce..d492e37 100644 --- a/configs/config_philips_ccna.json +++ b/configs/config_philips_ccna.json @@ -3,129 +3,132 @@ "caseSensitive": false, "descriptions": [ { - "dataType": "anat", - "modalityLabel": "T2star", + "datatype": "anat", + "suffix": "T2star", "criteria": { "SeriesDescription": "T2_STAR" } }, { - "dataType": "anat", - "modalityLabel": "T2star", + "datatype": "anat", + "suffix": "T2star", "criteria": { "SeriesDescription": "T2_FFE*" } }, { - "dataType": "anat", - "modalityLabel": "T2w", + "datatype": "anat", + "suffix": "T2w", "criteria": { "SeriesDescription": "DUAL_*", "EchoTime": 0.1 } }, { - "dataType": "anat", - "modalityLabel": "PD", + "datatype": "anat", + "suffix": "PD", "criteria": { "SeriesDescription": "DUAL_*", "EchoTime": 0.0125 } }, { - "dataType": "anat", - "modalityLabel": "T2w", + "datatype": "anat", + "suffix": "T2w", "criteria": { "SeriesDescription": "*PD_T2*", "EchoTime": 0.1 } }, { - "dataType": "anat", - "modalityLabel": "PD", + "datatype": "anat", + "suffix": "PD", "criteria": { "SeriesDescription": "*PD_T2*", "EchoTime": 0.0125 } }, { - "dataType": "func", - "modalityLabel": "bold", - "customLabels": "task-rest", - "sidecarChanges": { - "TaskName": "rest" - }, + "id": "task_rest", + "datatype": "func", + "suffix": "bold", + "custom_entities": "task-rest", "criteria": { "SeriesDescription": "*fMRI" - } + }, + "sidecar_changes": { + "TaskName": "rest" + }, }, { - "dataType": "dwi", - "modalityLabel": "dwi", + "datatype": "dwi", + "suffix": "dwi", "criteria": { "SeriesDescription": "DTI_32_iso" }, - "sidecarChanges": { - "PhaseEncodingDirection": "j-" + "sidecar_changes": { + "PhaseEncodingDirection": "j-" } }, { - "dataType": "fmap", - "modalityLabel": "epi", + "datatype": "fmap", + "suffix": "epi", "criteria": { "SeriesDescription": "DTI_b0_AP" }, - "intendedFor": 7, - "sidecarChanges": { - "PhaseEncodingDirection": "j", - "TotalReadoutTime": 0.062 + "sidecar_changes": { + "PhaseEncodingDirection": "j", + "TotalReadoutTime": 0.062, + "IntendedFor": "dwi" } }, { - "dataType": "dwi", - "modalityLabel": "dwi", + "id": "dwi", + "datatype": "dwi", + "suffix": "dwi", "criteria": { "SeriesDescription": "DTI_32" }, - "sidecarChanges": { - "PhaseEncodingDirection": "j-" + "sidecar_changes": { + "PhaseEncodingDirection": "j-" } }, { - "dataType": "dwi", - "modalityLabel": "dwi", + "id": "dwi", + "datatype": "dwi", + "suffix": "dwi", "criteria": { "SeriesDescription": "DTI" }, - "sidecarChanges": { - "PhaseEncodingDirection": "j" + "sidecar_changes": { + "PhaseEncodingDirection": "j" } }, { - "dataType": "fmap", - "modalityLabel": "epi", + "datatype": "fmap", + "suffix": "epi", "criteria": { "SeriesDescription": "DTI_b0", "InstitutionName": "UBC" }, - "sidecarChanges": { - "PhaseEncodingDirection": "j-", - "TotalReadoutTime": 0.062 + "sidecar_changes": { + "PhaseEncodingDirection": "j-", + "TotalReadoutTime": 0.062, + "IntendedFor": "dwi" }, - "intendedFor": 9 }, { - "dataType": "fmap", - "modalityLabel": "epi", + "datatype": "fmap", + "suffix": "epi", "criteria": { "SeriesDescription": "DTI_b0", "InstitutionName": "UBC_MRI_Research_Centre" }, - "sidecarChanges": { - "PhaseEncodingDirection": "j", - "TotalReadoutTime": 0.062 + "sidecar_changes": { + "PhaseEncodingDirection": "j", + "TotalReadoutTime": 0.062, + "IntendedFor": "dwi" }, - "intendedFor": 10 } ] } diff --git a/configs/config_philips_cimaq.json b/configs/config_philips_cimaq.json index 99fab9b..6c5d9e4 100644 --- a/configs/config_philips_cimaq.json +++ b/configs/config_philips_cimaq.json @@ -2,141 +2,191 @@ "lowerCase": "True", "descriptions": [ { - "dataType": "anat", - "modalityLabel": "T2star", + "datatype": "anat", + "suffix": "T1w", + "criteria": { + "SeriesDescription": "T1*", + "ProtocolName": "T1*" + } + }, + { + "datatype": "anat", + "suffix": "T1w", + "criteria": { + "ProtocolName": "3D*MPR*" + } + }, + { + "datatype": "anat", + "suffix": "T2star", "criteria": { "SeriesDescription": "T2_STAR" } }, { - "dataType": "anat", - "modalityLabel": "T2star", + "datatype": "anat", + "suffix": "T2star", "criteria": { "SeriesDescription": "*T2_FFE*" } }, { - "dataType": "anat", - "modalityLabel": "T2w", + "datatype": "anat", + "suffix": "T2w", "criteria": { "SeriesDescription": "DUAL_*", "EchoTime": 0.1 } }, { - "dataType": "anat", - "modalityLabel": "PD", + "datatype": "anat", + "suffix": "PD", "criteria": { "SeriesDescription": "DUAL_*", "EchoTime": 0.0125 } }, { - "dataType": "anat", - "modalityLabel": "T2w", + "datatype": "anat", + "suffix": "T2w", "criteria": { "SeriesDescription": "*PD_T2*", "EchoTime": 0.1 } }, { - "dataType": "anat", - "modalityLabel": "PD", + "datatype": "anat", + "suffix": "PD", "criteria": { "SeriesDescription": "*PD_T2*", "EchoTime": 0.0125 } }, { - "dataType": "func", - "modalityLabel": "bold", - "customLabels": "task-rest", + "datatype": "anat", + "suffix": "FLAIR", + "criteria": { + "SeriesDescription": "*FLAIR*" + } + }, + { + "id": "task_rest", + "datatype": "func", + "suffix": "bold", + "custom_entities": "task-rest", "criteria": { "SeriesDescription": "*fMRI" }, - "sidecarChanges": { + "sidecar_changes": { "TaskName": "rest", "TotalReadoutTime": 1 } }, { - "dataType": "func", - "modalityLabel": "bold", - "customLabels": "task-memory", + "id": "task_memory", + "datatype": "func", + "suffix": "bold", + "custom_entities": "task-memory", "criteria": { "SeriesDescription": "*MemoryTask" }, - "sidecarChanges": { + "sidecar_changes": { "TaskName": "memory", "TotalReadoutTime": 1 } }, { - "dataType": "fmap", - "modalityLabel": "epi", - "intendedFor": 7, + "datatype": "fmap", + "suffix": "epi", "criteria": { "SeriesDescription": "fMRI*MemoryTask_*PA*" }, - "sidecarChanges": { + "sidecar_changes": { "PhaseEncodingDirection": "j", - "TotalReadoutTime": 1 + "TotalReadoutTime": 1, + "IntendedFor": "task_memory" } }, { - "dataType": "dwi", - "modalityLabel": "dwi", + "datatype": "dwi", + "suffix": "dwi", "criteria": { "SeriesDescription": "DTI_32*" }, - "sidecarChanges": { + "sidecar_changes": { "PhaseEncodingDirection": "j-", "TotalReadoutTime": 1 } }, { - "dataType": "fmap", - "modalityLabel": "epi", - "intendedFor": 9, + "datatype": "fmap", + "suffix": "epi", "criteria": { "SeriesDescription": "*b0*_AP*" }, - "sidecarChanges": { + "sidecar_changes": { "PhaseEncodingDirection": "j-", - "TotalReadoutTime": 1 + "TotalReadoutTime": 1, + "IntendedFor": "task_memory" } }, { - "dataType": "fmap", - "modalityLabel": "epi", - "intendedFor": 7, + "datatype": "fmap", + "suffix": "epi", "criteria": { "SeriesDescription": "fMRI*MemoryTask_*AP*" }, - "sidecarChanges": { + "sidecar_changes": { "PhaseEncodingDirection": "j-", - "TotalReadoutTime": 1 + "TotalReadoutTime": 1, + "IntendedFor": "task_memory" } }, { - "dataType": "fmap", - "modalityLabel": "fieldmap", - "intendedFor": 7, + "datatype": "fmap", + "suffix": "fieldmap", "criteria": { "SeriesDescription": "B0_map", - "ImageType": ["ORIGINAL", "PRIMARY", "B0", "MAP", "B0", "UNSPECIFIED"] + "ImageType": ["ORIGINAL", "PRIMARY", "B0", "MAP", "B0", "UNSPECIFIED"] + }, + "sidecar_changes": { + "Units": "Hz", + "IntendedFor": "task_rest" + } + }, + { + "datatype": "fmap", + "suffix": "fieldmap", + "criteria": { + "SeriesDescription": "B0 map", + "ImageType": ["ORIGINAL", "PRIMARY", "B0 MAP", "B0", "UNSPECIFIED", "FIELDMAPHZ"] }, - "sidecarChanges": { - "Units": "Hz" + "sidecar_changes": { + "Units": "Hz", + "IntendedFor": "task_rest" } }, { - "dataType": "fmap", - "modalityLabel": "magnitude", - "intendedFor": 7, + "datatype": "fmap", + "suffix": "fieldmap", + "criteria": { + "SeriesDescription": "B0 map", + "ImageType": ["ORIGINAL", "PRIMARY", "M", "FFE", "M", "FFE"] + }, + "sidecar_changes": { + "Units": "Hz", + "IntendedFor": "task_rest" + } + }, + { + "datatype": "fmap", + "suffix": "magnitude", "criteria": { "SeriesDescription": "B0_map", "ImageType": ["ORIGINAL", "PRIMARY", "M", "FFE", "M", "FFE"] + }, + "sidecar_changes": { + "IntendedFor": "task_rest" } } ] diff --git a/configs/config_philips_cimaq_qc.json b/configs/config_philips_cimaq_qc.json index 8a424eb..6610b46 100644 --- a/configs/config_philips_cimaq_qc.json +++ b/configs/config_philips_cimaq_qc.json @@ -2,118 +2,131 @@ "lowerCase": "True", "descriptions": [ { - "dataType": "anat", - "modalityLabel": "T2star", + "datatype": "anat", + "suffix": "T1w", + "criteria": { + "SeriesDescription": "T1*", + "ProtocolName": "T1*" + } + }, + { + "datatype": "anat", + "suffix": "T2star", "criteria": { "SeriesDescription": "T2_FFE*" } }, { - "dataType": "anat", - "modalityLabel": "T2w", + "datatype": "anat", + "suffix": "T2w", "criteria": { "SeriesDescription": "DUAL_*", "EchoTime": 0.1 } }, { - "dataType": "anat", - "modalityLabel": "PD", + "datatype": "anat", + "suffix": "PD", "criteria": { "SeriesDescription": "DUAL_*", "EchoTime": 0.0125 } }, { - "dataType": "func", - "modalityLabel": "bold", - "customLabels": "task-rest", + "id": "task_rest", + "datatype": "func", + "suffix": "bold", + "custom_entities": "task-rest", "criteria": { "SeriesDescription": "*fMRI" }, - "sidecarChanges": { + "sidecar_changes": { "TaskName": "rest", "TotalReadoutTime": 1 } }, { - "dataType": "func", - "modalityLabel": "bold", - "customLabels": "task-memory", + "id": "task_memory", + "datatype": "func", + "suffix": "bold", + "custom_entities": "task-memory", "criteria": { "SeriesDescription": "*MemoryTask" }, - "sidecarChanges": { + "sidecar_changes": { "TaskName": "memory", "TotalReadoutTime": 1 } }, { - "dataType": "fmap", - "modalityLabel": "epi", - "intendedFor": 4, + "datatype": "fmap", + "suffix": "epi", "criteria": { "SeriesDescription": "fMRI*MemoryTask_*PA*" }, - "sidecarChanges": { + "sidecar_changes": { "PhaseEncodingDirection": "j", - "TotalReadoutTime": 1 + "TotalReadoutTime": 1, + "IntendedFor": "task_rest" } }, { - "dataType": "dwi", - "modalityLabel": "dwi", + "datatype": "dwi", + "suffix": "dwi", "criteria": { "SeriesDescription": "DTI_32*" }, - "sidecarChanges": { + "sidecar_changes": { "PhaseEncodingDirection": "j-", "TotalReadoutTime": 1 } }, { - "dataType": "fmap", - "modalityLabel": "epi", - "intendedFor": 6, + "datatype": "fmap", + "suffix": "epi", "criteria": { "SeriesDescription": "*b0*AP*" }, - "sidecarChanges": { + "sidecar_changes": { "PhaseEncodingDirection": "j-", - "TotalReadoutTime": 1 + "TotalReadoutTime": 1, + "IntendedFor": "task_memory" } }, { - "dataType": "fmap", - "modalityLabel": "epi", - "intendedFor": 4, + "datatype": "fmap", + "suffix": "epi", "criteria": { "SeriesDescription": "fMRI*MemoryTask_*AP*" }, - "sidecarChanges": { + "sidecar_changes": { "PhaseEncodingDirection": "j-", - "TotalReadoutTime": 1 + "TotalReadoutTime": 1, + "IntendedFor": "task_rest" } }, { - "dataType": "fmap", - "modalityLabel": "fieldmap", - "intendedFor": 4, + "datatype": "fmap", + "suffix": "fieldmap", "criteria": { "SeriesDescription": "B0_map", "ImageType": ["ORIGINAL", "PRIMARY", "B0", "MAP", "B0", "UNSPECIFIED"] }, - "sidecarChanges": { - "Units": "Hz" + "sidecar_changes": { + "Units": "Hz", + "IntendedFor": "task_rest" } }, { - "dataType": "fmap", - "modalityLabel": "magnitude", - "intendedFor": 4, + "datatype": "fmap", + "suffix": "magnitude", "criteria": { "SeriesDescription": "B0_map", "ImageType": ["ORIGINAL", "PRIMARY", "M", "FFE", "M", "FFE"] + }, + "sidecar_changes": { + "Units": "Hz", + "IntendedFor": "task_rest" } } ] diff --git a/configs/config_siemens_ccna.json b/configs/config_siemens_ccna.json index 232daae..56498ee 100644 --- a/configs/config_siemens_ccna.json +++ b/configs/config_siemens_ccna.json @@ -2,123 +2,132 @@ "caseSensitive": false, "descriptions": [ { - "dataType": "anat", - "modalityLabel": "T2star", - "customLabels": "part-mag", + "datatype": "anat", + "suffix": "T2star", + "custom_entities": "part-mag", "criteria": { "SeriesDescription": "T2*star*", "ImageType": ["M"] } }, { - "dataType": "anat", - "modalityLabel": "T2star", - "customLabels": "part-phase", + "datatype": "anat", + "suffix": "T2star", + "custom_entities": "part-phase", "criteria": { "SeriesDescription": "T2*star*", "ImageType": ["P"] } }, { - "dataType": "func", - "modalityLabel": "bold", - "customLabels": "task-rest", - "sidecarChanges": { - "TaskName": "rest" - }, + "id": "taks_rest", + "datatype": "func", + "suffix": "bold", + "custom_entities": "task-rest", "criteria": { "SeriesDescription": "*Connectivity*" + }, + "sidecar_changes": { + "TaskName": "rest" } }, { - "dataType": "func", - "modalityLabel": "bold", - "customLabels": "task-rest", - "sidecarChanges": { - "TaskName": "rest" - }, + "id": "taks_rest", + "datatype": "func", + "suffix": "bold", + "custom_entities": "task-rest", "criteria": { "SeriesDescription": "*R*S*fMRI*" + }, + "sidecar_changes": { + "TaskName": "rest" } }, { - "dataType": "anat", - "modalityLabel": "T2w", + "datatype": "anat", + "suffix": "T2w", "criteria": { "SeriesDescription": "*PD*T2*", - "EchoTime": 0.091 + "EchoTime": 0.091 } }, { - "dataType": "anat", - "modalityLabel": "T2w", + "datatype": "anat", + "suffix": "T2w", "criteria": { "SeriesDescription": "*PD*T2*", - "EchoTime": 0.093 + "EchoTime": 0.093 } }, { - "dataType": "anat", - "modalityLabel": "PD", + "datatype": "anat", + "suffix": "PD", "criteria": { "SeriesDescription": "*PD*T2*", - "EchoTime": 0.01 + "EchoTime": 0.01 } }, { - "dataType": "dwi", - "modalityLabel": "dwi", + "datatype": "dwi", + "suffix": "dwi", "criteria": { "SeriesDescription": "DTI-EDM" } }, { - "dataType": "dwi", - "modalityLabel": "dwi", + "id": "dwi", + "datatype": "dwi", + "suffix": "dwi", "criteria": { "SeriesDescription": "DTI" } }, { - "dataType": "fmap", - "modalityLabel": "epi", + "datatype": "fmap", + "suffix": "epi", "criteria": { "SeriesDescription": "D*0*" }, - "intendedFor": [7, 8] + "sidecar_changes": { + "IntendedFor": "dwi" + } }, { - "dataType": "fmap", - "modalityLabel": "magnitude1", - "intendedFor": [2, 3], + "datatype": "fmap", + "suffix": "magnitude1", "criteria": { "SeriesDescription": "*gre_field_mapping*", - "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], - "EchoTime": 0.00492 + "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], + "EchoTime": 0.00492 + }, + "sidecar_changes": { + "IntendedFor": "taks_rest" } }, { - "dataType": "fmap", - "modalityLabel": "magnitude2", - "intendedFor": [2, 3], + "datatype": "fmap", + "suffix": "magnitude2", "criteria": { "SeriesDescription": "*gre_field_mapping*", - "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], - "EchoTime": 0.00738 + "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], + "EchoTime": 0.00738 + }, + "sidecar_changes": { + "IntendedFor": "taks_rest" } }, { - "dataType": "fmap", - "modalityLabel": "phasediff", - "intendedFor": [2, 3], + "datatype": "fmap", + "suffix": "phasediff", "criteria": { "SeriesDescription": "*gre_field_mapping*", - "ImageType": ["ORIGINAL", "PRIMARY", "P", "ND"], - "EchoTime": 0.00738 + "ImageType": ["ORIGINAL", "PRIMARY", "P", "ND"], + "EchoTime": 0.00738 }, - "sidecarChanges": { - "EchoTime1": 0.00492, - "EchoTime2": 0.00738 + "sidecar_changes": { + "EchoTime1": 0.00492, + "EchoTime2": 0.00738, + "IntendedFor": "taks_rest" } } ] diff --git a/configs/config_siemens_ccna_lower.json b/configs/config_siemens_ccna_lower.json index 467e734..68d2087 100644 --- a/configs/config_siemens_ccna_lower.json +++ b/configs/config_siemens_ccna_lower.json @@ -2,12 +2,11 @@ "caseSensitive": false, "descriptions": [ { - "dataType": "anat", - "modalityLabel": "T2star", + "datatype": "anat", + "suffix": "T2star", "criteria": { "SeriesDescription": "T2*STAR", "ImageType": ["M"] - } } ] diff --git a/configs/config_siemens_cimaq.json b/configs/config_siemens_cimaq.json index 3f78e0d..63329be 100644 --- a/configs/config_siemens_cimaq.json +++ b/configs/config_siemens_cimaq.json @@ -2,197 +2,233 @@ "lowerCase": "True", "descriptions": [ { - "dataType": "anat", - "modalityLabel": "T2star", + "datatype": "anat", + "suffix": "T2star", "criteria": { "SeriesDescription": "T2*star*", - "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"] + "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"] } }, { - "dataType": "anat", - "modalityLabel": "T2star", + "datatype": "anat", + "suffix": "T2star", "criteria": { "SeriesDescription": "*T2*STAR*", - "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"] + "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"] } }, { - "dataType": "anat", - "modalityLabel": "T2star", + "datatype": "anat", + "suffix": "T2star", "criteria": { "SeriesDescription": "*T2*STAR*", - "ImageType": ["ORIGINAL", "PRIMARY", "M", "NORM", "DIS2D"] + "ImageType": ["ORIGINAL", "PRIMARY", "M", "NORM", "DIS2D"] } }, { - "dataType": "func", - "modalityLabel": "bold", - "customLabels": "task-rest", + "id": "task_memory", + "datatype": "func", + "suffix": "bold", + "custom_entities": "task-rest", "criteria": { "SeriesDescription": "*Connectivity*", "TaskName": "rest" } }, { - "dataType": "func", - "modalityLabel": "bold", - "customLabels": "task-rest", + "datatype": "func", + "suffix": "bold", + "custom_entities": "task-rest", "criteria": { "SeriesDescription": "*R*fMRI*", "TaskName": "rest" } }, { - "dataType": "func", - "modalityLabel": "bold", - "customLabels": "task-rest", + "datatype": "func", + "suffix": "bold", + "custom_entities": "task-rest", "criteria": { "SeriesDescription": "*Resting*State*", "TaskName": "rest" } }, { - "dataType": "fmap", - "modalityLabel": "magnitude1", - "intendedFor": 5, + "datatype": "fmap", + "suffix": "magnitude1", "criteria": { "SeriesDescription": "gre_field_mapping", - "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], - "EchoTime": 0.00492 + "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], + "EchoTime": 0.00492 + }, + "sidecar_changes": { + "IntendedFor": "task_memory" } }, { - "dataType": "fmap", - "modalityLabel": "magnitude2", - "intendedFor": 5, + "datatype": "fmap", + "suffix": "magnitude2", "criteria": { "SeriesDescription": "gre_field_mapping", "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], "EchoTime": 0.00738 } + "sidecar_changes": { + "IntendedFor": "task_memory" + } }, { - "dataType": "fmap", - "modalityLabel": "phasediff", - "intendedFor": 5, + "datatype": "fmap", + "suffix": "phasediff", "criteria": { "SeriesDescription": "gre_field_mapping", "ImageType": ["ORIGINAL", "PRIMARY", "P", "ND"] + }, + "sidecar_changes": { + "IntendedFor": "task_memory" } }, { - "dataType": "fmap", - "modalityLabel": "phasediff", - "intendedFor": 5, + "datatype": "fmap", + "suffix": "phasediff", "criteria": { "SeriesDescription": "BOLD_RS_fieldmap_gre_field_mapping", "ImageType": ["ORIGINAL", "PRIMARY", "P", "ND"] + }, + "sidecar_changes": { + "IntendedFor": "task_memory" } }, { - "dataType": "fmap", - "modalityLabel": "magnitude1", - "intendedFor": 5, + "datatype": "fmap", + "suffix": "magnitude1", "criteria": { "SeriesDescription": "BOLD_RS_fieldmap_gre_field_mapping", "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], "EchoTime": 0.00492 + }, + "sidecar_changes": { + "IntendedFor": "task_memory" } }, { - "dataType": "fmap", - "modalityLabel": "magnitude2", - "intendedFor": 5, + "datatype": "fmap", + "suffix": "magnitude2", "criteria": { "SeriesDescription": "BOLD_RS_fieldmap_gre_field_mapping", "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], "EchoTime": 0.00738 + }, + "sidecar_changes": { + "IntendedFor": "task_memory" } }, { - "dataType": "func", - "modalityLabel": "bold", - "customLabels": "task-memory", + "id": "task_memory", + "datatype": "func", + "suffix": "bold", + "custom_entities": "task-memory", "criteria": { "SeriesDescription": "*MemoryTask", "TaskName": "memory" } }, { - "dataType": "fmap", - "modalityLabel": "epi", - "intendedFor": 12, + "datatype": "fmap", + "suffix": "epi", "criteria": { "SeriesDescription": "fmri*MemoryTask_*" + }, + "sidecar_changes": { + "IntendedFor": "task_memory" } }, { - "dataType": "fmap", - "modalityLabel": "magnitude1", - "intendedFor": 12, + "datatype": "fmap", + "suffix": "magnitude1", "criteria": { "SeriesDescription": "fmri_fieldmap_gre_field_mapping", "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], "EchoTime": 0.00492 + }, + "sidecar_changes": { + "IntendedFor": "task_memory" } }, { - "dataType": "fmap", - "modalityLabel": "magnitude2", - "intendedFor": 12, + "datatype": "fmap", + "suffix": "magnitude2", "criteria": { "SeriesDescription": "fmri_fieldmap_gre_field_mapping", "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], "EchoTime": 0.00738 + }, + "sidecar_changes": { + "IntendedFor": "task_memory" } }, { - "dataType": "fmap", - "modalityLabel": "phasediff", - "intendedFor": 12, + "datatype": "fmap", + "suffix": "phasediff", "criteria": { "SeriesDescription": "fmri_fieldmap_gre_field_mapping", "ImageType": ["ORIGINAL", "PRIMARY", "P", "ND"] + }, + "sidecar_changes": { + "IntendedFor": "task_memory" + } + }, + { + "datatype": "fmap", + "suffix": "phasediff", + "criteria": { + "SeriesDescription": "fmri_fieldmap_gre_field_mapping", + "ImageType": ["ORIGINAL", "PRIMARY", "P", "ND", "PHASE"] + }, + "sidecar_changes": { + "IntendedFor": "task_memory" } }, { - "dataType": "anat", - "modalityLabel": "T2w", + "datatype": "anat", + "suffix": "T2w", "criteria": { "SeriesDescription": "*PD*T2*", - "EchoTime": 0.091 + "EchoTime": 0.091 } }, { - "dataType": "anat", - "modalityLabel": "T2w", + "datatype": "anat", + "suffix": "T2w", "criteria": { "SeriesDescription": "*PD*T2*", - "EchoTime": 0.093 + "EchoTime": 0.093 } }, { - "dataType": "anat", - "modalityLabel": "PD", + "datatype": "anat", + "suffix": "PD", "criteria": { "SeriesDescription": "*PD*T2*", - "EchoTime": 0.01 + "EchoTime": 0.01 } }, { - "dataType": "dwi", - "modalityLabel": "dwi", + "id": "dwi", + "datatype": "dwi", + "suffix": "dwi", "criteria": { "SeriesDescription": "DWI" } }, { - "dataType": "fmap", - "modalityLabel": "epi", - "intendedFor": 20, + "datatype": "fmap", + "suffix": "epi", "criteria": { "SeriesDescription": "D*0*" + }, + "sidecar_changes": { + "IntendedFor": "dwi" } } ] diff --git a/configs/config_siemens_cimaq_hospital_douglas.json b/configs/config_siemens_cimaq_hospital_douglas.json index a1015b2..4a2bb30 100644 --- a/configs/config_siemens_cimaq_hospital_douglas.json +++ b/configs/config_siemens_cimaq_hospital_douglas.json @@ -2,140 +2,157 @@ "lowerCase": "True", "descriptions": [ { - "dataType": "anat", - "modalityLabel": "T2star", + "datatype": "anat", + "suffix": "T2star", "criteria": { "SeriesDescription": "*T2*STAR*", - "ImageType": ["ORIGINAL", "PRIMARY", "M", "NORM", "DIS2D"] + "ImageType": ["ORIGINAL", "PRIMARY", "M", "NORM", "DIS2D"] } }, { - "dataType": "func", - "modalityLabel": "bold", - "customLabels": "task-rest", + "id": "task_rest", + "datatype": "func", + "suffix": "bold", + "custom_entities": "task-rest", "criteria": { "ProtocolName": "Resting*State*" }, - "sidecarChanges": { + "sidecar_changes": { "TaskName": "rest" - } + } }, { - "dataType": "fmap", - "modalityLabel": "magnitude1", - "intendedFor": 1, + "datatype": "fmap", + "suffix": "magnitude1", "criteria": { "SeriesDescription": "gre_field_mapping", - "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], - "EchoTime": 0.00492 - } + "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], + "EchoTime": 0.00492 + }, + "sidecar_changes": { + "IntendedFor": "task_rest", + "TaskName": "rest" + } }, { - "dataType": "fmap", - "modalityLabel": "magnitude2", - "intendedFor": 1, + "datatype": "fmap", + "suffix": "magnitude2", "criteria": { "SeriesDescription": "gre_field_mapping", - "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], - "EchoTime": 0.00738 - } + "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], + "EchoTime": 0.00738 + }, + "sidecar_changes": { + "IntendedFor": "task_rest", + "TaskName": "rest" + } }, { - "dataType": "fmap", - "modalityLabel": "phasediff", - "intendedFor": 1, + "datatype": "fmap", + "suffix": "phasediff", "criteria": { "SeriesDescription": "gre_field_mapping", - "ImageType": ["ORIGINAL", "PRIMARY", "P", "ND"], - "EchoTime": 0.00738 + "ImageType": ["ORIGINAL", "PRIMARY", "P", "ND"], + "EchoTime": 0.00738 }, - "sidecarChanges": { - "EchoTime1": 0.00492, + "sidecar_changes": { + "IntendedFor": "task_rest", + "EchoTime1": 0.00492, "EchoTime2": 0.00738 } }, { - "dataType": "func", - "modalityLabel": "bold", - "customLabels": "task-memory", + "id": "task_memory", + "datatype": "func", + "suffix": "bold", + "custom_entities": "task-memory", "criteria": { "SeriesDescription": "*MemoryTask" }, - "sidecarChanges": { + "sidecar_changes": { "TaskName": "memory" - } + } }, { - "dataType": "fmap", - "modalityLabel": "magnitude1", - "intendedFor": 5, + "datatype": "fmap", + "suffix": "magnitude1", "criteria": { "SeriesDescription": "fmri_fieldmap_gre_field_mapping", - "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], - "EchoTime": 0.00492 - } + "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], + "EchoTime": 0.00492 + }, + "sidecar_changes": { + "IntendedFor": "task_memory" + } }, { - "dataType": "fmap", - "modalityLabel": "magnitude2", - "intendedFor": 5, + "datatype": "fmap", + "suffix": "magnitude2", "criteria": { "SeriesDescription": "fmri_fieldmap_gre_field_mapping", - "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], - "EchoTime": 0.00738 - } + "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], + "EchoTime": 0.00738 + }, + "sidecar_changes": { + "IntendedFor": "task_memory" + } }, { - "dataType": "fmap", - "modalityLabel": "phasediff", - "intendedFor": 5, + "datatype": "fmap", + "suffix": "phasediff", "criteria": { "SeriesDescription": "fmri_fieldmap_gre_field_mapping", - "ImageType": ["ORIGINAL", "PRIMARY", "P", "ND"], - "EchoTime": 0.00738 + "ImageType": ["ORIGINAL", "PRIMARY", "P", "ND"], + "EchoTime": 0.00738 }, - "sidecarChanges": { - "EchoTime1": 0.00492, + "sidecar_changes": { + "IntendedFor": "task_memory", + "EchoTime1": 0.00492, "EchoTime2": 0.00738 } }, { - "dataType": "fmap", - "modalityLabel": "epi", - "intendedFor": 5, + "datatype": "fmap", + "suffix": "epi", "criteria": { "SeriesDescription": "fmri*MemoryTask_*" + }, + "sidecar_changes": { + "IntendedFor": "task_memory" } }, { - "dataType": "anat", - "modalityLabel": "T2w", + "datatype": "anat", + "suffix": "T2w", "criteria": { "SeriesDescription": "*PD*T2*", - "EchoTime": 0.091 + "EchoTime": 0.091 } }, { - "dataType": "anat", - "modalityLabel": "PD", + "datatype": "anat", + "suffix": "PD", "criteria": { "SeriesDescription": "*PD*T2*", - "EchoTime": 0.01 + "EchoTime": 0.01 } }, { - "dataType": "dwi", - "modalityLabel": "dwi", + "id": "dwi", + "datatype": "dwi", + "suffix": "dwi", "criteria": { "ImageType": ["ORIGINAL", "PRIMARY", "DIFFUSION", "NONE", "ND", "NORM", "MOSAIC"] } }, { - "dataType": "fmap", - "modalityLabel": "epi", - "intendedFor": 12, + "datatype": "fmap", + "suffix": "epi", "criteria": { "SeriesDescription": "D*B0*" + }, + "sidecar_changes": { + "IntendedFor": "dwi" } } ] diff --git a/configs/config_siemens_cimaq_iugm.json b/configs/config_siemens_cimaq_iugm.json index 2febeee..9a0e398 100644 --- a/configs/config_siemens_cimaq_iugm.json +++ b/configs/config_siemens_cimaq_iugm.json @@ -2,146 +2,206 @@ "lowerCase": "True", "descriptions": [ { - "dataType": "anat", - "modalityLabel": "T2star", + "datatype": "anat", + "suffix": "T1w", + "criteria": { + "ProtocolName": "MPRAGE*" + } + }, + { + "datatype": "anat", + "suffix": "T2star", "criteria": { "SeriesDescription": "*T2*STAR*", - "ImageType": ["*", "*", "M", "*"] + "ImageType": ["*", "*", "M", "*"] + } + }, + { + "datatype": "anat", + "suffix": "T2star", + "criteria": { + "SeriesDescription": "*T2*star*", + "ImageType": ["*", "*", "M", "*"] } }, { - "dataType": "func", - "modalityLabel": "bold", - "customLabels": "task-rest", + "datatype": "anat", + "suffix": "T2star", + "criteria": { + "SeriesDescription": "*T2*star*", + "ImageType": ["*", "*", "P", "*", "*"] + } + }, + { + "id": "task_rest", + "datatype": "func", + "suffix": "bold", + "custom_entities": "task-rest", "criteria": { "EchoTime": 0.03, "SliceThickness": 3.5 }, - "sidecarChanges": { + "sidecar_changes": { "TaskName": "rest" - } + } }, { - "dataType": "fmap", - "modalityLabel": "magnitude1", - "intendedFor": 1, + "datatype": "fmap", + "suffix": "magnitude1", "criteria": { "SeriesDescription": "gre_field_mapping", "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], "EchoTime": 0.00492 - } + }, + "sidecar_changes": { + "IntendedFor": "task_rest" + } }, { - "dataType": "fmap", - "modalityLabel": "magnitude2", - "intendedFor": 1, + "datatype": "fmap", + "suffix": "magnitude2", "criteria": { "SeriesDescription": "gre_field_mapping", "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], "EchoTime": 0.00738 - } + }, + "sidecar_changes": { + "IntendedFor": "task_rest" + } }, { - "dataType": "fmap", - "modalityLabel": "phasediff", - "intendedFor": 1, + "datatype": "fmap", + "suffix": "phasediff", "criteria": { "SeriesDescription": "gre_field_mapping", "ImageType": ["ORIGINAL", "PRIMARY", "P", "ND"], "EchoTime": 0.00738 }, - "sidecarChanges": { + "sidecar_changes": { "EchoTime1": 0.00492, - "EchoTime2": 0.00738 + "EchoTime2": 0.00738, + "IntendedFor": "task_rest" } }, { - "dataType": "func", - "modalityLabel": "bold", - "customLabels": "task-memory", + "id": "task_memory", + "datatype": "func", + "suffix": "bold", + "custom_entities": "task-memory", "criteria": { "SeriesDescription": "*MemoryTask" }, - "sidecarChanges": { + "sidecar_changes": { "TaskName": "memory" } }, { - "dataType": "fmap", - "modalityLabel": "magnitude1", - "intendedFor": 5, + "datatype": "fmap", + "suffix": "magnitude1", "criteria": { "SeriesDescription": "fmri_fieldmap_gre_field_mapping", "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], "EchoTime": 0.00492 + }, + "sidecar_changes": { + "IntendedFor": "task_memory" } }, { - "dataType": "fmap", - "modalityLabel": "magnitude2", - "intendedFor": 5, + "datatype": "fmap", + "suffix": "magnitude2", "criteria": { "SeriesDescription": "fmri_fieldmap_gre_field_mapping", "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], "EchoTime": 0.00738 + }, + "sidecar_changes": { + "IntendedFor": "task_memory" } }, { - "dataType": "fmap", - "modalityLabel": "phasediff", - "intendedFor": 5, + "datatype": "fmap", + "suffix": "phasediff", "criteria": { "SeriesDescription": "fmri_fieldmap_gre_field_mapping", "ImageType": ["ORIGINAL", "PRIMARY", "P", "ND"], "EchoTime": 0.00738 }, - "sidecarChanges": { + "sidecar_changes": { "EchoTime1": 0.00492, - "EchoTime2": 0.00738 + "EchoTime2": 0.00738, + "IntendedFor": "task_memory" + } + }, + { + "datatype": "fmap", + "suffix": "phasediff", + "criteria": { + "SeriesDescription": "*gre_field_mapping", + "ImageType": ["ORIGINAL", "PRIMARY", "P", "ND", "PHASE"], + "EchoTime": 0.00738 + }, + "sidecar_changes": { + "EchoTime1": 0.00492, + "EchoTime2": 0.00738, + "IntendedFor": "task_memory" } }, { - "dataType": "fmap", - "modalityLabel": "epi", - "intendedFor": 5, + "datatype": "fmap", + "suffix": "epi", "criteria": { "SeriesDescription": "fmri*MemoryTask_*" + }, + "sidecar_changes": { + "IntendedFor": "task_memory" } }, { - "dataType": "anat", - "modalityLabel": "T2w", + "datatype": "anat", + "suffix": "T2w", "criteria": { - "SeriesDescription": "*PD*T2*", + "SeriesDescription": "PD*T2*", "EchoTime": 0.091 } }, { - "dataType": "anat", - "modalityLabel": "PD", + "datatype": "anat", + "suffix": "T2w", "criteria": { - "SeriesDescription": "*PD*T2*", + "SeriesDescription": "PD*T2*", + "EchoTime": 0.093 + } + }, + { + "datatype": "anat", + "suffix": "PD", + "criteria": { + "SeriesDescription": "PD*T2*", "EchoTime": 0.01 } }, { - "dataType": "dwi", - "modalityLabel": "dwi", + "id": "dwi", + "datatype": "dwi", + "suffix": "dwi", "criteria": { "SeriesDescription": "D*I" } }, { - "dataType": "fmap", - "modalityLabel": "epi", - "intendedFor": 12, + "datatype": "fmap", + "suffix": "epi", "criteria": { "SeriesDescription": "D*0*" + }, + "sidecar_changes": { + "IntendedFor": "dwi" } }, { - "dataType": "anat", - "modalityLabel": "T2star", + "datatype": "anat", + "suffix": "T2star", "criteria": { "SeriesDescription": "*T2*STAR*", "ImageType": ["*", "*", "M", "*", "*"] diff --git a/configs/config_siemens_cimaq_mc_connell_brain_imaging_centre.json b/configs/config_siemens_cimaq_mc_connell_brain_imaging_centre.json index 759ba01..5734a9b 100644 --- a/configs/config_siemens_cimaq_mc_connell_brain_imaging_centre.json +++ b/configs/config_siemens_cimaq_mc_connell_brain_imaging_centre.json @@ -2,140 +2,162 @@ "lowerCase": "True", "descriptions": [ { - "dataType": "anat", - "modalityLabel": "T2star", + "datatype": "anat", + "suffix": "T1w", + "criteria": { + "ProtocolName": "MPRAGE*" + } + }, + { + "datatype": "anat", + "suffix": "T2star", "criteria": { "SeriesDescription": "*T2*STAR*", "ImageType": ["ORIGINAL", "PRIMARY", "M", "NORM", "DIS2D"] } }, { - "dataType": "func", - "modalityLabel": "bold", - "customLabels": "task-rest", + "id": "task_rest", + "datatype": "func", + "suffix": "bold", + "custom_entities": "task-rest", "criteria": { "ProtocolName": "*Resting*State*" }, - "sidecarChanges": { + "sidecar_changes": { "TaskName": "rest" - } + } }, { - "dataType": "fmap", - "modalityLabel": "magnitude1", - "intendedFor": 1, + "datatype": "fmap", + "suffix": "magnitude1", "criteria": { "SeriesDescription": "BOLD_RS_fieldmap_gre_field_mapping", "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], "EchoTime": 0.00492 - } + }, + "sidecar_changes": { + "IntendedFor": "task_rest" + } }, { - "dataType": "fmap", - "modalityLabel": "magnitude2", - "intendedFor": 1, + "datatype": "fmap", + "suffix": "magnitude2", "criteria": { "SeriesDescription": "BOLD_RS_fieldmap_gre_field_mapping", "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], "EchoTime": 0.00738 - } + }, + "sidecar_changes": { + "IntendedFor": "task_rest" + } }, { - "dataType": "fmap", - "modalityLabel": "phasediff", - "intendedFor": 1, + "datatype": "fmap", + "suffix": "phasediff", "criteria": { "SeriesDescription": "BOLD_RS_fieldmap_gre_field_mapping", "ImageType": ["ORIGINAL", "PRIMARY", "P", "ND"], "EchoTime": 0.00738 }, - "sidecarChanges": { + "sidecar_changes": { "EchoTime1": 0.00492, - "EchoTime2": 0.00738 + "EchoTime2": 0.00738, + "IntendedFor": "task_rest" } }, { - "dataType": "func", - "modalityLabel": "bold", - "customLabels": "task-memory", + "id": "task_memory", + "datatype": "func", + "suffix": "bold", + "custom_entities": "task-memory", "criteria": { "SeriesDescription": "*MemoryTask" }, - "sidecarChanges": { + "sidecar_changes": { "TaskName": "memory" - } + } }, { - "dataType": "fmap", - "modalityLabel": "magnitude1", - "intendedFor": 5, + "datatype": "fmap", + "suffix": "magnitude1", "criteria": { "SeriesDescription": "fmri_fieldmap_gre_field_mapping", "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], "EchoTime": 0.00492 - } + }, + "sidecar_changes": { + "IntendedFor": "task_memory" + } }, { - "dataType": "fmap", - "modalityLabel": "magnitude2", - "intendedFor": 5, + "datatype": "fmap", + "suffix": "magnitude2", "criteria": { "SeriesDescription": "fmri_fieldmap_gre_field_mapping", "ImageType": ["ORIGINAL", "PRIMARY", "M", "ND"], "EchoTime": 0.00738 - } + }, + "sidecar_changes": { + "IntendedFor": "task_memory" + } }, { - "dataType": "fmap", - "modalityLabel": "phasediff", - "intendedFor": 5, + "datatype": "fmap", + "suffix": "phasediff", "criteria": { "SeriesDescription": "fmri_fieldmap_gre_field_mapping", "ImageType": ["ORIGINAL", "PRIMARY", "P", "ND"], "EchoTime": 0.00738 }, - "sidecarChanges": { + "sidecar_changes": { "EchoTime1": 0.00492, - "EchoTime2": 0.00738 + "EchoTime2": 0.00738, + "IntendedFor": "task_memory" } }, { - "dataType": "fmap", - "modalityLabel": "epi", - "intendedFor": 5, + "datatype": "fmap", + "suffix": "epi", "criteria": { "SeriesDescription": "fmri*MemoryTask_*" + }, + "sidecar_changes": { + "IntendedFor": "task_memory" } }, { - "dataType": "anat", - "modalityLabel": "T2w", + "datatype": "anat", + "suffix": "T2w", "criteria": { "SeriesDescription": "*PD*T2*", "EchoTime": 0.091 } }, { - "dataType": "anat", - "modalityLabel": "PD", + "datatype": "anat", + "suffix": "PD", "criteria": { "SeriesDescription": "*PD*T2*", "EchoTime": 0.01 } }, { - "dataType": "dwi", - "modalityLabel": "dwi", + "id": "dwi", + "datatype": "dwi", + "suffix": "dwi", "criteria": { "SeriesDescription": "DWI" } }, { - "dataType": "fmap", - "modalityLabel": "epi", - "intendedFor": 12, + "datatype": "fmap", + "suffix": "epi", "criteria": { "SeriesDescription": "D*B0*" + }, + "sidecar_changes": { + "IntendedFor": "dwi" } } ] diff --git a/configs/config_philips_cimaq_ubc.json b/configs/not_used/config_philips_cimaq_ubc.json similarity index 100% rename from configs/config_philips_cimaq_ubc.json rename to configs/not_used/config_philips_cimaq_ubc.json diff --git a/configs/config_siemens_cimaq_the_ottawa_hospital_civic.json b/configs/not_used/config_siemens_cimaq_the_ottawa_hospital_civic.json similarity index 100% rename from configs/config_siemens_cimaq_the_ottawa_hospital_civic.json rename to configs/not_used/config_siemens_cimaq_the_ottawa_hospital_civic.json diff --git a/configs/config_siemens_cimaq_the_ottawa_hospital_civic_campus.json b/configs/not_used/config_siemens_cimaq_the_ottawa_hospital_civic_campus.json similarity index 100% rename from configs/config_siemens_cimaq_the_ottawa_hospital_civic_campus.json rename to configs/not_used/config_siemens_cimaq_the_ottawa_hospital_civic_campus.json diff --git a/convert_bids_ccna_cimaq.py b/convert_bids_ccna_cimaq.py index ec709fe..c275b5b 100755 --- a/convert_bids_ccna_cimaq.py +++ b/convert_bids_ccna_cimaq.py @@ -12,17 +12,16 @@ GE = ['DISCOVERY_MR750', 'SIGNA_Pioneer', 'DISCOVERY_MR750w', 'Signa_HDxt'] PHILIPS = ['Intera', 'Achieva', 'Ingenia', 'Achieva_dStream'] -CONFIG_FOLDER = '/home/bore/p/unf/s/bids_conversion/configs' +CONFIG_FOLDER = '/home/pemorin/bids_conversion-master/configs' MAIN_CONFIG = os.path.join(CONFIG_FOLDER, 'config.json') GE_CONFIG = os.path.join(CONFIG_FOLDER, 'config_ge_cimaq.json') SIEMENS_CONFIG = os.path.join(CONFIG_FOLDER, 'config_siemens_cimaq.json') PHILIPS_CONFIG = os.path.join(CONFIG_FOLDER, 'config_philips_cimaq.json') -QUEBEC_CONFIG = os.path.join(CONFIG_FOLDER, 'config_philips_cimaq_QC.json') -CIMAQ_SIEMENS_CONFIG = ['IUGM', 'hospital_douglas', +QUEBEC_CONFIG = os.path.join(CONFIG_FOLDER, 'config_philips_cimaq_qc.json') +CIMAQ_SIEMENS_CONFIG = ['IUGM', 'iugm', 'hospital_douglas', 'Mc_Connell_Brain_Imaging_Centre', - 'THE_OTTAWA_HOSPITAL_CIVIC', - 'the_ottawa_hospital_civic_campus'] + 'mc_connell_brain_imaging_centre'] TIME_SLEEP = 1 @@ -94,10 +93,13 @@ def __init__(self, filename, patient_name, patient_id, patient_date, self.run_command = run_command def get_session(self, session): - if session == 'Initial': - return 1 - else: - return 2 + if self.mode == 'ccna': + if session == 'Initial': + return 1 + else: + return 2 + elif self.mode == 'cimaq': + return session def getManufacturer(self): if self.scanner_model in SIEMENS: @@ -205,7 +207,7 @@ def convert(self, bidsOutput): cmd = 'dcm2bids -d {} -p {} -s {} '\ '-c {} -o {}'.format(self.filename, - self.candid, + self.pscid, self.session, curr_config, bidsOutput) @@ -334,7 +336,7 @@ def main(): # print(sub.candid, sub.pscid) sub.extract() sub.convert(args.oFolder) - sub.delete_filename() + #sub.delete_filename() if __name__ == '__main__': diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 2675b91..0000000 --- a/requirements.txt +++ /dev/null @@ -1,39 +0,0 @@ -backcall==0.1.0 -bids-validator==1.2.4 -bz2file==0.98 -coloredlogs==10.0 -cycler==0.10.0 -decorator==4.4.0 -dipy==1.0.0 -docopt==0.6.2 -fury==0.2.0 -future==0.17.1 -h5py==2.9.0 -humanfriendly==4.18 -ipython==7.8.0 -ipython-genutils==0.2.0 -jedi==0.15.1 -kiwisolver==1.0.1 -matplotlib==2.2.2 -nibabel==2.4.0 -num2words==0.5.10 -numpy==1.16.2 -pandas==0.25.1 -parso==0.5.1 -patsy==0.5.1 -pexpect==4.7.0 -pickleshare==0.7.5 -Pillow==7.1.0 -prompt-toolkit==2.0.9 -ptyprocess==0.6.0 -pybids==0.9.1 -Pygments==2.4.2 -pyparsing==2.2.0 -python-dateutil==2.7.2 -pytz==2018.4 -scipy==1.0.1 -six==1.11.0 -SQLAlchemy==1.3.8 -traitlets==4.3.2 -vtk==8.1.0 -wcwidth==0.1.7