Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodePixelData ¶
func DecodePixelData(src []byte, opts PixelDataOptions) ([]byte, error)
DecodePixelData decodes encapsulated JPEG 2000 pixel data for DICOM. Version 2 returns raw decoded bytes; version 1 matches pylibjpeg v1 behaviour.
func OpenJPEGVersion ¶
OpenJPEGVersion returns the linked openjpeg library version.
func ReadStream ¶
ReadStream reads JPEG 2000 data from bytes, a file path, or an io.Reader.
Types ¶
type Codec ¶
type Codec int
Codec selects the JPEG 2000 container format (pylibjpeg-openjpeg codec argument).
type Image ¶
type Image struct {
Pixels []byte
Width int
Height int
Components int
Precision int
IsSigned bool
ColourSpace int
}
Image holds decoded pixel data in native precision, planar-interleaved (DICOM order).
func DecodeImage ¶
DecodeImage decodes JPEG 2000 data (pylibjpeg-openjpeg decode()).
func (*Image) BytesPerSample ¶
type Params ¶
type Params struct {
Width int
Height int
Components int
Precision int
IsSigned bool
ColourSpace int
}
Params holds JPEG 2000 image parameters without decoding pixels.
func GetImageParameters ¶
GetImageParameters reads JPEG 2000 parameters without decoding pixels.
func GetParameters ¶
GetParameters is a shorthand for GetImageParameters with CodecJ2K.
func (*Params) NrComponents ¶
type PixelDataOptions ¶
type PixelDataOptions struct {
Version PixelDataVersion
Codec Codec
PhotometricInterpretation string
}
PixelDataOptions configures DecodePixelData for DICOM handlers.
type PixelDataVersion ¶
type PixelDataVersion int
PixelDataVersion selects decode_pixel_data behaviour.
const ( PixelDataV1 PixelDataVersion = 1 PixelDataV2 PixelDataVersion = 2 )