Gorilla.Volumetric.Mesh
Unit Gorilla.Volumetric.Mesh.pasClasses
- TGorillaVolumetricMeshMaterial = class ( TCustomMaterial )
- TGorillaVolumetricMeshMaterialSource = class ( TMaterialSource )
- TGorillaVolumetricMesh = class ( TGorillaMesh )
Records
- record TNRRDHeader
Enumerations
- enum TGorillaVolumetricMeshSize = ( vms4x4x4, vms8x8x8, vms16x16x16, vms32x32x32, vms64x64x64, vms128x128x128, vms256x256x256, vms512x512x512, vms768x768x768, vms1024x1024x1024, vmsCustom ) ;
- enum TGorillaVolumetricMeshDataType = ( vmdtUInt8, vmdtUInt16, vmdtHalfFloat, vmdtFloat ) ;
- enum TGorillaVolumetricMeshByteOrder = ( vmboLittleEndian, vmboBigEndian ) ;
- enum TGorillaVolumetricMeshEncoding = ( vmeRAW ) ;
- enum TGorillaVolumetricMeshShape = ( vmsCube, vmsSphere, vmsCylinder ) ;
- enum TGorillaVolumetricGamutMode = ( GamutNone, GamutByValue, GamutByValueMultiply, GamutBySum, GamutBySumMultiply ) ;
Constants
- const GORILLA_VOLUMETRIC_MESH_SIZES : array[0..10] of Integer = ;
- const GORILLA_VOLUMETRIC_MESH_DATASIZE : array[0..3] of Integer = ;
TGorillaVolumetricMeshSize
Fixed volumetric mesh data sizes with equal size for width, height and depth. To set a custom size, for example with different depth, use "vmsCustom" and set "CustomSize" or "CustomWidth"/"CustomHeight"/"CustomDepth" properties.
TGorillaVolumetricMeshDataType
Type that defines the data size of each voxel inside of the provided 3D data.
TGorillaVolumetricMeshByteOrder
Depending on the provided raw data, sometimes a byte order swap is necessary.
TGorillaVolumetricMeshEncoding
Type to define binary raw data. Currently only uncompressed data is supported.
TGorillaVolumetricMeshShape
Type to define the surrounding rendered shape. This will affect the 3D ray projection. Default value is a cubic shape.
TGorillaVolumetricGamutMode
The gamut mode defines how values are applied to gamut texture
Remarks
GamutNone - gamut rendering is disabled
GamutByValue - gamut value will be applied by each value read from 3d-data.
GamutByValueMultiply - gamut value will be applied by each value read from 3d-data and multiplied with the original 3d-data value.
GamutBySum - gamut value will be applied to the final raytraced value.
GamutBySumMultiply - gamut value will be applied to the final raytraced value and multiplied with the original 3d-data value.
TNRRDHeader
TGorillaVolumetricMeshMaterial
The basic render material defining raymarching shaders and holding all necessary properties. TGorillaVolumetricMeshMaterialSource and TGorillaVolumetricMesh will access those properties by wrapping methods.
Ancestors
Members
Fields
- protected FPixelShaderFloat :
TContextShader
- protected FSource :
TGorillaVolumetricMeshMaterialSource
- protected FSizes :
TGorillaVolumetricMeshSize
- protected FDataType :
TGorillaVolumetricMeshDataType
- protected FSpacings :
TPoint3D
- protected FDetails :
Single
- protected FRayLimits :
TPoint
- protected FTexture :
TTexture
- protected FOverlay :
TTexture
- protected FGamut :
TTexture
- protected FGamutMode :
TGorillaVolumetricGamutMode
- protected FGamutFactor :
Single
- protected FCustomSize :
TSize3D
- protected FClippingPlane :
TPlaneF
Methods
- public constructor Create ( const ASource : TGorillaVolumetricMeshMaterialSource ) ;
- public destructor Destroy ( ) ;
- protected function GetCustomWidth ( ) : Integer ;
- protected procedure SetCustomWidth ( AValue : Integer ) ;
- protected function GetCustomHeight ( ) : Integer ;
- protected procedure SetCustomHeight ( AValue : Integer ) ;
- protected function GetCustomDepth ( ) : Integer ;
- protected procedure SetCustomDepth ( AValue : Integer ) ;
- protected function GetSizes ( ) : TGorillaVolumetricMeshSize ;
- protected procedure SetSizes ( AValue : TGorillaVolumetricMeshSize ) ;
- protected function GetDataType ( ) : TGorillaVolumetricMeshDataType ;
- protected procedure SetDataType ( AValue : TGorillaVolumetricMeshDataType ) ;
- protected function GetSpacings ( ) : TPoint3D ;
- protected procedure SetSpacings ( AValue : TPoint3D ) ;
- protected function GetDetails ( ) : Single ;
- protected procedure SetDetails ( const AValue : Single ) ;
- protected function GetRayLimits ( ) : TPoint ;
- protected procedure SetRayLimits ( const AValue : TPoint ) ;
- protected procedure SetTexture ( const Value : TTexture ) ;
- protected procedure SetOverlay ( const Value : TTexture ) ;
- protected procedure SetGamut ( const Value : TTexture ) ;
- protected procedure SetGamutMode ( const AValue : TGorillaVolumetricGamutMode ) ;
- protected procedure SetGamutFactor ( const AValue : Single ) ;
- protected procedure DoApply ( const Context : TContext3D ) ; override;
- protected procedure DoInitialize ( ) ; override;
Properties
- public Sizes : TGorillaVolumetricMeshSize
- public CustomWidth : Integer
- public CustomHeight : Integer
- public CustomDepth : Integer
- public CustomSize : TSize3D
- public DataType : TGorillaVolumetricMeshDataType
- public Spacings : TPoint3D
- public Details : Single
- public RayLimits : TPoint
- public Texture : TTexture
- public Overlay : TTexture
- public Gamut : TTexture
- public GamutMode : TGorillaVolumetricGamutMode
- public GamutFactor : Single
- public ClippingPlane : TPlaneF
TGorillaVolumetricMeshMaterialSource
A material source setting up the final material shader. This is an embedded material source which will automatically be created by the TGorillaVolumetricMesh component.
Ancestors
Members
Fields
- protected FTexture :
TGorillaTextureBitmap
- protected FOverlay :
TGorillaTextureBitmap
- protected FGamut :
TGorillaTextureBitmap
- protected FContextResetOvrId :
Integer
- protected FIsUpdatingTexture :
Integer
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected function CreateMaterial ( ) : TMaterial ; override;
- protected procedure DoTextureChanged ( Sender : TObject ) ; virtual;
- protected procedure DoOverlayChanged ( Sender : TObject ) ; virtual;
- protected procedure DoGamutChanged ( Sender : TObject ) ; virtual;
- protected procedure ContextResetHandlerOverride ( const Sender : TObject; const Msg : TMessageBase ) ; virtual;
- protected procedure UpdateTexture ( ) ;
- protected function GetCustomWidth ( ) : Integer ;
- protected procedure SetCustomWidth ( AValue : Integer ) ;
- protected function GetCustomHeight ( ) : Integer ;
- protected procedure SetCustomHeight ( AValue : Integer ) ;
- protected function GetCustomDepth ( ) : Integer ;
- protected procedure SetCustomDepth ( AValue : Integer ) ;
- protected function GetCustomSize ( ) : TSize3D ;
- protected procedure SetCustomSize ( AValue : TSize3D ) ;
- protected function GetSizes ( ) : TGorillaVolumetricMeshSize ;
- protected procedure SetSizes ( AValue : TGorillaVolumetricMeshSize ) ;
- protected function GetDataType ( ) : TGorillaVolumetricMeshDataType ;
- protected procedure SetDataType ( AValue : TGorillaVolumetricMeshDataType ) ;
- protected function GetSpacings ( ) : TPoint3D ;
- protected procedure SetSpacings ( AValue : TPoint3D ) ;
- protected function GetDetails ( ) : Single ;
- protected procedure SetDetails ( const AValue : Single ) ;
- protected function GetRayLimits ( ) : TPoint ;
- protected procedure SetRayLimits ( const AValue : TPoint ) ;
- protected function GetTexture ( ) : TBitmap ;
- protected procedure SetTexture ( AValue : TBitmap ) ;
- protected function GetOverlay ( ) : TBitmap ;
- protected procedure SetOverlay ( AValue : TBitmap ) ;
- protected function GetGamut ( ) : TBitmap ;
- protected procedure SetGamut ( AValue : TBitmap ) ;
- protected function GetGamutMode ( ) : TGorillaVolumetricGamutMode ;
- protected procedure SetGamutMode ( AValue : TGorillaVolumetricGamutMode ) ;
- protected function GetGamutFactor ( ) : Single ;
- protected procedure SetGamutFactor ( const AValue : Single ) ;
- protected function GetClippingPlane ( ) : TPlaneF ;
- protected procedure SetClippingPlane ( AValue : TPlaneF ) ;
- public procedure BeginUpdate ( ) ;
- public procedure EndUpdate ( ) ;
Properties
- public Spacings : TPoint3D
- public CustomSize : TSize3D
- public RayLimits : TPoint
- public ClippingPlane : TPlaneF
- published Sizes : TGorillaVolumetricMeshSize
- published CustomWidth : Integer
- published CustomHeight : Integer
- published CustomDepth : Integer
- published DataType : TGorillaVolumetricMeshDataType
- published Details : Single
- published Texture : TBitmap
- published Overlay : TBitmap
- published Gamut : TBitmap
- published GamutMode : TGorillaVolumetricGamutMode
- published GamutFactor : Single
TGorillaVolumetricMesh
A volumetric mesh renders texture 3D data, f.e. from CT or MRT scans. It needs pre render passes for front and back face detection. It uses ray marching technique for rendering.
Ancestors
Members
Fields
- protected FShape :
TGorillaVolumetricMeshShape
- protected FMaterial :
TGorillaVolumetricMeshMaterialSource
- protected FFrontFace :
TGorillaRenderPassController
- protected FBackFace :
TGorillaRenderPassController
Methods
- public constructor Create ( AOwner : TComponent ) ;
- public destructor Destroy ( ) ;
- protected function GetFrontFaceRenderPass ( ) : TGorillaRenderPassController ;
- protected procedure SetFrontFaceRenderPass ( const AValue : TGorillaRenderPassController ) ;
- protected function GetBackFaceRenderPass ( ) : TGorillaRenderPassController ;
- protected procedure SetBackFaceRenderPass ( const AValue : TGorillaRenderPassController ) ;
- protected function GetShape ( ) : TGorillaVolumetricMeshShape ;
- protected procedure SetShape ( AValue : TGorillaVolumetricMeshShape ) ;
- protected function GetCustomWidth ( ) : Integer ;
- protected procedure SetCustomWidth ( AValue : Integer ) ;
- protected function GetCustomHeight ( ) : Integer ;
- protected procedure SetCustomHeight ( AValue : Integer ) ;
- protected function GetCustomDepth ( ) : Integer ;
- protected procedure SetCustomDepth ( AValue : Integer ) ;
- protected function GetCustomSize ( ) : TSize3D ;
- protected procedure SetCustomSize ( AValue : TSize3D ) ;
- protected function GetSizes ( ) : TGorillaVolumetricMeshSize ;
- protected procedure SetSizes ( AValue : TGorillaVolumetricMeshSize ) ;
- protected function GetDataType ( ) : TGorillaVolumetricMeshDataType ;
- protected procedure SetDataType ( AValue : TGorillaVolumetricMeshDataType ) ;
- protected function GetSpacings ( ) : TPoint3D ;
- protected procedure SetSpacings ( AValue : TPoint3D ) ;
- protected function GetDetails ( ) : Single ;
- protected procedure SetDetails ( const AValue : Single ) ;
- protected function GetRayLimits ( ) : TPoint ;
- protected procedure SetRayLimits ( const AValue : TPoint ) ;
- protected function GetOverlay ( ) : TBitmap ;
- protected procedure SetOverlay ( AValue : TBitmap ) ;
- protected function GetGamut ( ) : TBitmap ;
- protected procedure SetGamut ( AValue : TBitmap ) ;
- protected function GetGamutMode ( ) : TGorillaVolumetricGamutMode ;
- protected procedure SetGamutMode ( AValue : TGorillaVolumetricGamutMode ) ;
- protected function GetGamutFactor ( ) : Single ;
- protected procedure SetGamutFactor ( const AValue : Single ) ;
- protected function GetClippingPlane ( ) : TPlaneF ;
- protected procedure SetClippingPlane ( AValue : TPlaneF ) ;
- protected procedure Render ( ) ; override;
- protected procedure RebuildMesh ( ) ;
- protected procedure CreateStaticBuffer ( ) ;
- protected procedure Notification ( AComponent : TComponent; Operation : TOperation ) ; override;
- protected procedure DoReadNRRDHeader
(
AStream :
TStream; out
AHeader :
TNRRDHeader
)
;
class virtual;
Tries to read the NRRD file header from a supplied stream. The method will start to read from current stream position and will NOT restore the original position. It's intended to then read from current position the raw data.
- protected procedure DefineProperties ( Filer : TFiler ) ; override;
- protected procedure ReadSpacingsPoint ( Reader : TReader ) ;
- protected procedure WriteSpacingsPoint ( Writer : TWriter ) ;
- protected procedure ReadRayLimitsPoint ( Reader : TReader ) ;
- protected procedure WriteRayLimitsPoint ( Writer : TWriter ) ;
- protected procedure ReadClippingPlaneVector ( Reader : TReader ) ;
- protected procedure WriteClippingPlaneVector ( Writer : TWriter ) ;
- public function TryReadNRRDHeader ( AStream : TStream; out AHeader : TNRRDHeader ) : Boolean ; class;
- public procedure BeginUpdate ( ) ; override;
- public procedure EndUpdate ( ) ; override;
- public function GetSizeAsVector ( ) : TPoint3D ;
- public procedure LoadFromRawFile ( const AFileName : string; const AWidth : Integer; const AHeight : Integer; const ADepth : Integer; const ASrcDataType : TGorillaVolumetricMeshDataType; const AByteOrder : TGorillaVolumetricMeshByteOrder = vmboLittleEndian ) ; virtual;
- public procedure LoadFromRawStream ( const AStream : TStream; const AWidth : Integer; const AHeight : Integer; const ADepth : Integer; const ASrcDataType : TGorillaVolumetricMeshDataType; const AByteOrder : TGorillaVolumetricMeshByteOrder = vmboLittleEndian ) ; virtual;
- public procedure LoadFromNRRDFile ( const AFileName : string; const AByteOrder : TGorillaVolumetricMeshByteOrder = vmboLittleEndian ) ; virtual;
- public procedure LoadFromNRRDStream ( const AStream : TStream; const AByteOrder : TGorillaVolumetricMeshByteOrder = vmboLittleEndian ) ; virtual;
Properties
- published Shape : TGorillaVolumetricMeshShape
- published FrontFaceRenderPass : TGorillaRenderPassController
Get or set a pre render pass for getting front face vertex positions. Those vertex data is used for starting position of ray marching algorithm.
read GetFrontFaceRenderPass
write SetFrontFaceRenderPass - published BackFaceRenderPass : TGorillaRenderPassController
Get or set a pre render pass for getting back face vertex positions. Those vertex data is used for defining the end position of ray marching algorithm.
read GetBackFaceRenderPass
write SetBackFaceRenderPass - published Sizes : TGorillaVolumetricMeshSize
- published CustomWidth : Integer
If Sizes is set to TGorillaVolumetricMeshSize.vmsCustom, you are able to set an individual width, height and depth slices value.
read GetCustomWidth
write SetCustomWidth - published CustomHeight : Integer
If Sizes is set to TGorillaVolumetricMeshSize.vmsCustom, you are able to set an individual width, height and depth slices value.
read GetCustomHeight
write SetCustomHeight - published CustomDepth : Integer
If Sizes is set to TGorillaVolumetricMeshSize.vmsCustom, you are able to set an individual width, height and depth slices value.
read GetCustomDepth
write SetCustomDepth - published CustomSize : TSize3D
If Sizes is set to TGorillaVolumetricMeshSize.vmsCustom, you are able to get or set and individual width, height and depth for slices.
read GetCustomSize
write SetCustomSize - published DataType : TGorillaVolumetricMeshDataType
- published Spacings : TPoint3D
Get or set the spacings between each layer of texture 3D data. Some CT or MRT scans provide compressed data, which needs to be resolved at rendering time with spaces between voxels. This value is stored as "SpacingsPoint" in DFM file.
read GetSpacings
write SetSpacings - published Details : Single
Get or set level of detail for ray marching algorithm. Higher values mean more detail, but also more GPU usage.
read GetDetails
write SetDetails - published RayLimits : TPoint
Get or set the limits of ray thrown at the volume. The X value represents the front offset and Y defines the reduction at the back from max. ray length. This value is stored as "RayLimitsPoint" in DFM file.
read GetRayLimits
write SetRayLimits - published Overlay : TBitmap
Get or set an overlay texture, which will be rendered above the volumetric 3D data.
read GetOverlay
write SetOverlay - published Gamut : TBitmap
- published GamutMode : TGorillaVolumetricGamutMode
Get or set gamut mode, which defines how values are applied to gamut texture.
read GetGamutMode
write SetGamutMode - published GamutFactor : Single
Get or set the gamut color value factor. This value will be applied to the original 3d-data value before mapping it onto the gamut texture.
read GetGamutFactor
write SetGamutFactor - published ClippingPlane : TPlaneF
Get or set a clipping plane to support slice selection in a specific direction. This value is stored as "ClippingPlaneVector" in DFM file.
read GetClippingPlane
write SetClippingPlane