Package mgui.interfaces.shapes.volume
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
-
Nested Class Summary
Nested classes/interfaces inherited from interface mgui.interfaces.xml.XMLObject
XMLObject.XMLEncoding, XMLObject.XMLType -
Field Summary
Fields Modifier and Type Field Description protected Volume3DIntvolumeFields inherited from class mgui.interfaces.shapes.VertexDataColumn
attributes, data, link_name_mapped, linked_data, listeners, xml_attribute_handler, xml_cmap_handler, xml_current_block, xml_current_cmap, xml_data, xml_data_encoding, xml_data_size, xml_data_type, xml_nmap_handlerFields inherited from class mgui.interfaces.AbstractInterfaceObject
isDestroyed, tree_nodes -
Constructor Summary
Constructors Constructor Description GridVertexDataColumn(java.lang.String name, Volume3DInt volume)GridVertexDataColumn(java.lang.String name, Volume3DInt volume, java.util.ArrayList<MguiNumber> data) -
Method Summary
Modifier and Type Method Description voidattributeUpdated(AttributeEvent e)Called when an Attribute's value has been updated.voidcolourModelChanged(boolean update)Called when some process has altered the colour model.voidfillWithValues(int data_type, double value)Fills this column withvalue.java.lang.StringgetByReferenceUrl()Returns a URL string for the latest call to writeXML(int,java.io.Writer,mgui.io.standard.xml.XMLOutputOptions,mgui.interfaces.ProgressUpdater).WindowedColourModelgetColourModel()Returns the current colour modelprotected intgetDataBufferType()doublegetDoubleValueAtVoxel(int i, int j, int k)Returns the value at voxel index [i, j, k]java.lang.StringgetLocalName()Returns the local name associated with this XML object.java.awt.image.BufferedImagegetRSliceImage(int r)Returns a slice image at the plane R=r.java.awt.image.BufferedImagegetRSliceImage(int r, WindowedColourModel colour_model)Returns a slice image at the plane R=r.java.awt.ColorgetSolidColour()Returns the colour for solid colour rendering.java.awt.image.BufferedImagegetSSliceImage(int s)Returns a slice image at the plane S=s.java.awt.image.BufferedImagegetSSliceImage(int s, WindowedColourModel colour_model)Returns a slice image at the plane S=s.java.awt.image.BufferedImagegetTSliceImage(int t)Returns a slice image at the plane T=t.java.awt.image.BufferedImagegetTSliceImage(int t, WindowedColourModel colour_model)Returns a slice image at the plane T=t.MguiNumbergetValueAtVoxel(int i, int j, int k)Returns the value in this column at voxel index [i, j, k]double[][][]getVoxelsAsDouble()Returns the voxel-wise data as a 3D array of typedoublevoidhandleXMLElementEnd(java.lang.String localName)Handles the end of an XML element.voidhandleXMLElementStart(java.lang.String localName, org.xml.sax.Attributes attributes, XMLObject.XMLType type)Handles the start of an XML element.booleanisSolidColour()Whether this column should be rendered as a solid colour (for values > 0).protected voidloadAsciiData(java.lang.String string_data)Load vertices from Ascii encoded dataprotected voidloadBinaryData(java.lang.String string_data, int compression)Load vertices from Base64 binary encoded data.voidsetColourLimits(double min, double max, boolean update)Sets the colour limits for this column; fires an event ifupdateistrue.voidsetColourMap(ColourMap map, boolean update)Sets the colour map associated with this column.voidsetColourMap(ColourMap map, double min, double max, boolean update)Sets the colour map associated with this column.voidsetColourMax(double max, boolean update)Sets the data maximum for this column; fires an event ifupdateistrue.voidsetColourMin(double min, boolean update)Sets the data maximum for this column; fires an event ifupdateistrue.voidsetDataLimits(double min, double max, boolean update)Sets the data limits for this column; fires an event ifupdateistrue.voidsetFromVertexDataColumn(VertexDataColumn column)Set this data column to match the values, limits, and colour map ofcolumn.voidsetIsSolidColour(boolean b)Sets whether this column should be rendered as a solid colour (for values > 0).voidsetParent(Volume3DInt parent)Sets the parent volume for this vertex datavoidsetSolidColour(java.awt.Color clr)Sets the colour for solid colour rendering.voidsetValueAtVoxel(int i, int j, int k, MguiNumber value)Sets the value at voxel index [i, j, k]voidsetXMLRoot(java.lang.String root_dir)voidupdateColourModel()Updates this data column's colour model from its current colour map.voidwriteXML(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progress_bar)Writes the XML representation of this object to file.protected voidwriteXMLFull(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progress_bar)Methods inherited from class mgui.interfaces.shapes.VertexDataColumn
addDataLink, addDataLink, addListener, compareTo, copyAttributes, fireDataColumnChanged, fireDataColumnColourMapChanged, getAttributes, getColourMap, getColourMax, getColourMin, getData, getDataAsDouble, getDataMax, getDataMin, getDataTransferType, getDoubleValueAtVertex, getDTD, getIcon, getLinkedData, getLinkedDataNames, getName, getNameMap, getObjectIcon, getPopupMenu, getPopupMenu, getShortXML, getTreeLabel, getValueAtVertex, getXML, getXML, getXMLSchema, handlePopupEvent, handleXMLString, hasNameMap, isNameMapped, removeDataLink, removeListener, resetDataLimits, setColourLimits, setColourMap, setColourMax, setColourMin, setDataLimits, setDataMax, setDataMax, setDataMin, setDataMin, setDoubleValueAtVertex, setName, setNameMap, setTreeNode, setValueAtVertex, setValues, setValues, setValues, showPopupMenu, updateDataLimits, updateDataLimits, writeAsciiData, writeBinaryData, writeXML, writeXMLMethods inherited from class mgui.interfaces.AbstractInterfaceObject
clean, destroy, isDestroyed, issueTreeNode, updateTreeNodesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
volume
-
-
Constructor Details
-
GridVertexDataColumn
-
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 withvalue.- 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). Iffalse, 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 typedouble- Returns:
-
getValueAtVoxel
Returns the value in this column at voxel index [i, j, k]- Parameters:
index-- Returns:
-
setValueAtVoxel
Sets the value at voxel index [i, j, k]- Parameters:
i-j-k-
-
setParent
Sets the parent volume for this vertex data- Parameters:
parent-
-
setColourMap
Description copied from class:VertexDataColumnSets the colour map associated with this column. Sets data min and data max to the limits of the colour map- Overrides:
setColourMapin classVertexDataColumnmin- Sets the colour minimumupdate- Whether to fire an event to this column's listeners
-
setColourMap
Description copied from class:VertexDataColumnSets the colour map associated with this column. Sets data min and data max to the limits of the colour map- Overrides:
setColourMapin classVertexDataColumnupdate- Whether to fire an event to this column's listeners
-
setDataLimits
public void setDataLimits(double min, double max, boolean update)Description copied from class:VertexDataColumnSets the data limits for this column; fires an event ifupdateistrue.- Overrides:
setDataLimitsin classVertexDataColumn
-
getColourModel
Returns the current colour model- Returns:
-
attributeUpdated
Description copied from interface:AttributeListenerCalled when an Attribute's value has been updated.- Specified by:
attributeUpdatedin interfaceAttributeListener- Overrides:
attributeUpdatedin classVertexDataColumn
-
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
Description copied from class:VertexDataColumnSet this data column to match the values, limits, and colour map ofcolumn.- Overrides:
setFromVertexDataColumnin classVertexDataColumn
-
setColourMin
public void setColourMin(double min, boolean update)Description copied from class:VertexDataColumnSets the data maximum for this column; fires an event ifupdateistrue.- Overrides:
setColourMinin classVertexDataColumn
-
setColourMax
public void setColourMax(double max, boolean update)Description copied from class:VertexDataColumnSets the data maximum for this column; fires an event ifupdateistrue.- Overrides:
setColourMaxin classVertexDataColumn
-
setColourLimits
public void setColourLimits(double min, double max, boolean update)Description copied from class:VertexDataColumnSets the colour limits for this column; fires an event ifupdateistrue.- Overrides:
setColourLimitsin classVertexDataColumn
-
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
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
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
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.SAXExceptionDescription copied from interface:XMLObjectHandles the start of an XML element.- Specified by:
handleXMLElementStartin interfaceXMLObject- Overrides:
handleXMLElementStartin classVertexDataColumn- Parameters:
localName- Local name of the elementattributes- Set of element attributestype- TheXMLTypeof this element- Throws:
org.xml.sax.SAXException
-
handleXMLElementEnd
public void handleXMLElementEnd(java.lang.String localName) throws org.xml.sax.SAXExceptionDescription copied from interface:XMLObjectHandles the end of an XML element.- Specified by:
handleXMLElementEndin interfaceXMLObject- Overrides:
handleXMLElementEndin classVertexDataColumn- 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). Isnullif 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.IOExceptionDescription copied from interface:XMLObjectWrites 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 ofXMLFormat.Asciiwill be used.- Specified by:
writeXMLin interfaceXMLObject- Overrides:
writeXMLin classVertexDataColumn- Parameters:
tab- The number of tabs to place before the XML textwriter- The writeroptions- XMLOutputOptions defining the write parametersprogress_bar- Optional progress updater (may benull)- 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:XMLObjectReturns the local name associated with this XML object.- Specified by:
getLocalNamein interfaceXMLObject- Overrides:
getLocalNamein classVertexDataColumn- Returns:
-
loadBinaryData
protected void loadBinaryData(java.lang.String string_data, int compression)Description copied from class:VertexDataColumnLoad vertices from Base64 binary encoded data.- Overrides:
loadBinaryDatain classVertexDataColumncompression- Compression; 0 for none, 1 for zip, 2 for gzip
-
loadAsciiData
protected void loadAsciiData(java.lang.String string_data)Description copied from class:VertexDataColumnLoad vertices from Ascii encoded data- Overrides:
loadAsciiDatain classVertexDataColumn
-