Documentation
¶
Index ¶
- Constants
- Variables
- func ConcurrentlyWalkDir(dirPath string, onFile func(file string)) error
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func FatalfDepth(calldepth int, format string, v ...interface{})
- func GetImplementationUID(synthetic bool) string
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func NewRandInstanceUID() (string, error)
- func OverrideConfig(newconfig Config)
- func SetLoggingLevel(level string)
- func SupportsColour(f *os.File) bool
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
- type CharacterSet
- type Config
- type DataSet
- type Dicom
- type Element
- type ElementReader
- type Item
- type PixelData
Constants ¶
const OpenDCMRootUID = "1.2.826.0.1.3680043.9.7484."
OpenDCMRootUID contains the official designated root UID prefix for OpenDCM Issued by Medical Connections Ltd
const OpenDCMVersion = "0.2"
OpenDCMVersion equals the current (or aimed for) version of the software. It is used commonly in creating ImplementationClassUID(0002,0012)
const SCPMaxBytes = 2 * 1024 * 1024
Variables ¶
var ( // RecognisedVRs lists all VRs that are recognised by OpenDCM. // See “6.2 Value Representation (VR)“ for more information RecognisedVRs = []string{ "AE", "AS", "AT", "CS", "DA", "DS", "DT", "FL", "FD", "IS", "LO", "LT", "OB", "OD", "OF", "OW", "PN", "SH", "SL", "SQ", "SS", "ST", "TM", "UI", "UL", "UN", "US", "UT", } // CharacterSetMap provides a mapping between character set name, and character set characteristics. CharacterSetMap = map[string]*CharacterSet{ "Default": {Name: "Default", Description: "Unicode (UTF-8)", Encoding: unicode.UTF8}, "ISO_IR 13": {Name: "ISO_IR 13", Description: "Japanese", Encoding: japanese.ShiftJIS}, "ISO_IR 100": {Name: "ISO_IR 100", Description: "Latin alphabet No. 1", Encoding: charmap.ISO8859_1}, "ISO_IR 101": {Name: "ISO_IR 101", Description: "Latin alphabet No. 2", Encoding: charmap.ISO8859_2}, "ISO_IR 109": {Name: "ISO_IR 109", Description: "Latin alphabet No. 3", Encoding: charmap.ISO8859_3}, "ISO_IR 110": {Name: "ISO_IR 110", Description: "Latin alphabet No. 4", Encoding: charmap.ISO8859_4}, "ISO_IR 126": {Name: "ISO_IR 126", Description: "Greek", Encoding: charmap.ISO8859_7}, "ISO_IR 127": {Name: "ISO_IR 127", Description: "Arabic", Encoding: charmap.ISO8859_6}, "ISO_IR 138": {Name: "ISO_IR 138", Description: "Hebrew", Encoding: charmap.ISO8859_8}, "ISO_IR 144": {Name: "ISO_IR 144", Description: "Cyrillic", Encoding: charmap.ISO8859_5}, "ISO_IR 148": {Name: "ISO_IR 148", Description: "Latin alphabet No. 5", Encoding: charmap.ISO8859_9}, "ISO_IR 166": {Name: "ISO_IR 166", Description: "Thai", Encoding: charmap.Windows874}, "ISO_IR 192": {Name: "ISO_IR 192", Description: "Unicode (UTF-8)", Encoding: unicode.UTF8}, "ISO 2022 IR 6": {Name: "ISO 2022 IR 6", Description: "ASCII", Encoding: unicode.UTF8}, "ISO 2022 IR 13": {Name: "ISO 2022 IR 13", Description: "Japanese (Shift JIS)", Encoding: japanese.ShiftJIS}, "ISO 2022 IR 87": {Name: "ISO 2022 IR 87", Description: "Japanese (Kanji)", Encoding: japanese.ISO2022JP}, "ISO 2022 IR 100": {Name: "ISO 2022 IR 100", Description: "Latin alphabet No. 1", Encoding: charmap.ISO8859_1}, "ISO 2022 IR 101": {Name: "ISO 2022 IR 101", Description: "Latin alphabet No. 2", Encoding: charmap.ISO8859_2}, "ISO 2022 IR 109": {Name: "ISO 2022 IR 109", Description: "Latin alphabet No. 3", Encoding: charmap.ISO8859_3}, "ISO 2022 IR 110": {Name: "ISO 2022 IR 110", Description: "Latin alphabet No. 4", Encoding: charmap.ISO8859_4}, "ISO 2022 IR 127": {Name: "ISO 2022 IR 127", Description: "Arabic", Encoding: charmap.ISO8859_6}, "ISO 2022 IR 138": {Name: "ISO 2022 IR 138", Description: "Hebrew", Encoding: charmap.ISO8859_8}, "ISO 2022 IR 144": {Name: "ISO 2022 IR 144", Description: "Cyrillic", Encoding: charmap.ISO8859_5}, "ISO 2022 IR 148": {Name: "ISO 2022 IR 148", Description: "Latin alphabet No. 5", Encoding: charmap.ISO8859_9}, "ISO 2022 IR 149": {Name: "ISO 2022 IR 149", Description: "Korean", Encoding: korean.EUCKR}, "ISO 2022 IR 159": {Name: "ISO 2022 IR 159", Description: "Japanese (Supplementary Kanji)", Encoding: japanese.ISO2022JP}, "ISO 2022 IR 166": {Name: "ISO 2022 IR 166", Description: "Thai", Encoding: charmap.Windows874}, "GB18030": {Name: "GB18030", Description: "Chinese (Simplified)", Encoding: simplifiedchinese.GB18030}, } )
var ExitOnFatalLog = true
ExitOnFatalLog specifies whether the application should `os.Exit(1)` on a fatal log message
Functions ¶
func ConcurrentlyWalkDir ¶
ConcurrentlyWalkDir recursively traverses a directory and calls `onFile` for each found file inside a goroutine.
func Debug ¶
func Debug(v ...interface{})
Debug calls `debuglog.Output` to print to the logger. Arguments are handled in the manner of fmt.Print
func Debugf ¶
func Debugf(format string, v ...interface{})
Debugf calls `debuglog.Output` to print to the logger. Arguments are handled in the manner of fmt.Printf
func Error ¶
func Error(v ...interface{})
Error calls `errorlog.Output` to print to the logger. Arguments are handled in the manner of fmt.Print
func Errorf ¶
func Errorf(format string, v ...interface{})
Errorf calls `errorlog.Output` to print to the logger. Arguments are handled in the manner of fmt.Printf
func Fatal ¶
func Fatal(v ...interface{})
Fatal calls `fatallog.Output` to print to the logger. ANSI Red colour is added if the output is a character device Stack is also printed to `os.Stderr` Arguments are handled in the manner of fmt.Print
func Fatalf ¶
func Fatalf(format string, v ...interface{})
Fatalf calls `fatallog.Output` to print to the logger. ANSI Red colour is added if the output is a character device Stack is also printed to `os.Stderr` Arguments are handled in the manner of fmt.Printf
func FatalfDepth ¶
FatalfDepth calls `fatallog.Output` to print to the logger. `calldepth` is used to allow for better formatting in case of `check()` ANSI Red colour is added if the output is a character device Stack is also printed to `os.Stderr` Arguments are handled in the manner of fmt.Printf
func GetImplementationUID ¶
GetImplementationUID generates a DICOM implementation UID from OpenDCMRootUID and OpenDCMVersion NOTE: OpenDCM Implementation UIDs conform to the format: <<ROOT>>.<<VERSION>>.<<InstanceType>> Where ROOT = OpenDCMRootUID, VERSION = OpenDCMVersion, InstanceType= (1 for synthetic data, 0 for others)
func Info ¶
func Info(v ...interface{})
Info calls `infolog.Output` to print to the logger. Arguments are handled in the manner of fmt.Print
func Infof ¶
func Infof(format string, v ...interface{})
Infof calls `infolog.Output` to print to the logger. Arguments are handled in the manner of fmt.Printf
func NewRandInstanceUID ¶
NewRandInstanceUID generates a DICOM random instance UID from OpenDCMRootUID
func OverrideConfig ¶
func OverrideConfig(newconfig Config)
OverrideConfig overrides the configuration parsed from environment with the one provided
func SetLoggingLevel ¶
func SetLoggingLevel(level string)
SetLoggingLevel takes a level string and accordingly enables/disables loggers Supported values: "debug" / "5": all logging enabled "info" / "4": info and above enabled "warn" / "3": warn and above enabled "error" / "2": error and above enabled "fatal" / "1": only fatal enabled "disabled" / "none" / "off", "0": all loggers disabled
func SupportsColour ¶
SupportsColour returns whether `f` is a character device (UNIX terminal)
Types ¶
type CharacterSet ¶
CharacterSet provides a link between character encoding, description, and decode + encode functions.
type Config ¶
type Config struct {
Version string
OpenFileLimit int
RootUID string
LogLevel string
/* By enabling `StrictMode`, the parser will reject DICOM inputs which either:
- TODO: Contain an element with a value length exceeding the maximum allowed for its VR
- Contain an element with a value length exceeding the remaining file size. For example incomplete Pixel Data.
*/
StrictMode bool
// DicomReadBufferSize is the number of bytes to be buffered from disk when parsing dicoms
DicomReadBufferSize int
// AET
AET string
AEBindIP string
AEBindPort int
// contains filtered or unexported fields
}
Config represents the application configuration
type DataSet ¶
DataSet represents a single Data Set, as per: http://dicom.nema.org/dicom/2013/output/chtml/part10/sect_7.2.html
func (*DataSet) GetCharacterSet ¶
func (ds *DataSet) GetCharacterSet() (cs *CharacterSet)
GetCharacterSet returns either the character set as defined in (0008,0005), or ISO_IR 100 (default character set)
func (*DataSet) GetElement ¶
GetElement writes the element indexed by `tag` into `dst` its return value indicates whether the DataSet contains said `tag`.
func (*DataSet) GetElementValue ¶
GetElementValue writes the element's value indexed by `tag` into `dst` its return value (bool) indicates whether the DataSet contains said `tag`. its return value (error) indicates whether there are any other problems.
func (*DataSet) HasElement ¶
HasElement returns whether the element indexed by `tag` exists.
type Dicom ¶
type Dicom struct {
DataSet
// contains filtered or unexported fields
}
Dicom represents a file containing one SOP Instance as per http://dicom.nema.org/dicom/2013/output/chtml/part10/chapter_7.html
func FromFile ¶
FromFile decodes a dicom file from the given file path See: FromReader for more information
func FromReader ¶
FromReader decodes a dicom file from `source`, returning an error if something went wrong during the process. This takes ownership of `source`; do not use it after passing through.
func (*Dicom) GetPixelData ¶
func (*Dicom) GetPreamble ¶
GetPreamble returns the "preamble" component
type Element ¶
type Element struct {
// contains filtered or unexported fields
}
Element represents a Data Element, as per http://dicom.nema.org/dicom/2013/output/chtml/part05/chapter_7.html#sect_7.1
func NewElementWithTag ¶
NewElementWithTag returns a fresh Element with its VR, VM, Name and NameHuman pre-looked up according to "t".
func (*Element) GetValue ¶
GetValue writes the element's "value" component to "dst". "dst" should be writable (pointer type)
type ElementReader ¶
type ElementReader struct {
// contains filtered or unexported fields
}
ElementReader extends `bin.Reader` to export methods to assist in decoding DICOM Elements, i.e. "ReadElement".
func NewElementReader ¶
func NewElementReader(source bin.Reader) (er ElementReader)
NewElementReader returns a fresh ElementReader set up to use `source` for its data.
For futureproofing, it is suggested to use these constructors rather than manually creating an instance (i.e. `elr := ElementReader{}`)
func (*ElementReader) IsImplicitVR ¶
func (elr *ElementReader) IsImplicitVR() bool
IsImplicitVR returns whether this ElementReader is set to parse data according to the VR component being implicitly defined
func (*ElementReader) IsLittleEndian ¶
func (elr *ElementReader) IsLittleEndian() bool
IsLittleEndian returns whether this ElementReader is set to parse data according to Little Endian byte ordering.
func (*ElementReader) ReadElement ¶
func (elr *ElementReader) ReadElement(dst *Element) error
ReadElement attempts to completely read an element into `dst`.
All types of elements are expected to be compatible.
func (*ElementReader) SetImplicitVR ¶
func (elr *ElementReader) SetImplicitVR(isImplicitVR bool)
SetImplicitVR returns whether this ElementReader should parse data according to the VR component being implicitly defined
func (*ElementReader) SetLittleEndian ¶
func (elr *ElementReader) SetLittleEndian(isLittleEndian bool)
SetLittleEndian setswhether this ElementReader should parse data according to Little Endian byte ordering.
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Item represents an Item, as may be found within nested data sequences, as per http://dicom.nema.org/dicom/2013/output/chtml/part05/sect_7.5.html
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
experimental/opendcm-create
command
|
|
|
experimental/opendcm-gendd
command
|
|
|
experimental/opendcm-reduce
command
|
|
|
opendcm-view
command
|
|
|
Code generated using util:gendatadict.
|
Code generated using util:gendatadict. |