write

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataSet

func DataSet(out io.Writer, ds *element.DataSet, opts ...Option) error

DataSet writes the dataset into the stream in DICOM file format, complete with the magic header and metadata elements.

The transfer syntax (byte order, etc) of the file is determined by the TransferSyntax element in "ds". If ds is missing that or a few other essential elements, this function returns an error.

ds := ... read or create dicom.Dataset ...
out, err := os.Create("test.dcm")
err := write.DataSet(out, ds)

func DataSetToFile

func DataSetToFile(path string, ds *element.DataSet, opts ...Option) error

DataSetToFile writes "ds" to the given file. If the file already exists, existing contents are clobbered. Else, the file is newly created.

func Element

func Element(e *dicomio.Encoder, elem *element.Element, opts ...Option)

Element encodes one data element. Errors are reported through e.Error() and/or E.Finish().

REQUIRES: Each value in values[] must match the VR of the tag. E.g., if tag is for UL, then each value must be uint32.

func FileHeader

func FileHeader(e *dicomio.Encoder, metaElems []*element.Element, opts ...Option)

FileHeader produces a DICOM file header. metaElems[] is be a list of elements to be embedded in the header part. Every element in metaElems[] must have Tag.Group==2. It must contain at least the following three elements: TagTransferSyntaxUID, TagMediaStorageSOPClassUID, TagMediaStorageSOPInstanceUID. The list may contain other meta elements as long as their Tag.Group==2; they are added to the header.

Errors are reported via e.Error().

Consult the following page for the DICOM file header format.

http://dicom.nema.org/dicom/2013/output/chtml/part10/chapter_7.html

Types

type Option added in v0.4.2

type Option func(o *optSet)

Option is the type used for options for writing DICOM elements

var SkipVRVerification Option = func(o *optSet) {
	o.skipVRVerification = true
}

SkipVRVerification disables VR verification when encoding elements

Jump to

Keyboard shortcuts

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