Class VolumeEngine

java.lang.Object
mgui.geometry.volume.VolumeEngine
All Implemented Interfaces:
AttributeObject, NamedObject, Engine

public class VolumeEngine
extends java.lang.Object
implements Engine
Engine to perform built-in operations on volumes.
Since:
1.0
Version:
1.0
Author:
Andrew Reid
  • Field Summary

    Fields
    Modifier and Type Field Description
    protected java.util.HashMap<java.lang.String,​AttributeList> attributes  
  • Constructor Summary

    Constructors
    Constructor Description
    VolumeEngine()  
  • Method Summary

    Modifier and Type Method Description
    boolean callMethod​(java.lang.String operation, java.lang.String method, java.util.ArrayList<?> params, ProgressUpdater progress)
    Calls the specified operation/method pair.
    boolean callMethod​(java.lang.String operation, java.lang.String method, ProgressUpdater progress)
    Calls the specified operation/method pair.
    Attribute<?> getAttribute​(java.lang.String attrName)
    Returns a specific attribute for this object.
    AttributeList getAttributes()
    Returns the list of current attributes for this object.
    AttributeList getAttributes​(java.lang.String key)
    Returns the attributes corresponding to key, where key is of the form "operation (method)".
    AttributeList getAttributes​(java.lang.String operation, java.lang.String method)
    Returns the attributes list corresponding to the operation and method.
    java.lang.Object getAttributeValue​(java.lang.String name)
    Gets the value of attribute name, or null if it does not exist.
    boolean getBlobsFromVolume​(Volume3DInt volume)
    Extract blobs from a thresholded volume
    boolean getIsosurfaceFromVolume​(Volume3DInt volume)
    Creates an isosurface at a specified isovalue in volume.
    java.util.ArrayList<java.lang.String> getMethods​(java.lang.String operation)
    Returns a list of methods implementing a particular operation.
    java.lang.String getName()
    Gets the name for this object.
    java.util.ArrayList<java.lang.String> getOperations()
    Returns a list of the operations available for this Engine.
    boolean mapVolumeToVolume​(Volume3DInt source, Volume3DInt target, java.lang.String method, ProgressUpdater progress_bar)
    Maps a column of source to a column of target, given the attributes corresponding to method.
    void setAttribute​(java.lang.String attrName, java.lang.Object newValue)
    Sets a value for a specific attribute.
    void setAttributes​(AttributeList thisList)
    Sets the list of attributes for this object.
    void setName​(java.lang.String name)
    Sets the name for this object.
    boolean smoothVolume​(Volume3DInt volume, java.lang.String method, ProgressUpdater progress_bar)
    Geometrically smooths values from source_column in volume with the smoothing kernel specified by method.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • attributes

      protected java.util.HashMap<java.lang.String,​AttributeList> attributes
  • Constructor Details

    • VolumeEngine

      public VolumeEngine()
  • Method Details

    • getAttributes

      public AttributeList getAttributes​(java.lang.String key)
      Returns the attributes corresponding to key, where key is of the form "operation (method)".
      Parameters:
      key -
      Returns:
    • 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:
    • mapVolumeToVolume

      public boolean mapVolumeToVolume​(Volume3DInt source, Volume3DInt target, java.lang.String method, ProgressUpdater progress_bar)
      Maps a column of source to a column of target, given the attributes corresponding to method.
      Parameters:
      source -
      target -
      method -
      progress_bar -
      Returns:
    • smoothVolume

      public boolean smoothVolume​(Volume3DInt volume, java.lang.String method, ProgressUpdater progress_bar)
      Geometrically smooths values from source_column in volume with the smoothing kernel specified by method. Writes the results to target_column. If target_column doesn't exist, it will be created with the same data type as source_column. If it exists, it will maintain its current data type and its values will be overwritten. target_column can be the same as source_column.

      Valid methods are:

      • 'Smooth Volume (Isotropic Gaussian)' -
      Parameters:
      volume -
      method -
      progress_bar -
      Returns:
      true if successful
    • getBlobsFromVolume

      public boolean getBlobsFromVolume​(Volume3DInt volume)
      Extract blobs from a thresholded volume
      Parameters:
      volume -
      Returns:
    • getIsosurfaceFromVolume

      public boolean getIsosurfaceFromVolume​(Volume3DInt volume)
      Creates an isosurface at a specified isovalue in volume. Creates a new surface and stores it in shape_set.
      Parameters:
      volume -
      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:
    • 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:
    • 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
    • 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
    • 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
    • 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