https://github.com/bu-rcs/dcm2mriqc
Repository home of the dcm2mriqc docker image for running mriqc on scans housed within an XNAT instance.
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.1%) to scientific vocabulary
Repository
Repository home of the dcm2mriqc docker image for running mriqc on scans housed within an XNAT instance.
Basic Info
- Host: GitHub
- Owner: bu-rcs
- Language: Dockerfile
- Default Branch: main
- Size: 4.88 KB
Statistics
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
dcm2mriqc
Repository home of the dcm2mriqc docker container.
The container and pipeline are designed to build upon mriqc. The pipeline runs dcm2bids on input dicom images and then runs the mriqc pipeline.
Dependencies
- mriqc docker container; documentation
- dcm2bids -- see external documentation
- dcm2niix -- see external documentation
Key files
pipeline.sh -- a bash script that serves as a master script running the necessary steps to convert input DICOM files to NIFTI and the organizting the resulting NIFTI files into a temporary BIDS formatted directory for processing.
1. Step 1 -- download the bidsconfig.json file from XNAT. The bidsconfig.json file is uploaded to your XNAT instance using Legacy XNAT Site Configuration API. An example GET and PUT command using curl are as follows: curl --location-trusted -u USERNAME --file-upload BIDS_CONFIG.JSON -X PUT YOURXNAT/data/config/bids/bidsmap?json=TRUE to place your bidsconfig.json file to the XNAT server and curl --location-trusted -u USERNAME -X GET YOURXAT/data/config/bids/bidsmap to pull the current bidsconfig.json file from the server. See "How do I create a bids_config.json" for more information on how to create one of these files for your purposes.
2. Step 2 -- in a single step, use dcm2bids to a.) turn this scan's DICOMs into NIFTIs b.) give these NIFTIs a BIDS compliant file name, c.) place the NIFTI file within a BIDS compliant directory structure, d.) create BIDS compliant json sidecars for the scans. For more detailed information, reading the external BIDS documentation is highly recommended. The BIDS compliant data structure is written to /tmp/bids within the container.
3. Step 3 -- run mriqc with the --no-sub and --notrack flags to prevent mriqc from communicating with external servers and ensuring mriqc utilizes all available cores for computation using the --nprocs and --omp-nthreads flags. Writes the resulting reports to the /tmp/derivatives folder withint the container.
4. Step 4 -- move the QA reports to the mounted /output directory within the container so that the reports are uploaded back to the XNAT server.
5. Step 5 -- clean up the /tmp directory, removing all intermediate files created during the process.
download_bidsconfig.py -- a python script that borrows heavily from the script dcm2bids_wholeSession.py contained within the xnat/dcm2bids-session container on dockerhub. The script downloads the bids_config.json file using the Legacy XNAT Site Configuration API.
What is a bids_config.json file? How do I create one and how do I uploaded it to XNAT?
A bids_config.json file is a json file that controls how the dcm2bids translates DICOM header information into BIDS "types". For a deeper dive into this file and how it works, see the dcm2bids documentation.
An example bids_config.json file appears below.
{
"descriptions": [
{
"datatype": "func",
"suffix": "bold",
"custom_entities": "task-rest",
"criteria": {
"SeriesDescription": "REST*"
},
"sidecar_changes": {
"TaskName": "rest"
}
},
{
"datatype": "anat",
"suffix": "T1w",
"criteria": {
"SeriesDescription": "MPRAGE*"
}
}
]
}
datatype = the bids
suffix =
custom_entities = additional information that is added to the BIDS filename. For functional BOLDS images, BIDS requires an entry defining the name of the task.
criteria = a group of key:values that correspond to the header information contained within the DICOM files. These are used to uniquely identify the scan to map it to the BIDS filename format defined using datatype, suffix, and custom_entities.
sidecar_changes = additional entries into the json sidecar files that are created alongside the NIFTI files. Functional BOLD scans, for example, are required to have an entry "TaskName" in their json sidecar.
Once your create a bids_config.json file, you can upload that file to your XNAT server by running the following curl commands:
curl --location-trusted -u USERNAME --file-upload BIDS_CONFIG.JSON -X PUT YOURXNAT/data/config/bids/bidsmap?json=TRUE
which assumes that your bids_config.json file is in your present working directory. You will have to enter your XNAT password after invoking this command. If there is not a bids entry within /data/config, it will be created. If there is already a bidsmap file at /data/config/bids/bidsmap, that file will be overwritten with the current one.
You can pull down the latest version
Owner
- Name: Boston University Research Computing
- Login: bu-rcs
- Kind: organization
- Location: Boston
- Website: http://www.bu.edu/tech/support/research/
- Repositories: 3
- Profile: https://github.com/bu-rcs
Research Computing Projects
GitHub Events
Total
- Member event: 1
- Push event: 19
- Create event: 2
Last Year
- Member event: 1
- Push event: 19
- Create event: 2
Dependencies
- nipreps/mriqc latest build