dicom

package module
v0.0.0-...-5f1ce63 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: BSD-3-Clause Imports: 13 Imported by: 0

README

dicom

Experimental library for parsing DICOM datasets in Go

Documentation

Index

Constants

View Source
const (
	UndefinedLength = 0xffffffff
	SQItem          = 0xfffee000
	SQItemDelim     = 0xfffee00d
	SQDelim         = 0xfffee0dd
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DSIterator

type DSIterator interface {
	Next() bool
	Value() *Element
	Err() error
}

type Dataset

type Dataset struct {
	// contains filtered or unexported fields
}

func NewDataset

func NewDataset() *Dataset

func (*Dataset) Get

func (ds *Dataset) Get(tag uint32) (*Element, error)

func (*Dataset) GetString

func (ds *Dataset) GetString(tag uint32) (string, error)

func (*Dataset) Iterator

func (ds *Dataset) Iterator() DSIterator

func (*Dataset) Put

func (ds *Dataset) Put(elem *Element)

func (*Dataset) PutString

func (ds *Dataset) PutString(tag uint32, vrStr, str string) error

func (*Dataset) Size

func (ds *Dataset) Size() int

func (*Dataset) String

func (ds *Dataset) String() string

type Element

type Element struct {
	Tag   uint32
	VR    string
	VL    uint32
	Value Value
}

func NewElement

func NewElement(tag uint32, vr string, vl uint32, value Value) *Element

func (*Element) String

func (e *Element) String() string

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func NewParser

func NewParser() *Parser

func (*Parser) Parse

func (p *Parser) Parse(r io.Reader, explicit bool) (*Dataset, error)

func (*Parser) ParseFile

func (p *Parser) ParseFile(filename string) (*Dataset, error)

func (*Parser) ParseFileUntil

func (p *Parser) ParseFileUntil(filename string, maxTag uint32) (*Dataset, error)

func (*Parser) ParseUntil

func (p *Parser) ParseUntil(r io.Reader, explicit bool, maxTag uint32) (*Dataset, error)

type Reader

type Reader interface {
	io.Reader
	ByteOrder() binary.ByteOrder
	BytesRead() uint64
	IsExplicit() bool
	Peek(n int) ([]byte, error)
	ReadFloat32() (float32, error)
	ReadFloat64() (float64, error)
	ReadInt16() (int16, error)
	ReadInt32() (int32, error)
	ReadString(n uint32) (string, error)
	ReadUint16() (uint16, error)
	ReadUint16LE() (uint16, error)
	ReadUint32() (uint32, error)
	ReadUint32LE() (uint32, error)
	SetExplicit(bool)
	Skip(n int64) error
}

func NewReader

func NewReader(r io.Reader, order binary.ByteOrder, explicit bool) Reader

type Value

type Value interface {
	Get() interface{}
	GetAll() interface{}
	String() string
}

func NewValue

func NewValue(raw interface{}) (Value, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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