Saving and loading the general mapping - mslw/horos-bids-output GitHub Wiki
Support for config files
The plugin allows you to use JSON files to store the mapping from series names (a.k.a. scan names or protocol names) to DICOM entities for a given experiment. This may come especially useful if you create your dataset one subject at a time.
images/general_mapping_window.png
Store mapping for later
After the mapping has been entered in the General Mapping Window, it can be saved by clicking Store mapping for later. The plugin will prompt for a file name and location, and save the mapping in a JSON file. You can perform this step both before and after viewing the mapping summary (so that you can check if the mapping works for the currently selected subjects before saving it).
Use stored mapping
If you have a JSON file with a mapping ready, you can load it by clicking Use stored mapping in the General Mapping Window. The plugin will take the information from this file, use it to annotate the series from currently selected studies, and automatically proceed to the summary window.
Please note: this means that if the JSON file does not have an entry for a series present in currently exported studies, the series will remain untouched. Similarly, if the JSON file has an entry for a series which is not present in currently exported studies, the entry will not be used. In both cases, no warnings will be shown, so pay attention to the displayed mapping and summary.
However, you may close the mapping summary and manually annotate the series missing from the JSON files (or do that before loading the JSON file).
The contents of Subjects and session rules and Dataset description pop-ups are not saved, so you have to fill them in regardless. When appending subjects to a dataset, you may wish to choose to skip writing the dataset description file.
Structure of the JSON file
In most cases, you will use files created by the plugin. However, since they are simply a representation of a nested NSDictionary
(where upper level keys are sequence names, lower level keys correspond to GUI columns, and all entries are strings), there is nothing stopping you from creating your own. An example file looks like this:
{
"t1_mpr_iso" : {
"run" : "",
"session" : "",
"suffix" : "T1w",
"task" : "",
"acq" : ""
},
"ep2d_bold_N_back" : {
"run" : "",
"session" : "",
"suffix" : "bold",
"task" : "n-back",
"acq" : ""
},
"gre_field_mapping" : {
"run" : "",
"session" : "",
"suffix" : "(fmap)",
"task" : "",
"acq" : ""
},
"ep2d_bold_stop_signal_1" : {
"run" : "",
"session" : "",
"suffix" : "bold",
"task" : "stop signal",
"acq" : ""
},
"Localizers" : {
"run" : "",
"session" : "",
"suffix" : "",
"task" : "",
"acq" : ""
},
"ep2d_bold_N_back_1" : {
"run" : "",
"session" : "",
"suffix" : "bold",
"task" : "n-back",
"acq" : ""
},
"ep2d_bold_stop_signal_2" : {
"run" : "",
"session" : "",
"suffix" : "bold",
"task" : "stop signal",
"acq" : ""
}
}