Documentation
¶
Overview ¶
Package codecfixture builds synthetic DICOM pixel-data conformance cases.
The package is intentionally public so applications that consume dicom-go, including Twin-Viewer, can prove that the same generated fixture shape loads through their integration paths. The default corpus is generated in memory from synthetic pixel values and carries no PHI.
Index ¶
- Constants
- Variables
- func RegisterBuiltinCodecs(registry pixeldata.Registry) error
- func RegisterUnavailableJPEGLS(registry pixeldata.Registry) error
- func RegisterUnavailableJPEGXL(registry pixeldata.Registry) error
- func ValidateCase(registry pixeldata.Registry, c Case) error
- func ValidateCodecFullReleaseEvidence(moduleRoot string) error
- type Case
- func DependencyUnavailableJPEGLS() Case
- func DependencyUnavailableJPEGXL() Case
- func HTJ2KLosslessRPCL(rows, columns int, fragment []byte, expectedFrame []byte) Case
- func HTJ2KLosslessSmall(fragment []byte, expectedFrame []byte) Case
- func HTJ2KLossy(rows, columns int, fragment []byte, expectedFrame []byte, tolerance byte) Case
- func JPEG2000Lossless(rows, columns int, fragment []byte, expectedFrame []byte) Case
- func JPEG2000LosslessSmall(fragment []byte, expectedFrame []byte) Case
- func JPEG2000Lossy(rows, columns int, fragment []byte, expectedFrame []byte, tolerance byte) Case
- func JPEG2000Part2Lossless(rows, columns int, fragment []byte, expectedFrame []byte) Case
- func JPEG2000Part2Lossy(rows, columns int, fragment []byte, expectedFrame []byte, tolerance byte) Case
- func JPEGBaselineSmall() Case
- func JPEGExtendedSmall() Case
- func JPEGLSLossless(rows, columns int, fragment []byte, expectedFrame []byte) Case
- func JPEGLSLosslessSmall(fragment []byte, expectedFrame []byte) Case
- func JPEGLosslessSmall() Case
- func MalformedJPEGExtended() Case
- func MetadataMismatchRLE() Case
- func MissingJPEGXLAdapter() Case
- func NativeLarge() Case
- func NativeMedium() Case
- func NativeMultiFrame() Case
- func NativeSmall() Case
- func RLELosslessSmall() Case
- func UnsupportedMetadataJPEGExtended() Case
- type ErrorKind
- type Provenance
- type Result
- type SizeClass
Constants ¶
const ( SizeSmall SizeClass = "small" SizeMedium SizeClass = "medium" SizeLarge SizeClass = "large" ErrorNone ErrorKind = "" ErrorUnknown ErrorKind = "unknown" ErrorDecodeMismatch ErrorKind = "decode_mismatch" ErrorUnsupportedMetadata ErrorKind = "unsupported_metadata" ErrorMalformedStream ErrorKind = "malformed_stream" ErrorMissingOptionalAdapter ErrorKind = "missing_optional_adapter" ErrorMetadataMismatch ErrorKind = "metadata_mismatch" )
Variables ¶
var ( ErrDecodeMismatch = errors.New("codecfixture: decoded frames do not match expected frames") ErrUnexpectedSuccess = errors.New("codecfixture: decode succeeded but expected an error") ErrUnexpectedError = errors.New("codecfixture: decode failed unexpectedly") ErrUnexpectedErrorKind = errors.New("codecfixture: decode failed with unexpected error kind") )
Functions ¶
func RegisterBuiltinCodecs ¶
RegisterBuiltinCodecs registers built-in pure-Go codecs used by the baseline.
func RegisterUnavailableJPEGLS ¶
RegisterUnavailableJPEGLS registers a JPEG-LS codec that reports unavailable dependency.
func RegisterUnavailableJPEGXL ¶
RegisterUnavailableJPEGXL registers a JPEG XL codec that reports unavailable dependency.
func ValidateCase ¶
ValidateCase returns nil when the case outcome matches its expectation.
func ValidateCodecFullReleaseEvidence ¶
ValidateCodecFullReleaseEvidence verifies the checked-in codecfull corpus provenance, fixture hashes, and reproducible performance report. moduleRoot must be the root of the github.com/ThalesMMS/dicom-go module.
Types ¶
type Case ¶
type Case struct {
Name string
Description string
Syntax transfer.Syntax
Size SizeClass
Provenance Provenance
Elements []core.Element
ExpectedFrames [][]byte
ExpectedError ErrorKind
Tolerance byte
RegisterCodecs func(pixeldata.Registry) error
}
Case is a synthetic pixel-data conformance fixture.
func DependencyUnavailableJPEGLS ¶
func DependencyUnavailableJPEGLS() Case
DependencyUnavailableJPEGLS returns a JPEG-LS case with a registered unavailable dependency.
func DependencyUnavailableJPEGXL ¶
func DependencyUnavailableJPEGXL() Case
DependencyUnavailableJPEGXL returns a JPEG XL case with a registered codec boundary that reports unavailable dependency.
func HTJ2KLosslessRPCL ¶
HTJ2KLosslessRPCL builds an HTJ2K RPCL lossless case from caller-supplied codestream bytes.
func HTJ2KLosslessSmall ¶
HTJ2KLosslessSmall builds an HTJ2K case from caller-supplied codestream bytes.
func HTJ2KLossy ¶
HTJ2KLossy builds an HTJ2K lossy case from caller-supplied codestream bytes.
func JPEG2000Lossless ¶
JPEG2000Lossless builds a JPEG 2000 case from caller-supplied codestream bytes.
func JPEG2000LosslessSmall ¶
JPEG2000LosslessSmall builds a JPEG 2000 case from caller-supplied codestream bytes.
func JPEG2000Lossy ¶
JPEG2000Lossy builds a JPEG 2000 lossy case from caller-supplied codestream bytes.
func JPEG2000Part2Lossless ¶
JPEG2000Part2Lossless builds a JPEG 2000 Part 2 lossless case from caller-supplied codestream bytes.
func JPEG2000Part2Lossy ¶
func JPEG2000Part2Lossy(rows, columns int, fragment []byte, expectedFrame []byte, tolerance byte) Case
JPEG2000Part2Lossy builds a JPEG 2000 Part 2 lossy case from caller-supplied codestream bytes.
func JPEGBaselineSmall ¶
func JPEGBaselineSmall() Case
JPEGBaselineSmall returns a supported JPEG Baseline 8-bit case.
func JPEGExtendedSmall ¶
func JPEGExtendedSmall() Case
JPEGExtendedSmall returns a supported JPEG Extended 8-bit case.
func JPEGLSLossless ¶
JPEGLSLossless builds a JPEG-LS Lossless case from caller-supplied codestream bytes.
func JPEGLSLosslessSmall ¶
JPEGLSLosslessSmall builds a JPEG-LS Lossless case from caller-supplied codestream bytes.
func JPEGLosslessSmall ¶
func JPEGLosslessSmall() Case
JPEGLosslessSmall returns a supported JPEG Lossless Process 14 case.
func MalformedJPEGExtended ¶
func MalformedJPEGExtended() Case
MalformedJPEGExtended returns a JPEG case with malformed encoded bytes.
func MetadataMismatchRLE ¶
func MetadataMismatchRLE() Case
MetadataMismatchRLE returns an RLE case whose frame count and fragments differ.
func MissingJPEGXLAdapter ¶
func MissingJPEGXLAdapter() Case
MissingJPEGXLAdapter returns a recognized JPEG XL syntax with no registered adapter.
func NativeLarge ¶
func NativeLarge() Case
NativeLarge returns a 256x256 native Explicit VR Little Endian case.
func NativeMedium ¶
func NativeMedium() Case
NativeMedium returns a 64x64 native Explicit VR Little Endian case.
func NativeMultiFrame ¶
func NativeMultiFrame() Case
NativeMultiFrame returns a 2-frame native case.
func NativeSmall ¶
func NativeSmall() Case
NativeSmall returns a 2x2 native Explicit VR Little Endian case.
func RLELosslessSmall ¶
func RLELosslessSmall() Case
RLELosslessSmall returns a supported RLE Lossless case.
func UnsupportedMetadataJPEGExtended ¶
func UnsupportedMetadataJPEGExtended() Case
UnsupportedMetadataJPEGExtended returns a JPEG case with unsupported metadata.
func (Case) Part10Bytes ¶
Part10Bytes serializes the case as a DICOM Part 10 file.
type ErrorKind ¶
type ErrorKind string
ErrorKind is the normalized conformance outcome for a decode failure.
func ClassifyError ¶
ClassifyError normalizes codec and registry errors for conformance reports.
type Provenance ¶
type Provenance struct {
Source string
Synthetic bool
License string
Permission string
NoPHI bool
Notes string
}
Provenance documents where fixture bytes came from.