Skip to content

Instantly share code, notes, and snippets.

@ted-strauss-K1
Created May 23, 2019 13:51
Show Gist options
  • Save ted-strauss-K1/9213bc49715aba1cfc1ebd7d09b92a7b to your computer and use it in GitHub Desktop.
Save ted-strauss-K1/9213bc49715aba1cfc1ebd7d09b92a7b to your computer and use it in GitHub Desktop.
datalad rev-create hirni-bids
cd hirni-bids
datalad run-procedure setup_hirni_dataset
## import dicom recently tarred off the dicom server
datalad hirni-import-dcm -d . ../PD00020_05122018.tar.gz acq001
## confirm the subdataset has been created
datalad subdatasets
cd acq001/dicom
# check whether extractor is active on dataset
git config -f .datalad/config -l
# if it's not there, add dicom extractor
git config -f .datalad/config --add datalad.metadata.nativetype dicom
# confirm it's added
git config -f .datalad/config -l
# aggregate metadata on subdataset
datalad aggregate-metadata --force-extraction -d . -r --update-mode all
# go back up to parent
cd ../..
# check whether extractor is active on dataset
git config -f .datalad/config -l
# if it's not there, add dicom extractor
git config -f .datalad/config --add datalad.metadata.nativetype dicom
##git config -f .datalad/config --add datalad.metadata.nativetype bids
##git config -f .datalad/config --add datalad.metadata.nativetype nifti1
# confirm it's there
git config -f .datalad/config -l
## aggregate metadata, percolate up
datalad aggregate-metadata --force-extraction -d . -r --update-mode all
## prepare for bids conversion
datalad run-procedure setup_bids_dataset
## generate spec from dicom metadata
datalad hirni-dicom2spec -d acq001/dicoms -s studyspec2.json acq001/dicoms
## perform bids conversion based on spec
datalad hirni-spec2bids -d . sourcedata/studyspec2.json
@bpoldrack
Copy link

So, I'd take everything until line 28 and make this hirni_raw instead.
For the actual BIDS I'd suggest to have separate dataset:

datalad rev-create hirni-bids
datalad run-procedure setup_bids_dataset
datalad install -s ../hirni-raw sourcedata
datalad hirni-spec2bids sourcedata/acq001/studyspec2.json [--anonymize]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment