dcm_io

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MagicString = "DICM"
)
View Source
const (
	PrivateTag = "PrivateTag"
)
View Source
const (
	VLUndefinedLength uint32 = 0xFFFFFFFF
)

Variables

This section is empty.

Functions

func WithSetFileSize

func WithSetFileSize(fileSize int64) func(*dcmReader)

WithSetFileSize provides option to set the file size to the reader

func WithSkipDataset

func WithSkipDataset(skipDataset bool) func(*dcmReader)

WithSkipDataset provides option to read only the metadata header. If true, only the meta header is read, else, the dataset will be read

func WithSkipPixelData

func WithSkipPixelData(skipPixelData bool) func(*dcmReader)

WithSkipPixelData provides option to skip reading pixel data (7FE0,0010). If true, pixel data is skipped. If false, pixel data will be read

Types

type Dataset

type Dataset struct {
	Elements []*Element `json:"elements"`
}

func (*Dataset) FindElementByTag

func (ds *Dataset) FindElementByTag(tagName tag.DicomTag) (*Element, error)

FindElementByTag returns the corresponding element of the input tag name.

func (*Dataset) FindElementByTagName

func (ds *Dataset) FindElementByTagName(tagName string) (*Element, error)

FindElementByTagName returns the corresponding element of the input tag name.

func (*Dataset) FindElementByTagStr

func (ds *Dataset) FindElementByTagStr(tagStr string) (*Element, error)

FindElementByTagStr returns the corresponding element of the input tag. Tag must be in 'ggggeeee' or '(gggg,eeee)' format

func (*Dataset) RetrieveFileUID

func (ds *Dataset) RetrieveFileUID() (*DicomUID, error)

type DcmReader

type DcmReader interface {
	io.Reader

	IsImplicit() bool

	SkipPixelData() bool
	ByteOrder() binary.ByteOrder
	SetFileSize(fileSize int64) error
	GetFileSize() int64
	Parse() error
	GetMetadata() Dataset
	GetDataset() Dataset
	RetrieveFileUID() (*DicomUID, error)
	GetElementByTagString(tagStr string) (interface{}, error)
	ExportDatasetTags(exportMeta bool) MappedTag
	ExportSeriesTags() MappedTag
	// contains filtered or unexported methods
}

func NewDICOMReader

func NewDICOMReader(reader *bufio.Reader, options ...func(*dcmReader)) DcmReader

NewDICOMReader returns a new reader

type DicomUID

type DicomUID struct {
	StudyInstanceUID  string
	SeriesInstanceUID string
	SOPInstanceUID    string
}

type Element

type Element struct {
	Value                  Value
	TagName                string
	ValueRepresentationStr string
	ValueLength            uint32
	Tag                    tag.DicomTag
	ValueRepresentation    vr.VRKind
}

Element defines the struct for each dicom tag element info. Ordered as below to decrease the memory footprint

func ReadElement

func ReadElement(r DcmReader, isImplicit bool, binOrder binary.ByteOrder) (*Element, error)

ReadElement reads the DICOM file tag by tag and returns the pointer to the parsed Element

type MappedTag

type MappedTag map[string]tag.TagBrowser

func (MappedTag) GetElementByTagString

func (m MappedTag) GetElementByTagString(tagStr string) (interface{}, error)

GetElementByTagString returns the element value of the input tag Tag should be in (gggg,eeee) or ggggeeee format

type Value

type Value struct {
	RawValue interface{}
}

Jump to

Keyboard shortcuts

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