Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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
12 changes: 6 additions & 6 deletions configs/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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*"
}
Expand Down
38 changes: 20 additions & 18 deletions configs/config_ge.json
Original file line number Diff line number Diff line change
Expand Up @@ -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*"
}
Expand Down
50 changes: 26 additions & 24 deletions configs/config_ge_ccna.json
Original file line number Diff line number Diff line change
Expand Up @@ -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*"
}
Expand Down
48 changes: 24 additions & 24 deletions configs/config_ge_cimaq.json
Original file line number Diff line number Diff line change
@@ -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*"
}
Expand Down
6 changes: 3 additions & 3 deletions configs/config_lower.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"lowerCase": "True",
"descriptions": [
{
"dataType": "anat",
"modalityLabel": "T2star",
"datatype": "anat",
"suffix": "T2star",
"criteria": {
"SeriesDescription": "*T2*STAR*",
"ImageType": ["M"]
"ImageType": ["M"]
}
}
]
Expand Down
Loading