parse

package
v0.0.0-...-97aa02a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	Tag                 string `json:"tag"`
	Name                string `json:"name"`
	Keyword             string `json:"keyword"`
	ValueRepresentation string `json:"valueRepresentation"`
	ValueMultiplicity   string `json:"valueMultiplicity"`
	Retired             bool   `json:"retired"`

	SubAttributes map[TagKey]*Attribute
	// contains filtered or unexported fields
}

Attribute represents a DICOM attribute, with ability to point to "sub-attributes" that may be in a SQ

func (*Attribute) AddSubAttribute

func (a *Attribute) AddSubAttribute(at *Attribute, keys []TagKey, attributeMap AttributeMap, mapping *ModuleToAttributeItem)

AddSubAttribute adds a subattribute in the right place to an attribute "tree"

func (*Attribute) IsEmpty

func (a *Attribute) IsEmpty() bool

IsEmpty returns true if the Attribute is effectively empty

func (*Attribute) TagKey

func (a *Attribute) TagKey() TagKey

TagKey returns the corresponding TagKey of an Attribute

type AttributeMap

type AttributeMap map[TagKey]Attribute

AttributeMap represents a mapping from TagKey to Attribute entities

type Module

type Module struct {
	ID             string `json:"id"`
	Name           string `json:"name"`
	Description    string `json:"description"`
	LinkToStandard string `json:"linkToStandard"`
	Attributes     map[TagKey]*Attribute
}

Module represents a DICOM module

func Parse

func Parse(attributeSource, moduleSource, moduleToAttributesSource io.Reader) ([]*Module, error)

Parse consumes data from innolitics' dicom-standard format and returns a slice of parsed Modules.

func (*Module) AddAttribute

func (m *Module) AddAttribute(a Attribute, path string)

AddAttribute adds a top level attribute to a module

type ModuleMap

type ModuleMap map[string]Module

ModuleMap represents a map of string module identifiers to Modules

func (ModuleMap) ToPointerMap

func (m ModuleMap) ToPointerMap() ModulePointerMap

ToPointerMap converts a ModuleMap to a ModulePointerMap

type ModulePointerMap

type ModulePointerMap map[string]*Module

ModulePointerMap represents a map of string module IDs to module pointers

type ModuleToAttributeItem

type ModuleToAttributeItem struct {
	ModuleID string `json:"module"`
	Tag      string `json:"tag"`
	Type     string `json:"type"`
	Path     string `json:"path"`
}

ModuleToAttributeItem represents an item that maps modules to attributes

func (ModuleToAttributeItem) PathTagKeys

func (m ModuleToAttributeItem) PathTagKeys() []TagKey

PathTagKeys returns a slice of TagKeys from the path of the ModuleToAttributeItem

type ModulesByID

type ModulesByID []*Module

ModulesByID implements the sort.Sorter interface to allow []*Modules to be sorted easily.

func (ModulesByID) Len

func (m ModulesByID) Len() int

func (ModulesByID) Less

func (m ModulesByID) Less(i, j int) bool

func (ModulesByID) Swap

func (m ModulesByID) Swap(i, j int)

type TagKey

type TagKey string

TagKey represents a DICOM Tag as a string "key" used in dicom-standard. Tag (aaaa, bbbb) => aaaabbbb as a key

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL