dicomio

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorInsufficientBytesLeft = errors.New("not enough bytes left until buffer limit to complete this operation")
)

Functions

This section is empty.

Types

type Reader

type Reader interface {
	io.Reader
	// ReadUInt8 reads a uint16 from the underlying reader.
	ReadUInt8() (uint8, error)
	// ReadUInt16 reads a uint16 from the underlying reader.
	ReadUInt16() (uint16, error)
	// ReadUInt32 reads a uint32 from the underlying reader.
	ReadUInt32() (uint32, error)
	// ReadUInt64 reads a uint64 from the underlying reader.
	ReadUInt64() (uint64, error)
	// ReadInt16 reads a int16 from the underlying reader.
	ReadInt16() (int16, error)
	// ReadInt32 reads a int32 from the underlying reader.
	ReadInt32() (int32, error)
	// ReadInt64 reads a int64 from the underlying reader.
	ReadInt64() (int64, error)
	// ReadFloat32 reads a float32 from the underlying reader.
	ReadFloat32() (float32, error)
	// ReadFloat64 reads a float32 from the underlying reader.
	ReadFloat64() (float64, error)
	// ReadString reads an n byte string from the underlying reader. Uses the charset.CodingSystem encoding.
	// Decoders to read the string, if set.
	ReadString(n uint32) (string, error)
	// Skip skips the reader ahead by n bytes.
	Skip(n int64) error
	// Peek returns the next n bytes without advancing the reader. This will
	// return bufio.ErrBufferFull if the buffer is full.
	Peek(n int) ([]byte, error)
	// PushLimit sets a read limit of n bytes from the current position of the reader. Once the limit is reached,
	// IsLimitExhausted will return true, and other attempts to read data from dicomio.Reader will return io.EOF.
	PushLimit(n int64) error
	// PopLimit removes the most recent limit set, and restores the limit before that one.
	PopLimit()
	// IsLimitExhausted indicates whether or not we have read up to the currently set limit position.
	IsLimitExhausted() bool
	// BytesLeftUntilLimit returns the number of bytes remaining until we reach the currently set limit positon.
	BytesLeftUntilLimit() int64
	// SetTransferSyntax sets the byte order and whether the current transfer syntax is implicit or not.
	SetTransferSyntax(bo binary.ByteOrder, implicit bool)
	// IsImplicit returns if the currently set transfer syntax on this Reader is implicit or not.
	IsImplicit() bool
	// SetCodingSystem sets the charset.CodingSystem to be used when ReadString is called.
	SetCodingSystem(cs charset.CodingSystem)
}

Reader provides common functionality for reading underlying DICOM data.

func NewReader

func NewReader(in *bufio.Reader, bo binary.ByteOrder, limit int64) (Reader, error)

type Writer

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

Writer is a lower level encoder that manages writing out entities to an io.Reader.

func NewWriter

func NewWriter(out io.Writer, bo binary.ByteOrder, implicit bool) Writer

NewWriter initializes and returns a Writer.

func (*Writer) GetTransferSyntax

func (w *Writer) GetTransferSyntax() (binary.ByteOrder, bool)

func (*Writer) SetTransferSyntax

func (w *Writer) SetTransferSyntax(bo binary.ByteOrder, implicit bool)

func (*Writer) WriteByte

func (w *Writer) WriteByte(v byte) error

func (*Writer) WriteBytes

func (w *Writer) WriteBytes(v []byte) error

func (*Writer) WriteFloat32

func (w *Writer) WriteFloat32(v float32) error

func (*Writer) WriteFloat64

func (w *Writer) WriteFloat64(v float64) error

func (*Writer) WriteString

func (w *Writer) WriteString(v string) error

func (*Writer) WriteUInt16

func (w *Writer) WriteUInt16(v uint16) error

func (*Writer) WriteUInt32

func (w *Writer) WriteUInt32(v uint32) error

func (*Writer) WriteUInt64

func (w *Writer) WriteUInt64(v uint64) error

func (*Writer) WriteZeros

func (w *Writer) WriteZeros(len int) error

Jump to

Keyboard shortcuts

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