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 Details

  • Constructor Details

    • MeshEngine

      public MeshEngine()
  • Method Details

    • getAttributes

      public AttributeList getAttributes​(java.lang.String key)
    • getAttributeValue

      public java.lang.Object getAttributeValue​(java.lang.String name)
      Description copied from interface: AttributeObject
      Gets the value of attribute name, or null if it does not exist.
      Specified by:
      getAttributeValue in interface AttributeObject
      Parameters:
      name - Name of the attribute
      Returns:
      the value of attribute name, or null if it does not exist
    • getAttributes

      public AttributeList getAttributes​(java.lang.String operation, java.lang.String method)
      Description copied from interface: Engine
      Returns the attributes list corresponding to the operation and method.
      Specified by:
      getAttributes in interface Engine
      Returns:
      The corresponding attributes, or null if no such combination of operation/ method exists.
    • getOperations

      public java.util.ArrayList<java.lang.String> getOperations()
      Description copied from interface: Engine
      Returns a list of the operations available for this Engine. Operations signify a general operation, which can be implemented through any number of "methods".
      Specified by:
      getOperations in interface Engine
      Returns:
    • getMethods

      public java.util.ArrayList<java.lang.String> getMethods​(java.lang.String operation)
      Description copied from interface: Engine
      Returns a list of methods implementing a particular operation.
      Specified by:
      getMethods in interface Engine
      Returns:
    • callMethod

      public boolean callMethod​(java.lang.String operation, java.lang.String method, ProgressUpdater progress)
      Description copied from interface: Engine
      Calls the specified operation/method pair. Returns true if the operation was successful.
      Specified by:
      callMethod in interface Engine
      Parameters:
      operation - Operation to perform.
      method - Method with which to perform operation. Can be null if this operation has no sub-methods
      progress - Optional progress updater (can be null)
      Returns:
    • callMethod

      public boolean callMethod​(java.lang.String operation, java.lang.String method, java.util.ArrayList<?> params, ProgressUpdater progress)
      Description copied from interface: Engine
      Calls the specified operation/method pair. Returns true if the operation was successful.
      Specified by:
      callMethod in interface Engine
      Parameters:
      operation - Operation to perform.
      method - Method with which to perform operation. Can be null if this operation has no sub-methods
      params - A list of additional parameters (not in the attributes) for this method
      progress - Optional progress updater (can be null)
      Returns:
    • doRoiOperation

      public void doRoiOperation​(Mesh3DInt mesh_int, java.lang.String method, InterfaceProgressBar progress_bar) throws MeshFunctionException
      Runs the ROI operation specified by method.
      Parameters:
      mesh_int -
      method -
      progress_bar -
      Throws:
      MeshFunctionException
    • splitRoiWithPlane

      public void splitRoiWithPlane​(Mesh3DInt mesh_int, InterfaceProgressBar progress_bar) throws MeshFunctionException
      Splits the ROI defined by roi_value into 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 MeshFunctionException
      Subdivide the set of ROIs in mesh_int, by iteratively splitting the largest ROI in half along its narrowest section.
      Parameters:
      mesh_int -
      progress_bar -
      Throws:
      MeshFunctionException
    • SubdivideButterflyScheme

      public void SubdivideButterflyScheme​(Mesh3DInt mesh)
      Calls the function SubdivideButterflyScheme in the MeshSubdivision function class, using parameters specified in the AttributeList "Butterfly Scheme".
      Parameters:
      mesh - Mesh to subdivide
      newmesh - Object to store subdivided mesh
    • decimate

      public void decimate​(Mesh3D mesh, java.lang.String method)
    • computeMeanCurvature

      public boolean computeMeanCurvature​(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. The column will be created if it doesn't exist.
      Parameters:
      mesh3d -
      progress -
      Returns:
    • selectBoundaryNodes

      public void selectBoundaryNodes​(Mesh3DInt mesh_int)
    • transformMesh

      public boolean transformMesh​(Mesh3D mesh, java.lang.String method, InterfaceProgressBar progress_bar)
    • decimateSchroeder

      public void decimateSchroeder​(Mesh3D mesh)
    • DecimateByDistance

      public void DecimateByDistance​(Mesh3D mesh, Mesh3D newmesh)
      Calls the function DecimateByDistance in the MeshFunctions function class, using parameters specified in the AttributeList "Decimate By Distance"
      Parameters:
      mesh - Mesh to decimate
      newmesh - 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

      public void getMeshParts​(Mesh3DInt mesh_int, ShapeSet3DInt shape_set)
      Creates new mesh objects as a set of non-contiguous meshes from mesh_int, and adds these to shape_set.
      Parameters:
      mesh - Mesh from which to obtain parts
      new_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 from mesh_int, and adds these to shape_set.
      Parameters:
      mesh - Mesh from which to obtain parts
      new_shape_set - Shape set in which to store new mesh objects
      retain - Whether to retain the original mesh object
      copy_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

      public void getSubMesh​(Mesh3DInt mesh, Mesh3DInt newmesh, boolean retain, boolean copydata)
    • SmoothLR

      public void SmoothLR​(Mesh3D mesh)
    • SmoothEM

      public void SmoothEM​(Mesh3DInt mesh)
    • smoothVertexValuesIsotropicGaussian

      public void smoothVertexValuesIsotropicGaussian​(Mesh3DInt mesh_int, ProgressUpdater progress) throws MeshFunctionException
      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.
      Parameters:
      mesh -
      progress -
      Throws:
      MeshFunctionException
    • inflateMesh

      public void inflateMesh​(Mesh3DInt mesh, java.lang.String method, ProgressUpdater progress)
    • inflateTRP

      public void inflateTRP​(Mesh3DInt mesh, ProgressUpdater progress)
    • translateMesh

      public boolean translateMesh​(Mesh3D mesh)
    • getAttribute

      public Attribute<?> getAttribute​(java.lang.String attrName)
      Description copied from interface: AttributeObject
      Returns a specific attribute for this object.
      Specified by:
      getAttribute in interface AttributeObject
      Returns:
    • getAttributes

      public AttributeList getAttributes()
      Description copied from interface: AttributeObject
      Returns the list of current attributes for this object.
      Specified by:
      getAttributes in interface AttributeObject
      Returns:
    • getName

      public java.lang.String getName()
      Description copied from interface: NamedObject
      Gets the name for this object.
      Specified by:
      getName in interface NamedObject
      Returns:
    • setName

      public void setName​(java.lang.String name)
      Description copied from interface: NamedObject
      Sets the name for this object.
      Specified by:
      setName in interface NamedObject
    • setAttribute

      public void setAttribute​(java.lang.String attrName, java.lang.Object newValue)
      Description copied from interface: AttributeObject
      Sets a value for a specific attribute.
      Specified by:
      setAttribute in interface AttributeObject
    • setAttributes

      public void setAttributes​(AttributeList thisList)
      Description copied from interface: AttributeObject
      Sets the list of attributes for this object.
      Specified by:
      setAttributes in interface AttributeObject