vtkImageDataOutlineFilter - A filter that generates oriented outline for vtkImageData.
vtkImageDataOutlineFilter is a filter that generates a wireframe or triangulated rectangular-cuboid as an outline of an input vtkImageData. It takes into account the orientation / DirectionMatrix of the image, so the output outline may not be axes aligned.
Methods
extend
Method used to decorate a given object (publicAPI+model) with vtkImageDataOutlineFilter characteristics.
Argument
Type
Required
Description
publicAPI
Yes
object on which methods will be bounds (public)
model
Yes
object on which data structure will be bounds (protected)
initialValues
IImageDataOutlineFilterInitialValues
No
(default: {})
getGenerateFaces
Flag that indicates whether the output will generate faces of the outline.
Returns
Type
Description
boolean
getGenerateLines
Flag that indicates whether the output will generate wireframe lines of the outline.
Returns
Type
Description
boolean
newInstance
Method used to create a new instance of vtkImageDataOutlineFilter
Argument
Type
Required
Description
initialValues
IImageDataOutlineFilterInitialValues
No
for pre-setting some of its content
requestData
Argument
Type
Required
Description
inData
Yes
outData
Yes
setGenerateFaces
Flag to indicate that the output should generate triangulated faces of the outline.
Argument
Type
Required
Description
generateFaces
boolean
Yes
setGenerateLines
Flag to indicate that the output should generate wireframe of the outline.
/** * Flag that indicates whether the output will generate faces of the outline. * @returns {boolean} */ getGenerateFaces(): boolean;
/** * Flag that indicates whether the output will generate wireframe lines of the outline. * @returns {boolean} */ getGenerateLines(): boolean;
/** * Flag to indicate that the output should generate wireframe of the outline. * @param {boolean} generateLines */ setGenerateLines(generateLines: boolean): boolean;
/** * Flag to indicate that the output should generate triangulated faces of the outline. * @param {boolean} generateFaces */ setGenerateFaces(generateFaces: boolean): boolean; }
/** * Method used to decorate a given object (publicAPI+model) with * vtkImageDataOutlineFilter characteristics. * * @param publicAPI object on which methods will be bounds (public) * @param model object on which data structure will be bounds (protected) * @param {IImageDataOutlineFilterInitialValues} [initialValues] (default: {}) */ exportfunctionextend( publicAPI: object, model: object, initialValues?: IImageDataOutlineFilterInitialValues ): void;
/** * Method used to create a new instance of vtkImageDataOutlineFilter * @param {IImageDataOutlineFilterInitialValues} [initialValues] for pre-setting some of its content */ exportfunctionnewInstance( initialValues?: IImageDataOutlineFilterInitialValues ): vtkImageDataOutlineFilter;
/** * vtkImageDataOutlineFilter - A filter that generates oriented outline for * vtkImageData. * * vtkImageDataOutlineFilter is a filter that generates a wireframe or * triangulated rectangular-cuboid as an outline of an input vtkImageData. * It takes into account the orientation / DirectionMatrix of the image, so the * output outline may not be axes aligned. * */ export declare constvtkImageDataOutlineFilter: { newInstance: typeof newInstance; extend: typeof extend; }; exportdefault vtkImageDataOutlineFilter;
if (!input || !input.isA('vtkImageData')) { vtkErrorMacro('Invalid or missing input'); return; }
// First create a cube polydata in the index-space of the image. // The benefit of using `getSpatialExtent` call is that it automatically // takes care of 0.5 voxel padding as required by an vtkImageData representation. const spatialExt = input.getSpatialExtent(); if (!spatialExt) { vtkErrorMacro('Unable to fetch spatial extents of input image.'); return; }
model._cubeSource.setBounds(spatialExt);
// Then apply index-to-world transform to the cube to create the outline. model._cubeSource.setMatrix(input.getIndexToWorld()); outData[0] = model._cubeSource.getOutputData(); };