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

Extendig metadata JSON with Brain Imaging Data Structure fields #39

chrisfilo opened this Issue Oct 3, 2015 · 1 comment


None yet
2 participants

chrisfilo commented Oct 3, 2015

Brain Imaging Data Structure (BIDS) is a new specification describing how a neuroimaging dataset should be organized and described. Part of the standard are JSON sidecar files with acquisition parameters essential for performing data analysis that are not present (or reliably reported) in the NIFTI header (see here for details). Such fields include but are not limited to:

  • EffectiveEchoSpacing
  • RepetitionTime
  • PhaseEncodingDirection
  • SliceTiming
  • SliceEncodingDirection
  • EchoTime

Some of those fields are part of DICOM Ontology and are directly accessible from standard DICOM headers (such as RepetitionTime and EchoTime) and some are not part of standard DICOM nomenclature and require extraction using vendor and sequence specific heuristics (for example PhaseEncodingDirection or EffectiveEchoSpacing). We aded them to the BIDS standard because they are necessary for data processing.

I would like to send a PR that would include code to extract those fields from DICOM metadata and putting them in the root of the embedded JSON file. For example:

    "RepetitionTime": 4.0,
    "SliceEncodingDirection": "z",
    "PhaseEncodingDirection": "x-",
    "EffectiveEchoSpacing": 0.00074,
    "global": {
        "const": {
            "SpecificCharacterSet": "ISO_IR 100",
            "ImageType": [
            "StudyTime": 69244.484,
            "SeriesTime": 71405.562,
            "Modality": "MR",
            "Manufacturer": "SIEMENS",
            "SeriesDescription": "2D 16Echo qT2",
            "ManufacturerModelName": "TrioTim",
            "ScanningSequence": "SE",
            "SequenceVariant": "SP",
            "ScanOptions": "SAT1",
            "MRAcquisitionType": "2D",
            "SequenceName": "se2d16",
            "AngioFlag": "N",
            "SliceThickness": 7.0,

Before I commit time to doing this I would love to hear your opinion. For some of the fields (such as PhaseEncodingDirection) I only have code to infer them for siemens scans, but this field can be just omitted when a different type of scan will be used. We can also make all of the BIDS fields optional controlled by a command line flag.


This comment has been minimized.


moloney commented Oct 6, 2015

I would rather not do this in such an ad hoc way. Currently dcmstack just pulls DICOM meta data and summarizes it. All of the meta data is classified based on how it varies (which your proposal does not do). Conversion of this data to meet other standards should probably happen elsewhere.

I do want to try to implement something like this in nibabel: . This would allow some normalization of meta data across vendors.

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