media

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FillTag

func FillTag(tag *DcmTag)

FillTag - Populates with data from dictionary

func GetDictionaryTag

func GetDictionaryTag(group uint16, element uint16) *tags.Tag

GetDictionaryTag - get tag from Dictionary

func GetDictionaryVR

func GetDictionaryVR(group uint16, element uint16) string

GetDictionaryVR - get info from Dictionary

func InitDict

func InitDict()

InitDict Initialize Dictionary

Types

type BufData

type BufData interface {
	ClearMemoryStream()
	IsBigEndian() bool
	SetBigEndian(isBigEndian bool)
	GetPosition() int
	SetPosition(position int)
	GetSize() int
	Read(count int) ([]byte, error)
	ReadByte() (byte, error)
	ReadUint16() (uint16, error)
	ReadUint32() (uint32, error)
	Write(data []byte, count int) (int, error)
	WriteAETitle(aeTitle string)
	WriteByte(value byte) error
	WriteUint16(value uint16)
	WriteUint32(value uint32)
	WriteString(value string)
	ReadTag(explicitVR bool) (*DcmTag, error)
	WriteTag(tag *DcmTag, explicitVR bool)
	WriteStringTag(group uint16, element uint16, vr string, content string, explicitVR bool)
	ReadMeta() (*transfersyntax.TransferSyntax, error)
	WriteMeta(SOPClassUID string, SOPInstanceUID string, TransferSyntax string)
	ReadObj(obj DcmObj) bool
	WriteObj(obj DcmObj)
	Send(rw *bufio.ReadWriter) error
	GetAllBytes() []byte
}

BufData - is an interface to buffer manipulation class

func NewBufDataFromBytes

func NewBufDataFromBytes(data []byte) BufData

NewBufDataFromBytes -

func NewBufDataFromFile

func NewBufDataFromFile(fileName string) (BufData, error)

NewBufDataFromFile -

func NewEmptyBufData

func NewEmptyBufData() BufData

NewEmptyBufData -

type DCMStudy

type DCMStudy struct {
	PatientID          string
	PatientName        string
	PatientBD          string
	PatientSex         string
	ReferringPhysician string
	StudyDate          string
	StudyTime          string
	ReportDate         string
	ReportTime         string
	AccessionNumber    string
	Modality           string
	InstitutionName    string
	Description        string
	StudyInstanceUID   string
	ReportText         string
	ObserverName       string
}

DCMStudy study information structure

func (*DCMStudy) GetStudy

func (study *DCMStudy) GetStudy(obj DcmObj)

GetInfo gets information

type DcmObj

type DcmObj interface {
	Add(tag *DcmTag)
	AddConceptNameSeq(group uint16, element uint16, CodeValue string, CodeMeaning string)
	AddSRText(text string)
	DumpTags()
	IsExplicitVR() bool
	SetExplicitVR(explicit bool)
	IsBigEndian() bool
	SetBigEndian(bigEndian bool)
	GetDate(tag *tags.Tag) time.Time
	GetPixelData(frame int) ([]byte, error)
	GetTagAt(i int) *DcmTag
	GetTag(tag *tags.Tag) *DcmTag
	GetTagGE(group uint16, element uint16) *DcmTag
	SetTag(i int, tag *DcmTag)
	InsertTag(i int, tag *DcmTag)
	DelTag(i int)
	GetTags() []*DcmTag
	GetUShort(tag *tags.Tag) uint16
	GetUInt(tag *tags.Tag) uint32
	GetString(tag *tags.Tag) string
	GetUShortGE(group uint16, element uint16) uint16
	GetUIntGE(group uint16, element uint16) uint32
	GetStringGE(group uint16, element uint16) string
	WriteDate(tag *tags.Tag, date time.Time)
	WriteDateRange(tag *tags.Tag, startDate time.Time, endDate time.Time)
	WriteTime(tag *tags.Tag, date time.Time)
	WriteUint16(tag *tags.Tag, val uint16)
	WriteUint32(tag *tags.Tag, val uint32)
	WriteString(tag *tags.Tag, content string)
	WriteUint16GE(group uint16, element uint16, vr string, val uint16)
	WriteUint32GE(group uint16, element uint16, vr string, val uint32)
	WriteStringGE(group uint16, element uint16, vr string, content string)
	GetTransferSyntax() *transfersyntax.TransferSyntax
	SetTransferSyntax(ts *transfersyntax.TransferSyntax)
	ChangeTransferSynx(ts *transfersyntax.TransferSyntax) error
	TagCount() int
	CreateSR(study DCMStudy, SeriesInstanceUID string, SOPInstanceUID string)
	CreatePDF(study DCMStudy, SeriesInstanceUID string, SOPInstanceUID string, fileName string)
	WriteToBytes() []byte
	WriteToFile(fileName string) error
	// contains filtered or unexported methods
}

DcmObj - DICOM Object structure

func NewDCMObjFromBytes

func NewDCMObjFromBytes(data []byte) (DcmObj, error)

NewDCMObjFromBytes - Read from a DICOM bytes into a DICOM Object

func NewDCMObjFromFile

func NewDCMObjFromFile(fileName string) (DcmObj, error)

NewDCMObjFromFile - Read from a DICOM file into a DICOM Object

func NewEmptyDCMObj

func NewEmptyDCMObj() DcmObj

NewEmptyDCMObj - Create as an interface to a new empty dcmObj

type DcmTag

type DcmTag struct {
	Name        string
	Description string
	Group       uint16
	Element     uint16
	Length      uint32
	VR          string
	VM          string
	Data        []byte
	BigEndian   bool
}

DcmTag DICOM tag structure

func (*DcmTag) GetFloat

func (tag *DcmTag) GetFloat() float32

GetFloat convert tag.Data to float32

func (*DcmTag) GetString

func (tag *DcmTag) GetString() string

GetString convert tag.Data to string

func (*DcmTag) GetUInt

func (tag *DcmTag) GetUInt() uint32

GetUInt convert tag.Data to uint32

func (*DcmTag) GetUShort

func (tag *DcmTag) GetUShort() uint16

GetUShort convert tag.Data to uint16

func (*DcmTag) ReadSeq

func (tag *DcmTag) ReadSeq(ExplicitVR bool) DcmObj

ReadSeq - reads a dicom sequence

func (*DcmTag) WriteSeq

func (tag *DcmTag) WriteSeq(group uint16, element uint16, seq DcmObj)

WriteSeq - Create an SQ tag from a DICOM Object

type JSONAlphabeticValue

type JSONAlphabeticValue struct {
	Family []string `json:"Family,omitempty"`
	Given  []string `json:"Given,omitempty"`
	Suffix []string `json:"Suffix,omitempty"`
}

JSONAlphabeticValue - JSON struct for alphabetic value

type JSONObj

type JSONObj interface {
}

JSONObj - JSON struct for DICOM data

func NewJSONObj

func NewJSONObj() JSONObj

NewJSONObj - Creates a new jsonObj and returns an interface to it

func NewJSONObjFromDcmObj

func NewJSONObjFromDcmObj(dcm DcmObj) JSONObj

NewJSONObjFromDcmObj - Creates a new jsonObj and parses DcmObj into it

type JSONPNValue

type JSONPNValue struct {
	Alphabetic  JSONAlphabeticValue `json:"Alphabetic"`
	Ideographic JSONAlphabeticValue `json:"Ideographic,omitempty"`
}

JSONPNValue - JSON struct for PN value

type JSONTag

type JSONTag struct {
	VR    string        `json:"vr"`
	Value []interface{} `json:"Value"`
}

JSONTag - JSON struct for a DICOM tag

type MemoryStream

type MemoryStream interface {
	GetData() []byte
	Get() (int, error)
	GetByte() (byte, error)
	GetUint16() (uint16, error)
	GetUint32() (uint32, error)
	GetInt() (int, error)
	GetPosition() int
	SetPosition(position int)
	GetSize() int
	SetSize(size int)
	Append(data []byte) (int, error)
	ReadData(input []byte) error
	Read(count int) ([]byte, error)
	ReadFully(rw *bufio.ReadWriter, length int)
	Write(buffer []byte, count int) (int, error)
	Clear()
}

MemoryStream - is an inteface to a memory stream

func NewEmptyMemoryStream

func NewEmptyMemoryStream() MemoryStream

NewEmptyMemoryStream - Creates an inteface to a new empty memoryStream

func NewMemoryStreamFromBytes

func NewMemoryStreamFromBytes(data []byte) MemoryStream

NewMemoryStreamFromBytes - Creates an interface to a new memoryStream from bytes

func NewMemoryStreamFromFile

func NewMemoryStreamFromFile(fileName string) (MemoryStream, error)

NewMemoryStreamFromFile - Creates an interface to a new memoryStream from file

Jump to

Keyboard shortcuts

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