dicomio

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const LimitReadUntilEOF = -9999

LimitReadUntilEOF is a special dicomio.Reader limit indicating that there is no hard limit and the Reader should read until EOF.

Variables

View Source
var (
	// ErrorInsufficientBytesLeft indicates there are not enough bytes left in
	// the current buffer (or enough bytes left until the currently set limit)
	// to complete the operation.
	ErrorInsufficientBytesLeft = errors.New("not enough bytes left until buffer limit to complete this operation")
)

Functions

This section is empty.

Types

type Reader

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

func NewReader

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

NewReader creates and returns a new *dicomio.Reader.

func (*Reader) ByteOrder

func (r *Reader) ByteOrder() binary.ByteOrder

ByteOrder returns the current byte order.

func (*Reader) BytesLeftUntilLimit

func (r *Reader) BytesLeftUntilLimit() int64

func (*Reader) IsImplicit

func (r *Reader) IsImplicit() bool

IsImplicit returns if the currently set transfer syntax on this *Reader is implicit or not.

func (*Reader) IsLimitExhausted

func (r *Reader) IsLimitExhausted() bool

func (*Reader) Peek

func (r *Reader) Peek(n int) ([]byte, error)

Peek reads and returns the next n bytes (if possible) without advancing the underlying reader.

func (*Reader) PopLimit

func (r *Reader) PopLimit()

PopLimit removes the most recent limit set, and restores the limit before that one.

func (*Reader) PushLimit

func (r *Reader) PushLimit(n int64) error

PushLimit creates a limit n bytes from the current position.

func (*Reader) Read added in v1.0.11

func (r *Reader) Read(p []byte) (int, error)

func (*Reader) ReadFloat32

func (r *Reader) ReadFloat32() (float32, error)

ReadFloat32 reads a float32 from the underlying *Reader.

func (*Reader) ReadFloat64

func (r *Reader) ReadFloat64() (float64, error)

ReadFloat64 reads a float64 from the underlying *Reader.

func (*Reader) ReadInt16

func (r *Reader) ReadInt16() (int16, error)

ReadInt16 reads an int16 from the underlying *Reader.

func (*Reader) ReadInt32

func (r *Reader) ReadInt32() (int32, error)

ReadInt32 reads an int32 from the underlying *Reader.

func (*Reader) ReadString

func (r *Reader) ReadString(n uint32) (string, error)

ReadString reads a string from the underlying *Reader.

func (*Reader) ReadUInt16

func (r *Reader) ReadUInt16() (uint16, error)

ReadUInt16 reads an uint16 from the underlying *Reader.

func (*Reader) ReadUInt32

func (r *Reader) ReadUInt32() (uint32, error)

ReadUInt32 reads an uint32 from the underlying *Reader.

func (*Reader) ReadUInt8

func (r *Reader) ReadUInt8() (uint8, error)

ReadUInt8 reads an uint8 from the underlying *Reader.

func (*Reader) SetCodingSystem

func (r *Reader) SetCodingSystem(cs charset.CodingSystem)

SetCodingSystem sets the charset.CodingSystem to be used when ReadString is called.

func (*Reader) SetDeflate added in v1.0.11

func (r *Reader) SetDeflate()

SetDeflate applies deflate decompression to the underlying *Reader for all subsequent reads. This should be set when working with a deflated transfer syntax. Right now this is expected to be called once when parsing the top level dicom data, and there is no facility to swap between deflate and non-deflate reading. This also sets the current limit to LimitReadUntilEOF, since the original limits (if any) will be based on uncompressed bytes.

func (*Reader) SetTransferSyntax

func (r *Reader) SetTransferSyntax(bo binary.ByteOrder, implicit bool)

func (*Reader) Skip

func (r *Reader) Skip(n int64) error

Skip skips the *Reader ahead by n bytes.

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)

GetTransferSyntax gets the current transfer syntax of this Writer.

func (*Writer) SetTransferSyntax

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

SetTransferSyntax sets the current transfer syntax of this Writer.

func (*Writer) WriteByte

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

WriteByte writes the provided byte to the Writer.

func (*Writer) WriteBytes

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

WriteBytes writes the provided byte slice to the Writer.

func (*Writer) WriteFloat32

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

WriteFloat32 writes the provided float32 to the Writer.

func (*Writer) WriteFloat64

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

WriteFloat64 writes the provided float64 to the Writer.

func (*Writer) WriteString

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

WriteString writes the provided string to the Writer.

func (*Writer) WriteUInt16

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

WriteUInt16 writes the provided uint16 to the Writer.

func (*Writer) WriteUInt32

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

WriteUInt32 writes the provided uint32 to the Writer.

func (*Writer) WriteZeros

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

WriteZeros writes len bytes of zeros at the current position of the Writer.

Jump to

Keyboard shortcuts

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