Package mgui.geometry.mesh
Class MeshEngine
java.lang.Object
mgui.geometry.mesh.MeshEngine
- All Implemented Interfaces:
AttributeObject,NamedObject,Engine
public class MeshEngine extends java.lang.Object implements Engine
Engine for performing mesh-based algorithms.
TODO: Specify algorithms as method names using reflection..?
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Field Summary
Fields Modifier and Type Field Description static intOPT_VOLUME_EXPDstatic intOPT_VOLUME_MEAN -
Constructor Summary
Constructors Constructor Description MeshEngine() -
Method Summary
Modifier and Type Method Description booleancallMethod(java.lang.String operation, java.lang.String method, java.util.ArrayList<?> params, ProgressUpdater progress)Calls the specified operation/method pair.booleancallMethod(java.lang.String operation, java.lang.String method, ProgressUpdater progress)Calls the specified operation/method pair.booleancomputeMeanCurvature(Mesh3DInt mesh3d, ProgressUpdater progress)Computes the vertex-wise mean curvature of this mesh and stores it in the "target_column" specified it the "Mean Curvature" attributes.voiddecimate(Mesh3D mesh, java.lang.String method)voidDecimateByDistance(Mesh3D mesh, Mesh3D newmesh)Calls the function DecimateByDistance in the MeshFunctions function class, using parameters specified in the AttributeList "Decimate By Distance"voiddecimateSchroeder(Mesh3D mesh)voiddoRoiOperation(Mesh3DInt mesh_int, java.lang.String method, InterfaceProgressBar progress_bar)Runs the ROI operation specified bymethod.Attribute<?>getAttribute(java.lang.String attrName)Returns a specific attribute for this object.AttributeListgetAttributes()Returns the list of current attributes for this object.AttributeListgetAttributes(java.lang.String key)AttributeListgetAttributes(java.lang.String operation, java.lang.String method)Returns the attributes list corresponding to theoperationandmethod.java.lang.ObjectgetAttributeValue(java.lang.String name)Gets the value of attributename, ornullif it does not exist.voidgetMeshParts(Mesh3DInt mesh_int, ShapeSet3DInt shape_set)Creates new mesh objects as a set of non-contiguous meshes frommesh_int, and adds these toshape_set.voidgetMeshParts(Mesh3DInt mesh_int, ShapeSet3DInt shape_set, boolean copy_data, ProgressUpdater progress)Creates new mesh objects as a set of non-contiguous meshes frommesh_int, and adds these toshape_set.java.util.ArrayList<java.lang.String>getMethods(java.lang.String operation)Returns a list of methods implementing a particularoperation.java.lang.StringgetName()Gets the name for this object.java.util.ArrayList<java.lang.String>getOperations()Returns a list of the operations available for thisEngine.voidgetSubMesh(Mesh3DInt mesh, Mesh3DInt newmesh, boolean retain, boolean copydata)voidgetSubMesh(Mesh3DInt mesh, Mesh3DInt newmesh, java.util.ArrayList<MguiNumber> mask, int value, boolean retain, boolean copydata)voidinflateMesh(Mesh3DInt mesh, java.lang.String method, ProgressUpdater progress)voidinflateTRP(Mesh3DInt mesh, ProgressUpdater progress)Volume3DIntmapMeshToVolume(Mesh3DInt mesh, Volume3DInt volume, java.lang.String method, InterfaceProgressBar progress_bar)Volume3DIntmapMeshToVolumeGaussian(Mesh3DInt mesh_int, Volume3DInt volume, InterfaceProgressBar progress_bar)java.util.ArrayList<MguiNumber>mapVolumeToMesh(Mesh3D mesh, Volume3DInt volume, java.lang.String method)java.util.ArrayList<MguiNumber>mapVolumeToMesh(Mesh3D mesh, Volume3DInt volume, java.lang.String method, InterfaceProgressBar progress_bar)voidselectBoundaryNodes(Mesh3DInt mesh_int)voidsetAttribute(java.lang.String attrName, java.lang.Object newValue)Sets a value for a specific attribute.voidsetAttributes(AttributeList thisList)Sets the list of attributes for this object.voidsetName(java.lang.String name)Sets the name for this object.voidSmoothEM(Mesh3DInt mesh)voidSmoothLR(Mesh3D mesh)voidsmoothVertexValuesIsotropicGaussian(Mesh3DInt mesh_int, ProgressUpdater progress)Uses the current parameters for "Smooth vertex values - Isotropic Gaussian" to smooth vertex values with a Gaussian kernel, isotropic in the plane of the surface mesh.voidsplitRoiWithPlane(Mesh3DInt mesh_int, InterfaceProgressBar progress_bar)Splits the ROI defined byroi_valueinto two parts, on either side of the plane defined by the section set and section number.voidSubdivideButterflyScheme(Mesh3DInt mesh)Calls the function SubdivideButterflyScheme in the MeshSubdivision function class, using parameters specified in the AttributeList "Butterfly Scheme".voidsubdivideRois(Mesh3DInt mesh_int, InterfaceProgressBar progress_bar)Subdivide the set of ROIs inmesh_int, by iteratively splitting the largest ROI in half along its narrowest section.booleantransformMesh(Mesh3D mesh, java.lang.String method, InterfaceProgressBar progress_bar)booleantranslateMesh(Mesh3D mesh)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
OPT_VOLUME_MEAN
public static final int OPT_VOLUME_MEAN- See Also:
- Constant Field Values
-
OPT_VOLUME_EXPD
public static final int OPT_VOLUME_EXPD- See Also:
- Constant Field Values
-
-
Constructor Details
-
MeshEngine
public MeshEngine()
-
-
Method Details
-
getAttributes
-
getAttributeValue
public java.lang.Object getAttributeValue(java.lang.String name)Description copied from interface:AttributeObjectGets the value of attributename, ornullif it does not exist.- Specified by:
getAttributeValuein interfaceAttributeObject- Parameters:
name- Name of the attribute- Returns:
- the value of attribute
name, ornullif it does not exist
-
getAttributes
Description copied from interface:EngineReturns the attributes list corresponding to theoperationandmethod.- Specified by:
getAttributesin interfaceEngine- Returns:
- The corresponding attributes, or
nullif no such combination ofoperation/methodexists.
-
getOperations
public java.util.ArrayList<java.lang.String> getOperations()Description copied from interface:EngineReturns a list of the operations available for thisEngine. Operations signify a general operation, which can be implemented through any number of "methods".- Specified by:
getOperationsin interfaceEngine- Returns:
-
getMethods
public java.util.ArrayList<java.lang.String> getMethods(java.lang.String operation)Description copied from interface:EngineReturns a list of methods implementing a particularoperation.- Specified by:
getMethodsin interfaceEngine- Returns:
-
callMethod
public boolean callMethod(java.lang.String operation, java.lang.String method, ProgressUpdater progress)Description copied from interface:EngineCalls the specified operation/method pair. Returnstrueif the operation was successful.- Specified by:
callMethodin interfaceEngine- Parameters:
operation- Operation to perform.method- Method with which to perform operation. Can benullif this operation has no sub-methodsprogress- Optional progress updater (can benull)- Returns:
-
callMethod
public boolean callMethod(java.lang.String operation, java.lang.String method, java.util.ArrayList<?> params, ProgressUpdater progress)Description copied from interface:EngineCalls the specified operation/method pair. Returnstrueif the operation was successful.- Specified by:
callMethodin interfaceEngine- Parameters:
operation- Operation to perform.method- Method with which to perform operation. Can benullif this operation has no sub-methodsparams- A list of additional parameters (not in the attributes) for this methodprogress- Optional progress updater (can benull)- Returns:
-
doRoiOperation
public void doRoiOperation(Mesh3DInt mesh_int, java.lang.String method, InterfaceProgressBar progress_bar) throws MeshFunctionExceptionRuns the ROI operation specified bymethod.- Parameters:
mesh_int-method-progress_bar-- Throws:
MeshFunctionException
-
splitRoiWithPlane
public void splitRoiWithPlane(Mesh3DInt mesh_int, InterfaceProgressBar progress_bar) throws MeshFunctionExceptionSplits the ROI defined byroi_valueinto two parts, on either side of the plane defined by the section set and section number.- Parameters:
mesh_int-progress_bar-- Throws:
MeshFunctionException
-
subdivideRois
public void subdivideRois(Mesh3DInt mesh_int, InterfaceProgressBar progress_bar) throws MeshFunctionExceptionSubdivide the set of ROIs inmesh_int, by iteratively splitting the largest ROI in half along its narrowest section.- Parameters:
mesh_int-progress_bar-- Throws:
MeshFunctionException
-
SubdivideButterflyScheme
Calls the function SubdivideButterflyScheme in the MeshSubdivision function class, using parameters specified in the AttributeList "Butterfly Scheme".- Parameters:
mesh- Mesh to subdividenewmesh- Object to store subdivided mesh
-
decimate
-
computeMeanCurvature
Computes the vertex-wise mean curvature of this mesh and stores it in the "target_column" specified it the "Mean Curvature" attributes. The column will be created if it doesn't exist.- Parameters:
mesh3d-progress-- Returns:
-
selectBoundaryNodes
-
transformMesh
public boolean transformMesh(Mesh3D mesh, java.lang.String method, InterfaceProgressBar progress_bar) -
decimateSchroeder
-
DecimateByDistance
Calls the function DecimateByDistance in the MeshFunctions function class, using parameters specified in the AttributeList "Decimate By Distance"- Parameters:
mesh- Mesh to decimatenewmesh- Object to store subdivided mesh
-
mapVolumeToMesh
public java.util.ArrayList<MguiNumber> mapVolumeToMesh(Mesh3D mesh, Volume3DInt volume, java.lang.String method) -
mapVolumeToMesh
public java.util.ArrayList<MguiNumber> mapVolumeToMesh(Mesh3D mesh, Volume3DInt volume, java.lang.String method, InterfaceProgressBar progress_bar) -
mapMeshToVolume
public Volume3DInt mapMeshToVolume(Mesh3DInt mesh, Volume3DInt volume, java.lang.String method, InterfaceProgressBar progress_bar) -
mapMeshToVolumeGaussian
public Volume3DInt mapMeshToVolumeGaussian(Mesh3DInt mesh_int, Volume3DInt volume, InterfaceProgressBar progress_bar) -
getMeshParts
Creates new mesh objects as a set of non-contiguous meshes frommesh_int, and adds these toshape_set.- Parameters:
mesh- Mesh from which to obtain partsnew_shape_set- Shape set in which to store new mesh objects
-
getMeshParts
public void getMeshParts(Mesh3DInt mesh_int, ShapeSet3DInt shape_set, boolean copy_data, ProgressUpdater progress)Creates new mesh objects as a set of non-contiguous meshes frommesh_int, and adds these toshape_set.- Parameters:
mesh- Mesh from which to obtain partsnew_shape_set- Shape set in which to store new mesh objectsretain- Whether to retain the original mesh objectcopy_data- Whether to copy vertex data from the original mesh object
-
getSubMesh
public void getSubMesh(Mesh3DInt mesh, Mesh3DInt newmesh, java.util.ArrayList<MguiNumber> mask, int value, boolean retain, boolean copydata)- Parameters:
mesh-newmesh-mask-value-retain-
-
getSubMesh
-
SmoothLR
-
SmoothEM
-
smoothVertexValuesIsotropicGaussian
public void smoothVertexValuesIsotropicGaussian(Mesh3DInt mesh_int, ProgressUpdater progress) throws MeshFunctionExceptionUses the current parameters for "Smooth vertex values - Isotropic Gaussian" to smooth vertex values with a Gaussian kernel, isotropic in the plane of the surface mesh.- Parameters:
mesh-progress-- Throws:
MeshFunctionException
-
inflateMesh
-
inflateTRP
-
translateMesh
-
getAttribute
Description copied from interface:AttributeObjectReturns a specific attribute for this object.- Specified by:
getAttributein interfaceAttributeObject- Returns:
-
getAttributes
Description copied from interface:AttributeObjectReturns the list of current attributes for this object.- Specified by:
getAttributesin interfaceAttributeObject- Returns:
-
getName
public java.lang.String getName()Description copied from interface:NamedObjectGets the name for this object.- Specified by:
getNamein interfaceNamedObject- Returns:
-
setName
public void setName(java.lang.String name)Description copied from interface:NamedObjectSets the name for this object.- Specified by:
setNamein interfaceNamedObject
-
setAttribute
public void setAttribute(java.lang.String attrName, java.lang.Object newValue)Description copied from interface:AttributeObjectSets a value for a specific attribute.- Specified by:
setAttributein interfaceAttributeObject
-
setAttributes
Description copied from interface:AttributeObjectSets the list of attributes for this object.- Specified by:
setAttributesin interfaceAttributeObject
-