public class VtkUtil extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
VTK_BIT |
static int |
VTK_CHAR |
static int |
VTK_CUBIC_INTERPOLATION |
static int |
VTK_DOUBLE |
static int |
VTK_FLOAT |
static int |
VTK_FLY_CLOSEST_TRIAD |
static int |
VTK_FLY_FURTHEST_TRIAD |
static int |
VTK_FLY_OUTER_EDGES |
static int |
VTK_FLY_STATIC_EDGES |
static int |
VTK_FLY_STATIC_TRIAD |
static int |
VTK_GRID_LINES_ALL |
static int |
VTK_GRID_LINES_CLOSEST |
static int |
VTK_GRID_LINES_FURTHEST |
static int |
VTK_ID |
static int |
VTK_INT |
static int |
VTK_LINEAR_INTERPOLATION |
static int |
VTK_LONG |
static int |
VTK_NEAREST_INTERPOLATION |
static int |
VTK_SHORT |
static int |
VTK_SIGNED_CHAR |
static int |
VTK_TICKS_BOTH |
static int |
VTK_TICKS_INSIDE |
static int |
VTK_TICKS_OUTSIDE |
static int |
VTK_UNSIGNED_CHAR |
static int |
VTK_UNSIGNED_INT |
static int |
VTK_UNSIGNED_LONG |
static int |
VTK_UNSIGNED_SHORT |
static int |
VTK_VOID |
Constructor and Description |
---|
VtkUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
addActor(vtk.vtkRenderer renderer,
vtk.vtkActor actor)
Deprecated.
Use
addProp(vtkRenderer, vtkProp) instead. |
static void |
addActor2D(vtk.vtkRenderer renderer,
vtk.vtkActor2D actor)
Deprecated.
Use
addProp(vtkRenderer, vtkProp) instead. |
static void |
addProp(vtk.vtkRenderer renderer,
vtk.vtkProp prop)
Add an actor (vtkProp) to the specified renderer.
|
static void |
addProps(vtk.vtkRenderer renderer,
vtk.vtkProp[] props)
Add an array of actor (vtkProp) to the specified renderer.
|
static boolean |
findActor(vtk.vtkRenderer renderer,
vtk.vtkActor actor)
Deprecated.
Use
hasProp(vtkRenderer, vtkProp) instead. |
static boolean |
findActor2D(vtk.vtkRenderer renderer,
vtk.vtkActor2D actor)
Deprecated.
Use
hasProp(vtkRenderer, vtkProp) instead. |
static boolean |
findProp(vtk.vtkRenderer renderer,
vtk.vtkProp actor)
Deprecated.
Use
hasProp(vtkRenderer, vtkProp) instead. |
static vtk.vtkColorTransferFunction |
getBinaryColorMap(java.awt.Color color)
Creates and returns a binary color map in
vtkColorTransferFunction format where 0 value is black and 1 is
set to specified color. |
static vtk.vtkImageData |
getBinaryImageData(ROI roi,
int sz,
int t)
Creates and returns a 3D binary (0/1 values)
vtkImageData object corresponding to the ROI 3D boolean mask
(C dimension is not considered) at specified T position. |
static vtk.vtkImageData |
getBinaryImageData(vtk.vtkPolyData polyData,
double[] space)
Transforms a
vtkPolyData object to binary (0/1 values) vtkImageData |
static vtk.vtkPiecewiseFunction |
getBinaryOpacityMap(double opacity)
Creates and returns a binary opacity map in
vtkPiecewiseFunction format where 0 is 100% transparent and 1
to the specified opacity value. |
static BooleanMask3D |
getBooleanMaskFromBinaryImage(vtk.vtkImageData image,
boolean optimizeBounds)
Returns a
BooleanMask3D from a binary (0/1 values) vtkImageData . |
static vtk.vtkCellArray |
getCells(int numCell,
int[] cells)
Get vtkCellArray from a 1D prepared cells array ( {n, i1, i2, ..., n, i1, i2,...} )
|
static vtk.vtkColorTransferFunction |
getColorMap(LUT.LUTChannel lutChannel)
Creates and returns the color map in
vtkColorTransferFunction format from the
specified LUT.LUTChannel . |
static vtk.vtkDoubleArray |
getDoubleArray(double[] array) |
static vtk.vtkFloatArray |
getFloatArray(float[] array) |
static vtk.vtkIdTypeArray |
getIdTypeArray(int[] array) |
static vtk.vtkImageData |
getImageData(java.lang.Object data,
DataType dataType,
int sizeX,
int sizeY,
int sizeZ,
int sizeC)
Creates and returns a
vtkImageData object from the specified 1D array data. |
static vtk.vtkImageData |
getImageData(Sequence sequence,
int posT,
int posC)
Build and return volume image data from given Sequence object.
|
static vtk.vtkIntArray |
getIntArray(int[] array) |
static java.lang.Object |
getJavaArray(vtk.vtkDataArray dataArray)
Returns a native java array from the specified
vtkDataArray . |
static int[] |
getJavaArray(vtk.vtkIdTypeArray array) |
static vtk.vtkProp[] |
getLayerProps(Layer layer)
Returns the vtkProp from the specified Layer object.
|
static vtk.vtkProp[] |
getLayersProps(java.util.List<Layer> layers)
Returns all vtkProp from the specified list of Layer object.
|
static vtk.vtkLongArray |
getLongArray(long[] array) |
static vtk.vtkPiecewiseFunction |
getOpacityMap(LUT.LUTChannel lutChannel)
Creates and returns the opacity map in
vtkPiecewiseFunction format from the specified LUT.LUTChannel . |
static vtk.vtkPolyData |
getOutline(double xMin,
double xMax,
double yMin,
double yMax,
double zMin,
double zMax)
Returns a cube polydata object representing the specified bounding box coordinate
|
static vtk.vtkPoints |
getPoints(double[] points)
Get vtkPoints from double[]
|
static vtk.vtkPoints |
getPoints(double[][] points)
Get vtkPoints from double[][3]
|
static vtk.vtkPoints |
getPoints(float[] points)
Get vtkPoints from float[]
|
static vtk.vtkPoints |
getPoints(float[][] points)
Get vtkPoints from float[][3]
|
static vtk.vtkPoints |
getPoints(int[] points)
Get vtkPoints from int[]
|
static vtk.vtkPoints |
getPoints(int[][] points)
Get vtkPoints from int[][3]
|
static vtk.vtkPolyData |
getPolyDataFromDataSet(vtk.vtkDataSet dataSet)
Returns a
vtkPolyData from vtkDataSet |
static vtk.vtkPolyData |
getPolyDataFromPoints(vtk.vtkPoints points)
Returns a simple cell
vtkPolyData from vtkPoints |
static vtk.vtkProp[] |
getProps(vtk.vtkRenderer renderer)
Return all actor / view prop from the specified renderer
|
static ROI |
getROIFromBinaryImage(vtk.vtkImageData image,
boolean force3DROI)
Deprecated.
Uses
#getBooleanMaskFromBinaryImage(vtkImageData) then ROI3DArea.ROI3DArea(BooleanMask3D) instead. |
static vtk.vtkShortArray |
getShortArray(short[] array) |
static vtk.vtkPolyData |
getSurfaceFromImage(vtk.vtkImageData imageData,
double threshold)
Create a 3D surface in VTK polygon format from the input VTK image data.
|
static vtk.vtkPolyData |
getSurfaceFromOBJ(java.lang.String objPath)
Read a OBJ 3D model file and returns it in VTK mesh format (
vtkPolyData ) |
static vtk.vtkTransform |
getTransform(double[] off,
double[] scale,
double[] rot)
Get VTK transform object from specified transform infos
|
static vtk.vtkUnsignedCharArray |
getUCharArray(byte[] array) |
static vtk.vtkUnsignedIntArray |
getUIntArray(int[] array) |
static vtk.vtkUnsignedLongArray |
getULongArray(long[] array) |
static vtk.vtkUnsignedShortArray |
getUShortArray(short[] array) |
static vtk.vtkDataArray |
getVtkArray(java.lang.Object array,
boolean signed) |
static int |
getVtkType(DataType type)
Returns the VTK type corresponding to the specified DataType
|
static boolean |
hasProp(vtk.vtkRenderer renderer,
vtk.vtkProp actor)
Return true if the renderer contains the specified actor / view prop
|
static vtk.vtkImageData |
polyDataToImageData(vtk.vtkPolyData polyData,
double[] space)
Deprecated.
Use
getBinaryImageData(vtkPolyData, double[]) instead. |
static int[] |
prepareCells(int[][] indexes)
Return a 1D cells array from a 2D indexes array
|
static int[] |
prepareCells(int numVertexPerCell,
int[] indexes)
Return a 1D cells array from a 1D indexes array and num vertex per cell (polygon)
|
static void |
removeProp(vtk.vtkRenderer renderer,
vtk.vtkProp actor)
Remove an actor from the specified renderer.
|
static boolean |
setOutlineBounds(vtk.vtkPolyData outline,
double xMin,
double xMax,
double yMin,
double yMax,
double zMin,
double zMax,
VtkCanvas canvas)
Set the bounds of specified outline polydata object (previously created with VtkUtil.getOutline(..)
|
static void |
setPolyDataColor(vtk.vtkPolyData polyData,
java.awt.Color color,
VtkCanvas canvas)
Set the Color of the specified
vtkPolyData object. |
static vtk.vtkPolyData |
transformPolyData(vtk.vtkPolyData polyData,
double[] off,
double[] scale,
double[] rot)
Transform a polyData using specified rotation, scaling and offset informations (3D)
|
static vtk.vtkPolyData |
transformPolyData(vtk.vtkPolyData polyData,
vtk.vtkAbstractTransform transform)
Transform a polyData using specified rotation, scaling and offset informations
|
static vtk.vtkObject[] |
vtkCollectionToArray(vtk.vtkCollection collection)
Transforms a vtkCollection to an array
|
static void |
vtkGC()
VTK forced garbage collection
|
public static final int VTK_VOID
public static final int VTK_BIT
public static final int VTK_CHAR
public static final int VTK_SIGNED_CHAR
public static final int VTK_UNSIGNED_CHAR
public static final int VTK_SHORT
public static final int VTK_UNSIGNED_SHORT
public static final int VTK_INT
public static final int VTK_UNSIGNED_INT
public static final int VTK_LONG
public static final int VTK_UNSIGNED_LONG
public static final int VTK_FLOAT
public static final int VTK_DOUBLE
public static final int VTK_ID
public static final int VTK_NEAREST_INTERPOLATION
public static final int VTK_LINEAR_INTERPOLATION
public static final int VTK_CUBIC_INTERPOLATION
public static final int VTK_FLY_OUTER_EDGES
public static final int VTK_FLY_CLOSEST_TRIAD
public static final int VTK_FLY_FURTHEST_TRIAD
public static final int VTK_FLY_STATIC_TRIAD
public static final int VTK_FLY_STATIC_EDGES
public static final int VTK_TICKS_INSIDE
public static final int VTK_TICKS_OUTSIDE
public static final int VTK_TICKS_BOTH
public static final int VTK_GRID_LINES_ALL
public static final int VTK_GRID_LINES_CLOSEST
public static final int VTK_GRID_LINES_FURTHEST
public VtkUtil()
public static int getVtkType(DataType type)
public static vtk.vtkDataArray getVtkArray(java.lang.Object array, boolean signed)
public static vtk.vtkUnsignedCharArray getUCharArray(byte[] array)
public static vtk.vtkUnsignedShortArray getUShortArray(short[] array)
public static vtk.vtkUnsignedIntArray getUIntArray(int[] array)
public static vtk.vtkUnsignedLongArray getULongArray(long[] array)
public static vtk.vtkShortArray getShortArray(short[] array)
public static vtk.vtkIntArray getIntArray(int[] array)
public static vtk.vtkLongArray getLongArray(long[] array)
public static vtk.vtkFloatArray getFloatArray(float[] array)
public static vtk.vtkDoubleArray getDoubleArray(double[] array)
public static vtk.vtkIdTypeArray getIdTypeArray(int[] array)
public static java.lang.Object getJavaArray(vtk.vtkDataArray dataArray)
vtkDataArray
.public static int[] getJavaArray(vtk.vtkIdTypeArray array)
public static vtk.vtkObject[] vtkCollectionToArray(vtk.vtkCollection collection)
public static vtk.vtkPoints getPoints(double[] points)
public static vtk.vtkPoints getPoints(double[][] points)
public static vtk.vtkPoints getPoints(float[] points)
public static vtk.vtkPoints getPoints(float[][] points)
public static vtk.vtkPoints getPoints(int[] points)
public static vtk.vtkPoints getPoints(int[][] points)
public static vtk.vtkCellArray getCells(int numCell, int[] cells)
public static vtk.vtkPolyData getPolyDataFromPoints(vtk.vtkPoints points)
vtkPolyData
from vtkPoints
public static vtk.vtkPolyData getPolyDataFromDataSet(vtk.vtkDataSet dataSet)
vtkPolyData
from vtkDataSet
public static vtk.vtkProp[] getLayerProps(Layer layer)
null
or does not contains any vtkProp.public static vtk.vtkProp[] getLayersProps(java.util.List<Layer> layers)
public static vtk.vtkProp[] getProps(vtk.vtkRenderer renderer)
public static boolean hasProp(vtk.vtkRenderer renderer, vtk.vtkProp actor)
@Deprecated public static boolean findProp(vtk.vtkRenderer renderer, vtk.vtkProp actor)
hasProp(vtkRenderer, vtkProp)
instead.@Deprecated public static boolean findActor(vtk.vtkRenderer renderer, vtk.vtkActor actor)
hasProp(vtkRenderer, vtkProp)
instead.@Deprecated public static boolean findActor2D(vtk.vtkRenderer renderer, vtk.vtkActor2D actor)
hasProp(vtkRenderer, vtkProp)
instead.public static void addProp(vtk.vtkRenderer renderer, vtk.vtkProp prop)
@Deprecated public static void addActor(vtk.vtkRenderer renderer, vtk.vtkActor actor)
addProp(vtkRenderer, vtkProp)
instead.@Deprecated public static void addActor2D(vtk.vtkRenderer renderer, vtk.vtkActor2D actor)
addProp(vtkRenderer, vtkProp)
instead.public static void addProps(vtk.vtkRenderer renderer, vtk.vtkProp[] props)
public static void removeProp(vtk.vtkRenderer renderer, vtk.vtkProp actor)
public static int[] prepareCells(int[][] indexes)
public static int[] prepareCells(int numVertexPerCell, int[] indexes)
public static BooleanMask3D getBooleanMaskFromBinaryImage(vtk.vtkImageData image, boolean optimizeBounds)
BooleanMask3D
from a binary (0/1 values) vtkImageData
.public static ROI getROIFromBinaryImage(vtk.vtkImageData image, boolean force3DROI)
#getBooleanMaskFromBinaryImage(vtkImageData)
then ROI3DArea.ROI3DArea(BooleanMask3D)
instead.public static vtk.vtkImageData getImageData(Sequence sequence, int posT, int posC) throws TooLargeArrayException, java.lang.OutOfMemoryError
sequence
- the sequence object we want to get volume image dataposT
- frame indexposC
- channel index (-1 for all channel)TooLargeArrayException
java.lang.OutOfMemoryError
public static vtk.vtkImageData getImageData(java.lang.Object data, DataType dataType, int sizeX, int sizeY, int sizeZ, int sizeC)
vtkImageData
object from the specified 1D array data.public static vtk.vtkPolyData getSurfaceFromImage(vtk.vtkImageData imageData, double threshold)
imageData
- the input image to construct surface fromthreshold
- the threshold intensity value used to build the surfacepublic static vtk.vtkImageData getBinaryImageData(ROI roi, int sz, int t) throws java.lang.IllegalArgumentException
vtkImageData
object corresponding to the ROI 3D boolean mask
(C dimension is not considered) at specified T position.roi
- the roi we want to retrieve the vtkImageData masksz
- the Z size to use for ROI with infinite Z dimension (if ROI has a finite Z dimension then ROI Z size is
used).t
- the T position we want to retrieve the 3D mask datajava.lang.IllegalArgumentException
public static vtk.vtkImageData getBinaryImageData(vtk.vtkPolyData polyData, double[] space)
vtkPolyData
object to binary (0/1 values) vtkImageData
space
- spacing between each image point@Deprecated public static vtk.vtkImageData polyDataToImageData(vtk.vtkPolyData polyData, double[] space)
getBinaryImageData(vtkPolyData, double[])
instead.public static vtk.vtkTransform getTransform(double[] off, double[] scale, double[] rot)
public static vtk.vtkPolyData transformPolyData(vtk.vtkPolyData polyData, vtk.vtkAbstractTransform transform)
public static vtk.vtkPolyData transformPolyData(vtk.vtkPolyData polyData, double[] off, double[] scale, double[] rot)
public static vtk.vtkPolyData getSurfaceFromOBJ(java.lang.String objPath)
vtkPolyData
)public static vtk.vtkColorTransferFunction getColorMap(LUT.LUTChannel lutChannel)
vtkColorTransferFunction
format from the
specified LUT.LUTChannel
.public static vtk.vtkPiecewiseFunction getOpacityMap(LUT.LUTChannel lutChannel)
vtkPiecewiseFunction
format from the specified LUT.LUTChannel
.public static vtk.vtkColorTransferFunction getBinaryColorMap(java.awt.Color color)
vtkColorTransferFunction
format where 0 value is black and 1 is
set to specified color.public static vtk.vtkPiecewiseFunction getBinaryOpacityMap(double opacity)
vtkPiecewiseFunction
format where 0 is 100% transparent and 1
to the specified opacity value.public static void setPolyDataColor(vtk.vtkPolyData polyData, java.awt.Color color, VtkCanvas canvas)
vtkPolyData
object.polyData
- the vtkPolyData we want to change colorcolor
- the color to setcanvas
- the VtkCanvas object to lock during the color change operation for safety (can be null
if we
don't need to lock the VtkCanvas here)public static vtk.vtkPolyData getOutline(double xMin, double xMax, double yMin, double yMax, double zMin, double zMax)
public static boolean setOutlineBounds(vtk.vtkPolyData outline, double xMin, double xMax, double yMin, double yMax, double zMin, double zMax, VtkCanvas canvas)
canvas
- the VtkCanvas object to lock during the color change operation for safety (can be null
if we
don't need to lock the VtkCanvas here)false
if the specified polydata object is not a valid outline objectgetOutline(double, double, double, double, double, double)
public static void vtkGC()