Class GridVertexDataColumn

java.lang.Object
mgui.interfaces.AbstractInterfaceObject
mgui.interfaces.shapes.VertexDataColumn
mgui.interfaces.shapes.volume.GridVertexDataColumn
All Implemented Interfaces:
java.lang.Comparable<VertexDataColumn>, AttributeListener, InterfaceObject, PopupMenuObject, NamedObject, TreeObject, CleanableObject, XMLObject, IconObject

public class GridVertexDataColumn
extends VertexDataColumn
Vertex data column defined for a Volume3DInt.
Since:
1.0
Version:
1.0
Author:
Andrew Reid
  • Field Details

  • Constructor Details

    • GridVertexDataColumn

      public GridVertexDataColumn​(java.lang.String name, Volume3DInt volume)
    • GridVertexDataColumn

      public GridVertexDataColumn​(java.lang.String name, Volume3DInt volume, java.util.ArrayList<MguiNumber> data)
  • Method Details

    • fillWithValues

      public void fillWithValues​(int data_type, double value)
      Fills this column with value.
      Parameters:
      data_type - The DataBuffer type
    • isSolidColour

      public boolean isSolidColour()
      Whether this column should be rendered as a solid colour (for values > 0). Otherwise, renders as a colour map.
      Returns:
    • setIsSolidColour

      public void setIsSolidColour​(boolean b)
      Sets whether this column should be rendered as a solid colour (for values > 0). If false, renders as a colour map.
    • getSolidColour

      public java.awt.Color getSolidColour()
      Returns the colour for solid colour rendering. Requires "IsSolid" to be true.
      Returns:
    • setSolidColour

      public void setSolidColour​(java.awt.Color clr)
      Sets the colour for solid colour rendering. Requires "IsSolid" to be true.
    • getDoubleValueAtVoxel

      public double getDoubleValueAtVoxel​(int i, int j, int k)
      Returns the value at voxel index [i, j, k]
      Parameters:
      i -
      j -
      k -
      Returns:
    • getVoxelsAsDouble

      public double[][][] getVoxelsAsDouble()
      Returns the voxel-wise data as a 3D array of type double
      Returns:
    • getValueAtVoxel

      public MguiNumber getValueAtVoxel​(int i, int j, int k)
      Returns the value in this column at voxel index [i, j, k]
      Parameters:
      index -
      Returns:
    • setValueAtVoxel

      public void setValueAtVoxel​(int i, int j, int k, MguiNumber value)
      Sets the value at voxel index [i, j, k]
      Parameters:
      i -
      j -
      k -
    • setParent

      public void setParent​(Volume3DInt parent)
      Sets the parent volume for this vertex data
      Parameters:
      parent -
    • setColourMap

      public void setColourMap​(ColourMap map, double min, double max, boolean update)
      Description copied from class: VertexDataColumn
      Sets the colour map associated with this column. Sets data min and data max to the limits of the colour map
      Overrides:
      setColourMap in class VertexDataColumn
      min - Sets the colour minimum
      update - Whether to fire an event to this column's listeners
    • setColourMap

      public void setColourMap​(ColourMap map, boolean update)
      Description copied from class: VertexDataColumn
      Sets the colour map associated with this column. Sets data min and data max to the limits of the colour map
      Overrides:
      setColourMap in class VertexDataColumn
      update - Whether to fire an event to this column's listeners
    • setDataLimits

      public void setDataLimits​(double min, double max, boolean update)
      Description copied from class: VertexDataColumn
      Sets the data limits for this column; fires an event if update is true.
      Overrides:
      setDataLimits in class VertexDataColumn
    • getColourModel

      public WindowedColourModel getColourModel()
      Returns the current colour model
      Returns:
    • attributeUpdated

      public void attributeUpdated​(AttributeEvent e)
      Description copied from interface: AttributeListener
      Called when an Attribute's value has been updated.
      Specified by:
      attributeUpdated in interface AttributeListener
      Overrides:
      attributeUpdated in class VertexDataColumn
    • colourModelChanged

      public void colourModelChanged​(boolean update)
      Called when some process has altered the colour model. Updates the max and min accordingly
      Parameters:
      update - Whether to notify listeners after change is applied
    • setFromVertexDataColumn

      public void setFromVertexDataColumn​(VertexDataColumn column)
      Description copied from class: VertexDataColumn
      Set this data column to match the values, limits, and colour map of column.
      Overrides:
      setFromVertexDataColumn in class VertexDataColumn
    • setColourMin

      public void setColourMin​(double min, boolean update)
      Description copied from class: VertexDataColumn
      Sets the data maximum for this column; fires an event if update is true.
      Overrides:
      setColourMin in class VertexDataColumn
    • setColourMax

      public void setColourMax​(double max, boolean update)
      Description copied from class: VertexDataColumn
      Sets the data maximum for this column; fires an event if update is true.
      Overrides:
      setColourMax in class VertexDataColumn
    • setColourLimits

      public void setColourLimits​(double min, double max, boolean update)
      Description copied from class: VertexDataColumn
      Sets the colour limits for this column; fires an event if update is true.
      Overrides:
      setColourLimits in class VertexDataColumn
    • updateColourModel

      public void updateColourModel()
      Updates this data column's colour model from its current colour map. This requires that this column currently has data set (required to determine the data type for the colour model).
    • getRSliceImage

      public java.awt.image.BufferedImage getRSliceImage​(int r)
      Returns a slice image at the plane R=r.
      Parameters:
      r -
      Returns:
    • getRSliceImage

      public java.awt.image.BufferedImage getRSliceImage​(int r, WindowedColourModel colour_model)
      Returns a slice image at the plane R=r.
      Parameters:
      r -
      Returns:
    • getSSliceImage

      public java.awt.image.BufferedImage getSSliceImage​(int s)
      Returns a slice image at the plane S=s.
      Parameters:
      s -
      Returns:
    • getSSliceImage

      public java.awt.image.BufferedImage getSSliceImage​(int s, WindowedColourModel colour_model)
      Returns a slice image at the plane S=s.
      Parameters:
      z -
      Returns:
    • getTSliceImage

      public java.awt.image.BufferedImage getTSliceImage​(int t)
      Returns a slice image at the plane T=t.
      Parameters:
      z -
      Returns:
    • getTSliceImage

      public java.awt.image.BufferedImage getTSliceImage​(int t, WindowedColourModel colour_model)
      Returns a slice image at the plane T=t.
      Parameters:
      z -
      Returns:
    • setXMLRoot

      public void setXMLRoot​(java.lang.String root_dir)
    • handleXMLElementStart

      public void handleXMLElementStart​(java.lang.String localName, org.xml.sax.Attributes attributes, XMLObject.XMLType type) throws org.xml.sax.SAXException
      Description copied from interface: XMLObject
      Handles the start of an XML element.
      Specified by:
      handleXMLElementStart in interface XMLObject
      Overrides:
      handleXMLElementStart in class VertexDataColumn
      Parameters:
      localName - Local name of the element
      attributes - Set of element attributes
      type - The XMLType of this element
      Throws:
      org.xml.sax.SAXException
    • handleXMLElementEnd

      public void handleXMLElementEnd​(java.lang.String localName) throws org.xml.sax.SAXException
      Description copied from interface: XMLObject
      Handles the end of an XML element.
      Specified by:
      handleXMLElementEnd in interface XMLObject
      Overrides:
      handleXMLElementEnd in class VertexDataColumn
      Parameters:
      localName - Local name of the element
      Throws:
      org.xml.sax.SAXException
    • getByReferenceUrl

      public java.lang.String getByReferenceUrl()
      Returns a URL string for the latest call to writeXML(int,java.io.Writer,mgui.io.standard.xml.XMLOutputOptions,mgui.interfaces.ProgressUpdater). Is null if no call has yet been made, or the latest write was not by reference.
      Returns:
    • writeXML

      public void writeXML​(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progress_bar) throws java.io.IOException
      Description copied from interface: XMLObject
      Writes the XML representation of this object to file. The basic contract for this method is that it should not write a newline character at its start or end. The default format of XMLFormat.Ascii will be used.
      Specified by:
      writeXML in interface XMLObject
      Overrides:
      writeXML in class VertexDataColumn
      Parameters:
      tab - The number of tabs to place before the XML text
      writer - The writer
      options - XMLOutputOptions defining the write parameters
      progress_bar - Optional progress updater (may be null)
      Throws:
      java.io.IOException
    • writeXMLFull

      protected void writeXMLFull​(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progress_bar) throws java.io.IOException
      Throws:
      java.io.IOException
    • getDataBufferType

      protected int getDataBufferType()
    • getLocalName

      public java.lang.String getLocalName()
      Description copied from interface: XMLObject
      Returns the local name associated with this XML object.
      Specified by:
      getLocalName in interface XMLObject
      Overrides:
      getLocalName in class VertexDataColumn
      Returns:
    • loadBinaryData

      protected void loadBinaryData​(java.lang.String string_data, int compression)
      Description copied from class: VertexDataColumn
      Load vertices from Base64 binary encoded data.
      Overrides:
      loadBinaryData in class VertexDataColumn
      compression - Compression; 0 for none, 1 for zip, 2 for gzip
    • loadAsciiData

      protected void loadAsciiData​(java.lang.String string_data)
      Description copied from class: VertexDataColumn
      Load vertices from Ascii encoded data
      Overrides:
      loadAsciiData in class VertexDataColumn