Skip to content

ImageMarchingSquares ​

Introduction ​

vtkImageMarchingSquares - generate isolines from one slice of a vtkImageData

vtkImageMarchingSquares is a filter that takes a vtkImageData as input and generates, using the marching squares case table, a vtkPolyData containing one polyline per contour value on the selected slice.

Methods ​

extend ​

Method used to decorate a given object (publicAPI+model) with vtkImageMarchingSquares characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesIImageMarchingSquaresInitialValuesNo(default: {})

getContourValues ​

Get the list of contour values.

getMergePoints ​

Get whether points shared by neighboring pixels are merged.

getPixelPoints ​

Cache the world coordinates of the four corners of the pixel whose origin is ijk.

ArgumentTypeRequiredDescription
ijkVector3Yesorigin of the pixel
kernelXNumberYesindex of the X element
kernelYNumberYesindex of the Y element
indexToWorldIndexToWorldYes

getPixelScalars ​

Cache the point ids and the scalar values of the four corners of the pixel whose origin is ijk.

ArgumentTypeRequiredDescription
ijkVector3Yesorigin of the pixel
dimsVector3Yesdimensions of the image
scalarsTypedArray or Array[Number]Yes
incrementsVector3YesIJK slice increments
kernelXNumberYesindex of the X element
kernelYNumberYesindex of the Y element

getSlice ​

Get the index of the slice the contours are extracted from.

getSlicingMode ​

Get the index of the axis along which the image is sliced.

newInstance ​

Method used to create a new instance of vtkImageMarchingSquares

ArgumentTypeRequiredDescription
initialValuesIImageMarchingSquaresInitialValuesNofor pre-setting some of its content

produceLines ​

Append the line segments contributed by one pixel to points and lines.

ArgumentTypeRequiredDescription
cValNumberYescontour value
ijkVector3Yesorigin of the pixel
dimsVector3Yesdimensions of the image
scalarsTypedArray or Array[Number]Yes
pointsArray[Number]Yes
linesArray[Number]Yes
incrementsVector3YesIJK slice increments
kernelXNumberYesindex of the X element
kernelYNumberYesindex of the Y element
indexToWorldIndexToWorldYes

requestData ​

ArgumentTypeRequiredDescription
inDataYes
outDataYes

setContourValues ​

Set the list of contour values.

ArgumentTypeRequiredDescription
cValuesArray[Number]Yes

setMergePoints ​

Set whether points shared by neighboring pixels are merged.

ArgumentTypeRequiredDescription
mergePointsBooleanYes

setSlice ​

Set the index of the slice the contours are extracted from.

ArgumentTypeRequiredDescription
sliceNumberYes

setSlicingMode ​

Set the index of the axis along which the image is sliced (0: I, 1: J, 2: K).

ArgumentTypeRequiredDescription
slicingModeNumberYes