Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert DICOM data to BIDS #4

Closed
wants to merge 2 commits into from
Closed

Convert DICOM data to BIDS #4

wants to merge 2 commits into from

Conversation

alexfoias
Copy link

@alexfoias alexfoias commented Sep 16, 2021

Assuming that the PATH_INPUT_DATASET is organized like:

|-- data
    |-- 5416
    |   |-- 5416_T1
    |   |   |-- IM-0001-0001.dcm
    |   |   |-- IM-0001-0002.dcm
    |   |   |-- IM-0001-0003.dcm
    |   |   |-- IM-0001-0004.dcm
    |   |   |-- IM-0001-0005.dcm
    |   |   |-- IM-0001-0006.dcm
    |   |   |-- IM-0001-0007.dcm
    |   |   |-- IM-0001-0008.dcm
    |   |   |-- IM-0001-0009.dcm
    |   |   |-- IM-0001-0010.dcm
    |   |   |-- IM-0001-0011.dcm
    |   |   |-- IM-0001-0012.dcm
    |   |-- 5416_T2
    |       |-- IM-0001-0001.dcm
    |       |-- IM-0001-0002.dcm
    |       |-- IM-0001-0003.dcm
    |       |-- IM-0001-0004.dcm
    |       |-- IM-0001-0005.dcm
    |       |-- IM-0001-0006.dcm
    |       |-- IM-0001-0007.dcm
    |       |-- IM-0001-0008.dcm
    |       |-- IM-0001-0009.dcm
    |       |-- IM-0001-0010.dcm
    |       |-- IM-0001-0011.dcm
    |       |-- IM-0001-0012.dcm
    |-- 5493
        |-- 5493_T1
        |   |-- IM-0001-0001.dcm
        |   |-- IM-0001-0002.dcm
        |   |-- IM-0001-0003.dcm
        |   |-- IM-0001-0004.dcm
        |   |-- IM-0001-0005.dcm
        |   |-- IM-0001-0006.dcm
        |   |-- IM-0001-0007.dcm
        |   |-- IM-0001-0008.dcm
        |   |-- IM-0001-0009.dcm
        |   |-- IM-0001-0010.dcm
        |   |-- IM-0001-0011.dcm
        |   |-- IM-0001-0012.dcm
        |   |-- IM-0001-0013.dcm
        |-- 5493_T2
            |-- IM-0001-0001.dcm
            |-- IM-0001-0002.dcm
            |-- IM-0001-0003.dcm
            |-- IM-0001-0004.dcm
            |-- IM-0001-0005.dcm
            |-- IM-0001-0006.dcm
            |-- IM-0001-0007.dcm
            |-- IM-0001-0008.dcm
            |-- IM-0001-0009.dcm
            |-- IM-0001-0010.dcm
            |-- IM-0001-0011.dcm
            |-- IM-0001-0012.dcm
            |-- IM-0001-0013.dcm

Fixes #3

@alexfoias
Copy link
Author

@andrewsm8 I have an initial version of the script if you want to give it a try. thanks.

@alexfoias
Copy link
Author

  1. Create temporary folder:
mkdir convert_sci
cd convert_sci
  1. Download and add dcm2niix to the path:
curl -fLO https://github.com/rordenlab/dcm2niix/releases/latest/download/dcm2niix_mac.zip
unzip dcm2niix_mac.zip
export PATH=$PWD:$PATH
  1. Create a new file environment.yml
    touch environment.yml
    Using your favorite text editor add this content:
name: convert_sci
channels:
    - conda-forge
dependencies:
    - dcm2bids
    - pip
  1. Finally, create a new conda environment to install dcm2bids:
conda env create -f environment.yml
source activate convert_sci
  1. Run script
    python curate_bids_ucd.py -i PATH_TO_DATASET_TO_CONVERT -o OUTPUT_PATH -c PATH_TO_CONFIG_FILE

Note:
What I did to have a stable config for dcm2niix was to add the following line in .zshrc:
export PATH=PathToDCM2niix:$PATH
This way you don't have to do step 2 (export command) every time when you want to run dcm2bids

@naga-karthik
Copy link
Member

Closing as all data we currently have are in BIDS format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add script/instructions to convert DICOM data to BIDS
2 participants