DicomRenderer class
GPU-accelerated DICOM image renderer.
This tool handles the complete rendering pipeline:
- Compiles the GLSL fragment shader on first use.
- Packs 16-bit pixel data into an 8-bit RGBA texture.
- Applies windowing, Hounsfield transform, colorization, and inversion on the GPU.
Use render for a one-call render-to-ui.Image, or use createTexture and renderToImage separately when you need to reuse the texture across many windowing settings.
Constructors
- DicomRenderer({DicomColorMap colorMap = DicomColorMap.grayscale, bool invert = false})
- Creates a renderer.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
shader
→ Future<
FragmentShader?> -
Ensures the fragment shader has been compiled.
no setter
Methods
-
createTexture(
DicomParseResult result, {double? windowCenter, double? windowWidth, bool applyWindowing = false}) → Future< Image> - Packs 16-bit DICOM pixel data into an 8-bit RGBA ui.Image texture.
-
dispose(
) → void - Releases the compiled shader. Call when the renderer is no longer needed.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
render(
DicomParseResult result, {double? windowCenter, double? windowWidth, DicomColorMap? colorMap, bool? invert, int rotationSteps = 0}) → Future< Image> - Renders a DICOM frame to a ui.Image in a single call.
-
renderToImage(
DicomParseResult result, Image texture, {double? windowCenter, double? windowWidth, DicomColorMap? colorMap, bool? invert, int rotationSteps = 0}) → Future< Image> -
Renders an already-created
textureto a new ui.Image. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited