README.md

DICOM.jl

Usage

Installation

To install the package:

julia> using Pkg
julia> Pkg.add("DICOM")

Load the package by

julia> using DICOM

Reading Data

Read a DICOM file by

julia> dcmData = dcm_parse("path/to/dicom/file")

The data in dcmData is structured as a dictionary, and individual DICOM elements can be accessed by their hex tag.
For example, the hex tag of "Pixel Data" is 7FE0,0010, and it can be accessed in Julia by dcmData[(0x7FE0,0x0010)].

Writing Data

Data can be written to a DICOM file by

julia> dcm_write("path/to/output/file", dcmData)

Additional Notes

DICOM files use either explicit or implicit value representation (VR). For implicit files, DICOM.jl will use a lookup table to guess the VR from the DICOM element's hex tag. For explicit files, DICOM.jl will read the VRs from the file.

A user-defined dictionary can be supplied to override the default lookup table
For example, the "Instance Number" - tag (0x0020,0x0013) - is an integer (default VR = "IS"). We can read this as a float by setting the VR to "DS" by:

and now dcmData[(0x0020,0x0013)] will return an error because the key (0x0020,0x0013) doesn't exist - it was skipped during reading.

The user-supplied VR can contain a master VR with the tag (0x0000,0x0000) which will be used whenever DICOM.jl is unable to guess the VR on its own. This is convenient for reading older dicom files and skipping retired elements - i.e. where the VR lookup fails - by: