Package mgui.interfaces.shapes
Class Volume3DInt
java.lang.Object
mgui.interfaces.AbstractInterfaceObject
mgui.interfaces.shapes.InterfaceShape
mgui.interfaces.shapes.Shape3DInt
mgui.interfaces.shapes.Volume3DInt
- All Implemented Interfaces:
java.awt.datatransfer.Transferable,java.lang.Comparable<InterfaceShape>,AttributeListener,AttributeObject,InterfaceObject,PersistentObject,ColourMapListener,VariableObject,PopupMenuObject,NamedObject,InterfaceQueryObject,InterfaceShapeQueryObject,ShapeListener,VertexDataColumnListener,InterfaceTransferable,TreeObject,CleanableObject,XMLObject,IconObject,org.jogamp.java3d.GeometryUpdater,org.jogamp.java3d.ImageComponent3D.Updater
- Direct Known Subclasses:
TensorVolume3DInt,Volume4DInt,VolumeSet3DInt
public class Volume3DInt extends Shape3DInt implements ColourMapListener, org.jogamp.java3d.ImageComponent3D.Updater, ShapeListener
Class acting as interface to a volume shape, as defined by the Grid3D geometry
class. Volume3D provides a Texture3D node and also defines the appearance of the
voxel set in terms of colour or intensity mapping.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- Andrew Reid
-
Nested Class Summary
Nested classes/interfaces inherited from class mgui.interfaces.shapes.Shape3DInt
Shape3DInt.VertexShapeTransformerNested classes/interfaces inherited from class mgui.interfaces.shapes.InterfaceShape
InterfaceShape.VertexDataSetNested classes/interfaces inherited from interface mgui.interfaces.xml.XMLObject
XMLObject.XMLEncoding, XMLObject.XMLType -
Field Summary
Fields Modifier and Type Field Description protected java.util.HashMap<java.lang.String,java.lang.Boolean>apply_maskprotected org.jogamp.java3d.BranchGroupbox_nodeprotected java.util.HashMap<java.lang.String,WindowedColourModel>colour_modelsprotected java.util.HashMap<java.lang.String,java.lang.Double>composite_alphasprotected java.util.ArrayList<java.lang.String>composite_column_orderprotected java.io.FiledataFileprotected org.jogamp.java3d.BranchGroupgroup_nodeprotected ShapeSceneNodeintRect3Dprotected VolumeFileLoaderloaderprotected java.util.HashMap<java.lang.String,boolean[][][]>masksprotected org.jogamp.java3d.BranchGrouprender_nodeprotected Volume3DRendererrendererprotected java.util.HashMap<java.lang.String,java.lang.Boolean>show_in_compositeprotected booleantextureSetprotected org.jogamp.java3d.ImageComponent3D.Updaterupdaterprotected java.util.HashMap<java.lang.String,java.lang.Double>xml_composite_alphasprotected java.util.ArrayList<java.lang.String>xml_composite_column_orderprotected booleanxml_is_reading_composite_orderprotected booleanxml_is_reading_headerSets the variable's values with thevaluesobject, which must be one of the following types:ArrayList<BufferedImage[]>DataBufferDoubleIf not, a value offalseis returned.protected java.util.HashMap<java.lang.String,java.lang.Boolean>xml_show_in_compositeFields inherited from class mgui.interfaces.shapes.Shape3DInt
boundBox, boundBoxNode, bounds_group, bounds_shape, boundSphere, centerPt, children2D, creatable_scene_node, drawEngine2D, has_3d_node, hasCameraListener, idStr, nodeListener, parent2D, scene3DObject, sceneNode, selected_vertices_group, shape_group, shape3d, vertex_shape_transformer, vertices_groupFields inherited from class mgui.interfaces.shapes.InterfaceShape
attributes, constraints, data_columns, icon, ID, is_auxiliary, is_registered, isDrawable, isImageShape, isLight, isOverridden, last_column_added, last_column_changed, last_column_removed, linked_colour_maps, loader_options, notifyListeners, overrideAttr, parent_set, selected_nodes, shapeListeners, vertex_data, writer_options, xml_current_column, xml_current_loader, xml_current_shape, xml_current_shape_options, xml_current_type, xml_current_url, xml_is_vertex_data, xml_root_dirFields inherited from class mgui.interfaces.AbstractInterfaceObject
isDestroyed, tree_nodes -
Constructor Summary
Constructors Constructor Description Volume3DInt()Volume3DInt(Grid3D g)Volume3DInt(Grid3D g, ColourMap cmap) -
Method Summary
Modifier and Type Method Description voidaddMask(java.lang.String name, boolean[][][] mask)Adds a boolean mask to this volume.voidaddMask(java.lang.String name, boolean[][][] mask, boolean apply)Adds a boolean mask to this volume.booleanaddVertexData(java.lang.String column, int data_type)Add a vertex-wise data column of typedataType, which must be one ofDataBuffer.TYPE_DOUBLE,DataBuffer.TYPE_FLOAT, orDataBuffer.TYPE_INT.booleanaddVertexData(java.lang.String column, java.util.ArrayList<MguiNumber> data, NameMap nmap, ColourMap cmap)Adds vertex-wise data to this shape.booleanaddVertexData(VertexDataColumn column)Add a vertex-wise data column of typeDataBuffer.TYPE_DOUBLE.voidapplyMask()Applies the mask specified in params to the data in this volume.voidattributeUpdated(AttributeEvent e)Responds to an update in one of this shape's attributes.voidclearMask(java.lang.String name)voidcolourMapChanged(ColourMap map)voidderegisterCameraListener(Camera3D c)booleangetApplyMasks()Whether currently set masks are to be applied or not.Box3DgetBox()Camera3DListenergetCameraListener()org.jogamp.vecmath.Point3fgetCenterOfVoxel(int i, int j, int k)intgetClosestVertex(org.jogamp.vecmath.Point3f point)Returns the index of the vertex of this shape which is closest topoint.WindowedColourModelgetColourModel()Returns the colour model for the current column, ornullif there is no current column.WindowedColourModelgetColourModel(java.lang.String column)doublegetCompositeAlpha(java.lang.String column)java.util.ArrayList<java.lang.String>getCompositeOrderedColumns()intgetDataType()Returns the data type of the current column.intgetDataType(java.lang.String column)Returns the data type ofcolumn.MguiNumbergetDatumAtPoint(java.lang.String column, org.jogamp.vecmath.Point3f point)Returns the datum from thecolumnfor the voxel enclosingpoint.MguiNumbergetDatumAtPoint(org.jogamp.vecmath.Point3f point)Returns the datum from the current column for the voxel enclosingpoint.MguiNumbergetDatumAtVoxel(int[] voxel)Returns the datum from the current column atindex.MguiNumbergetDatumAtVoxel(int i, int j, int k)Returns the datum from the current column atindex.MguiNumbergetDatumAtVoxel(java.lang.String column, int[] voxel)Returns the datum fromcolumnatindex.MguiNumbergetDatumAtVoxel(java.lang.String column, int i, int j, int k)Returns the datum fromcolumnatindex.boolean[][][]getEffectiveMask()Returns the union of all masks which are currently set.ShapegetGeometryInstance()Returns an instance of thisInterfaceShape's geometry class.Grid3DgetGrid()Returns the Grid3D associated with this volume.doublegetInterpolatedValueAtPoint(java.lang.String column, org.jogamp.vecmath.Point3f p)Returns a value which is interpolated from the voxel enclosingpand its nearest neighbours.doublegetInterpolatedValueAtPoint(java.lang.String column, org.jogamp.vecmath.Point3f p, int t)Returns a value which is interpolated from the voxel enclosingpand its nearest neighbours.doublegetInterpolatedValueAtPoint(org.jogamp.vecmath.Point3f p)Returns a value which is interpolated from the voxel enclosingpand its nearest neighbours.doublegetInterpolatedValueAtPoint(org.jogamp.vecmath.Point3f p, int t)Returns a value which is interpolated from the voxel enclosingpand its nearest neighbours.floatgetMapMax()floatgetMapMin()boolean[][][]getMask(java.lang.String name)java.util.ArrayList<java.lang.String>getMaskNames()Returns an ordered list of mask names for this volume.java.util.HashMap<java.lang.String,boolean[][][]>getMasks()java.lang.StringgetRenderMode()Returns the current render mode of this volumeprotected Shape2DIntgetShape2D(Plane3D plane, float above_dist, float below_dist, org.jogamp.vecmath.Matrix4d transform)To be overridden by subclasses implementing a 2D representationVolume3DTexturegetTexture()intgetVertexIndex(int[] voxel)Obtains an absolute (vertex) index for the specified voxel indicesintgetVertexIndex(int i, int j, int k)Obtains an absolute (vertex) index for the specified voxel indicesvoidhandleXMLElementEnd(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.booleanhasAlpha()Queries whether this shape has transparency.voidhasAlpha(boolean b)Specifies whether this shape has transparency.voidhasAlpha(java.lang.String column, boolean b)protected voidinit()voidinvertMask(java.lang.String name)booleanisByRef()booleanisComposite()Determines whether this volume is current set to render as a composite of its columnstrue, or as the current column onlyfalse.voidisComposite(boolean show)Set the flag which determines whether this volume should render as a composite of its columnsshow == true, or as the current column onlyshow == false.voidisComposite(boolean show, boolean update)Set the flag which determines whether this volume should render as a composite of its columnsshow == true, or as the current column onlyshow == false.booleanisMaskApplied(java.lang.String name)booleanisMaskedAtPoint(org.jogamp.vecmath.Point3f point)Determines whether the voxel enclosingpointis masked.booleanisMaskedAtVoxel(int[] voxel)Determines whethervoxelis masked by any active maskbooleanisMaskedAtVoxel(int i, int j, int k)Determines whethervoxelis masked by any active maskvoidregisterCameraListener(Camera3D camera)voidremoveMask(java.lang.String name)voidremoveVertexData(java.lang.String column)Remove a vertex data column from this shape.booleanrenameVertexDataColumn(java.lang.String old_name, java.lang.String new_name)Renames the current column.booleansampleFromVolume(Volume3DInt sample_volume)Samplessample_volumewhere its geometric bounds cross the bounds of this volume.booleansampleFromVolume(Volume3DInt sample_volume, double nan_value)Samplessample_volumewhere its geometric bounds cross the bounds of this volume.booleansampleFromVolume(Volume3DInt sample_volume, java.lang.String source_column, java.lang.String target_column)Samplessample_volumewhere its geometric bounds cross the bounds of this volume.booleansampleFromVolume(Volume3DInt sample_volume, java.lang.String source_column, java.lang.String target_column, double nan_value)Samplessample_volumewhere its geometric bounds cross the bounds of this volume.voidsetAllMasks(boolean show)voidsetApplyMasks(boolean b)Sets whether currently set masks are to be applied or not.voidsetBounds(Box3D box)voidsetCompositeAlpha(java.lang.String column, double value)Sets the alpha value forcolumn, which determines its transparency if composite mode is set.voidsetCompositeAlpha(java.lang.String column, double value, boolean update)Sets the alpha value forcolumn, which determines its transparency if composite mode is set.voidsetCompositeIndex(java.lang.String column, int index)Adjusts the order of columncolumnin the composite rendering stack.voidsetCompositeIndex(java.lang.String column, int index, boolean notify)Adjusts the order of columncolumnin the composite rendering stack.booleansetDatumAtVoxel(int[] voxel, double datum)Sets the datum from the current column atindex.booleansetDatumAtVoxel(int[] voxel, MguiNumber datum)Sets the datum from the current column atindex.booleansetDatumAtVoxel(int i, int j, int k, double datum)Sets the datum from the current column atindex.booleansetDatumAtVoxel(int i, int j, int k, MguiNumber datum)Sets the datum from the current column atindex.booleansetDatumAtVoxel(java.lang.String column, int[] voxel, double datum)Sets the datum fromcolumnatindex.booleansetDatumAtVoxel(java.lang.String column, int[] voxel, MguiNumber datum)Sets the datum fromcolumnatindex.booleansetDatumAtVoxel(java.lang.String column, int i, int j, int k, double datum)Sets the datum fromcolumnatindex.booleansetDatumAtVoxel(java.lang.String column, int i, int j, int k, MguiNumber datum)Sets the datum fromcolumnatindex.voidsetGrid(Grid3D grid)voidsetGrid(Grid3D grid, boolean fire)protected voidsetIcon()voidsetMapMax(float m)voidsetMapMin(float m)voidsetMask(java.lang.String name, boolean show)voidsetMask(java.lang.String name, boolean[][][] mask)voidsetMaskApplied(java.lang.String name, boolean b)voidsetParentSet(ShapeSet set)OverridesInterfaceShape.setParentSetto add itself as a listener to the parentvoidsetRenderMode(java.lang.String mode)Sets the current render mode of this volumevoidsetScene3DObject(boolean make_live)Sets this ShapeInt's Java3D scene node from its current geometry and rendering attributes.voidsetTexture()Resets the texture for this volume's renderer.voidsetTexture(boolean setModel)Resets the texture for this volume's renderer.voidsetUpdater(Volume3DUpdater u)Sets an updater class, descended from Volume3DUpdater, with which to update the data in this volume's grid.voidshapeUpdated(ShapeEvent e)A shape that this object is listening to has been updated.booleanshowInComposite(java.lang.String column)Returns whethercolumn's data is to be included in the composite image.voidshowInComposite(java.lang.String column, boolean show)Sets whether to includecolumn's data in the composite imagevoidshowInComposite(java.lang.String column, boolean show, boolean update)Sets whether to includecolumn's data in the composite image.java.lang.StringtoString()booleanunionMask(java.lang.String name, boolean[][][] to_merge)booleanunionMaskWithVolume(java.lang.String name, Volume3DInt volume)Sets masknameto a new mask which is a union between its current state and the mask specified byvolume, where all zero-valued voxels are masked.booleanunionMaskWithVolume(java.lang.String name, Volume3DInt volume, java.lang.String column)Sets masknameto a new mask which is a union between its current state and the mask specified byvolume, where all zero-valued voxels are masked.voidupdate(Volume3DTexture.UpdateTextureType type)Updates this volume's grid data with the current Volume3DUpdater object.voidupdateData(org.jogamp.java3d.ImageComponent3D imageComponent, int index, int x, int y, int width, int height)Updates the underlying images for by-reference texturesprotected voidupdateDataColumns()protected voidupdateSceneNode()voidupdateShape()Updates the geometric bounds of this ShapeInt.voidupdateTexture()Texture has changed, so the texture must be updated.voidupdateTextureColourMap()Texture values have changed, so the texture must be updated.voidupdateTextureValues()Texture values have changed, so the texture must be updated.voidvertexDataColumnChanged(VertexDataColumnEvent event)voidvertexDataColumnColourMapChanged(VertexDataColumnEvent event)protected voidwriteFullXML(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progress_bar)voidwriteXML(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progress_bar)Writes the XML representation of this object to file.Methods inherited from class mgui.interfaces.shapes.Shape3DInt
addShape2DChild, clear2DChildren, contains, copyAttributes, crossesPlane, destroy, draw2D, drawShape2D, drawShape2D, drawShape2D, fireChildren2D, fireChildren2DModified, fireShapeListeners, fireShapeModified, geometryChanged, getAlpha, getBoundBox, getBoundBoxNode, getBoundSphere, getCenterOfGravity, getDimensions, getDTD, getFullName, getGeometricCenter, getGeometry, getIcon, getInheritingAttribute, getLabelColour, getLabelFont, getLabelScale, getLineColour, getLineStyle, getLocalName, getModifiedAttribute, getParent2D, getParentAttribute, getPopupMenu, getPopupMenuLength, getProximity, getScene3DObject, getScene3DObject, getShape, getShape2D, getShape2DInt, getShape2DInt, getShapeSceneNode, getShapeSceneNode, getShortXML, getTransferData, getTransferDataFlavors, getTreeLabel, getVertex, getVertexAppearance, getVertexColour, getVertexColour, getVertexCount, getVertexScale, getVertexScale, getVertexSelection, getVertices, handlePopupEvent, hasCameraListener, hasParentShape, isDataFlavorSupported, isHeritableAttribute, isInheritingAttribute, isLive, issueTreeNode, needsRedraw, performTransfer, releaseScene3DChildren, removeShape2DChild, setAlpha, setBoundBoxNode, setCreatableSceneNode, setCurrentColumn, setGeometry, setGraphic3DPopupMenu, setLabelColour, setLabelFont, setLabelScale, setLineStyle, setLive, setParent2D, setScene3DObject, setSelectedVertices, setShape, setShapeSceneNode, setShowSelectedVertices, setVertexSelection, showPopupMenu, showVertices, showVertices, updateChildren2D, updateData, updateSelectedVertices, updateVerticesMethods inherited from class mgui.interfaces.shapes.InterfaceShape
_init, addDataLink, addShapeListener, addVertexData, addVertexData, addVertexData, addVertexData, addVertexData, addVertexData, cleanTreeNodes, compareTo, finalizeAfterXML, fromVariable, getAllVertexData, getAttribute, getAttributes, getAttributeValue, getByReferenceUrls, getColourMap, getColourMap, getConstraint, getConstraints, getCurrentColumn, getCurrentDataColumn, getCurrentVertexData, getDataLink, getDataMax, getDataMin, getDatumAtVertex, getDatumAtVertex, getDefaultColourMap, getFileLoader, getFileWriter, getID, getInheritedAttribute, getInheritedAttributes, getInheritedAttributeValue, getLastColumnAdded, getLastColumnChanged, getLastColumnRemoved, getLegalName, getLinkedVertexData, getLinkedVertexDatum, getLoaderOptions, getModel, getName, getNameMap, getNameMap, getNonLinkedDataColumns, getObjectIcon, getParentSet, getPopupMenu, getSourceURL, getUnit, getUrlReference, getVariables, getVariableType, getVariableValue, getVariableValues, getVertexData, getVertexData, getVertexDataColumn, getVertexDataColumnCount, getVertexDataColumnNames, getVertexDataColumns, getVertexDataMap, getWriterOptions, getXML, getXML, getXML, getXMLSchema, handleXMLString, hasAttribute, hasColumn, hasData, inheritAttributesFromParent, isAuxiliaryShape, isAuxiliaryShape, isDestroyed, isDrawable, isImageShape, isLegalName, isLight, isSelectable, isVisible, newVertexData, queryObject, queryShapeAtVertex, register, removeColourMap, removeDataLink, removeNameMap, removeShapeListener, setAttribute, setAttributes, setColourMap, setColourMap, setConstraint, setCurrentColumn, setDataMax, setDataMax, setDataMax, setDataMin, setDataMin, setDataMin, setDatumAtVertex, setDatumAtVertex, setDatumAtVertex, setDatumAtVertex, setDefaultColourMap, setDefaultColourMap, setFileLoader, setFileLoader, setFileWriter, setID, setLoaderOptions, setName, setNameMap, setOverride, setSelectable, setTreeNode, setUnit, setUrlReference, setVariableValues, setVariableValues, setVertexData, setVertexData, setVertexData, setVertexDataMap, setVisible, setWriterOptions, setXMLRoot, show2D, show2D, show3D, show3D, showData, showData, supportsVariableType, toVariable, unsetOverride, writeXML, writeXMLMethods inherited from class mgui.interfaces.AbstractInterfaceObject
clean, updateTreeNodesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface mgui.interfaces.util.CleanableObject
cleanMethods inherited from interface mgui.interfaces.shapes.util.ShapeListener
destroy, isDestroyed
-
Field Details
-
renderer
-
textureSet
protected boolean textureSet -
updater
protected org.jogamp.java3d.ImageComponent3D.Updater updater -
dataFile
protected java.io.File dataFile -
loader
-
intRect3D
-
colour_models
-
masks
protected java.util.HashMap<java.lang.String,boolean[][][]> masks -
apply_mask
protected java.util.HashMap<java.lang.String,java.lang.Boolean> apply_mask -
composite_alphas
protected java.util.HashMap<java.lang.String,java.lang.Double> composite_alphas -
show_in_composite
protected java.util.HashMap<java.lang.String,java.lang.Boolean> show_in_composite -
composite_column_order
protected java.util.ArrayList<java.lang.String> composite_column_order -
group_node
protected org.jogamp.java3d.BranchGroup group_node -
render_node
protected org.jogamp.java3d.BranchGroup render_node -
box_node
protected org.jogamp.java3d.BranchGroup box_node -
xml_is_reading_header
protected boolean xml_is_reading_headerSets the variable's values with thevaluesobject, which must be one of the following types:ArrayList<BufferedImage[]>DataBufferDouble
falseis returned. -
xml_is_reading_composite_order
protected boolean xml_is_reading_composite_order -
xml_composite_column_order
protected java.util.ArrayList<java.lang.String> xml_composite_column_order -
xml_composite_alphas
protected java.util.HashMap<java.lang.String,java.lang.Double> xml_composite_alphas -
xml_show_in_composite
protected java.util.HashMap<java.lang.String,java.lang.Boolean> xml_show_in_composite
-
-
Constructor Details
-
Volume3DInt
public Volume3DInt() -
Volume3DInt
-
Volume3DInt
-
-
Method Details
-
updateDataColumns
protected void updateDataColumns()- Overrides:
updateDataColumnsin classInterfaceShape
-
renameVertexDataColumn
public boolean renameVertexDataColumn(java.lang.String old_name, java.lang.String new_name)Description copied from class:InterfaceShapeRenames the current column.- Overrides:
renameVertexDataColumnin classInterfaceShape- Returns:
falseif a column namednew_namealready exists, or no column namedold_nameexists;trueotherwise
-
setCompositeIndex
public void setCompositeIndex(java.lang.String column, int index)Adjusts the order of columncolumnin the composite rendering stack.- Parameters:
column-index-
-
setCompositeIndex
public void setCompositeIndex(java.lang.String column, int index, boolean notify)Adjusts the order of columncolumnin the composite rendering stack.- Parameters:
column-index-
-
getCompositeOrderedColumns
public java.util.ArrayList<java.lang.String> getCompositeOrderedColumns() -
getGeometryInstance
Description copied from class:InterfaceShapeReturns an instance of thisInterfaceShape's geometry class.- Overrides:
getGeometryInstancein classShape3DInt- Returns:
-
setParentSet
OverridesInterfaceShape.setParentSetto add itself as a listener to the parent- Overrides:
setParentSetin classInterfaceShape
-
getClosestVertex
public int getClosestVertex(org.jogamp.vecmath.Point3f point)Description copied from class:Shape3DIntReturns the index of the vertex of this shape which is closest topoint.- Overrides:
getClosestVertexin classShape3DInt- Returns:
-
shapeUpdated
Description copied from interface:ShapeListenerA shape that this object is listening to has been updated. The specific type of event is defined by ShapeEvent.EventType.- Specified by:
shapeUpdatedin interfaceShapeListener
-
setIcon
protected void setIcon()- Overrides:
setIconin classShape3DInt
-
init
protected void init()- Overrides:
initin classShape3DInt
-
getMasks
public java.util.HashMap<java.lang.String,boolean[][][]> getMasks() -
addVertexData
public boolean addVertexData(java.lang.String column, java.util.ArrayList<MguiNumber> data, NameMap nmap, ColourMap cmap)Description copied from class:InterfaceShapeAdds vertex-wise data to this shape.- Overrides:
addVertexDatain classInterfaceShape- Parameters:
column- The key by which this column is to be referreddata- The values for this columnnmap- Name map [optionally null] associating integer keys to namescmap- Colour map [optionally null] associating values to colours- Returns:
-
addVertexData
Description copied from class:InterfaceShapeAdd a vertex-wise data column of typeDataBuffer.TYPE_DOUBLE.- Overrides:
addVertexDatain classInterfaceShape
-
addVertexData
public boolean addVertexData(java.lang.String column, int data_type)Description copied from class:InterfaceShapeAdd a vertex-wise data column of typedataType, which must be one ofDataBuffer.TYPE_DOUBLE,DataBuffer.TYPE_FLOAT, orDataBuffer.TYPE_INT. If an incorrect type is specified, this method creates a column of typeDataBuffer.TYPE_DOUBLE.- Overrides:
addVertexDatain classInterfaceShape- Parameters:
column- The key associated with the data columndata_type- The data type with which to store the data
-
removeVertexData
public void removeVertexData(java.lang.String column)Description copied from class:InterfaceShapeRemove a vertex data column from this shape. This also removes all associated data, and calls listeners to update, for instance, tree nodes.- Overrides:
removeVertexDatain classInterfaceShape
-
isComposite
public void isComposite(boolean show)Set the flag which determines whether this volume should render as a composite of its columnsshow == true, or as the current column onlyshow == false.- Parameters:
show-
-
isComposite
public void isComposite(boolean show, boolean update)Set the flag which determines whether this volume should render as a composite of its columnsshow == true, or as the current column onlyshow == false.- Parameters:
show-update- Whether to notify attribute listeners
-
isComposite
public boolean isComposite()Determines whether this volume is current set to render as a composite of its columnstrue, or as the current column onlyfalse. -
setCompositeAlpha
public void setCompositeAlpha(java.lang.String column, double value)Sets the alpha value forcolumn, which determines its transparency if composite mode is set. Also fires aShapeEvent.- Parameters:
key-value-
-
setCompositeAlpha
public void setCompositeAlpha(java.lang.String column, double value, boolean update)Sets the alpha value forcolumn, which determines its transparency if composite mode is set.- Parameters:
key-value-update- Whether to notify listeners of the change
-
getCompositeAlpha
public double getCompositeAlpha(java.lang.String column) -
showInComposite
public void showInComposite(java.lang.String column, boolean show)Sets whether to includecolumn's data in the composite image- Parameters:
column-show-
-
showInComposite
public void showInComposite(java.lang.String column, boolean show, boolean update)Sets whether to includecolumn's data in the composite image.- Parameters:
column-show-update- Whether to notify this volume's listeners
-
showInComposite
public boolean showInComposite(java.lang.String column)Returns whethercolumn's data is to be included in the composite image.- Parameters:
column-- Returns:
-
addMask
public void addMask(java.lang.String name, boolean[][][] mask)Adds a boolean mask to this volume. Set = true by default.- Parameters:
name-mask-
-
addMask
public void addMask(java.lang.String name, boolean[][][] mask, boolean apply)Adds a boolean mask to this volume.- Parameters:
name-mask-set-
-
clearMask
public void clearMask(java.lang.String name) -
invertMask
public void invertMask(java.lang.String name) -
isMaskedAtPoint
public boolean isMaskedAtPoint(org.jogamp.vecmath.Point3f point)Determines whether the voxel enclosingpointis masked.- Parameters:
p-- Returns:
-
isMaskedAtVoxel
public boolean isMaskedAtVoxel(int[] voxel)Determines whethervoxelis masked by any active mask- Parameters:
voxel-- Returns:
-
isMaskedAtVoxel
public boolean isMaskedAtVoxel(int i, int j, int k)Determines whethervoxelis masked by any active mask- Parameters:
voxel-- Returns:
-
getCenterOfVoxel
public org.jogamp.vecmath.Point3f getCenterOfVoxel(int i, int j, int k) -
isMaskApplied
public boolean isMaskApplied(java.lang.String name) -
getMaskNames
public java.util.ArrayList<java.lang.String> getMaskNames()Returns an ordered list of mask names for this volume.- Returns:
-
getEffectiveMask
public boolean[][][] getEffectiveMask()Returns the union of all masks which are currently set.- Returns:
-
setMaskApplied
public void setMaskApplied(java.lang.String name, boolean b) -
removeMask
public void removeMask(java.lang.String name) -
getMask
public boolean[][][] getMask(java.lang.String name) -
setMask
public void setMask(java.lang.String name, boolean show) -
setMask
public void setMask(java.lang.String name, boolean[][][] mask) -
unionMaskWithVolume
Sets masknameto a new mask which is a union between its current state and the mask specified byvolume, where all zero-valued voxels are masked.- Parameters:
name-volume-column- The data column ofvolumecontaining the mask- Returns:
-
unionMaskWithVolume
public boolean unionMaskWithVolume(java.lang.String name, Volume3DInt volume, java.lang.String column)Sets masknameto a new mask which is a union between its current state and the mask specified byvolume, where all zero-valued voxels are masked.- Parameters:
name-volume-column- The data column ofvolumecontaining the mask- Returns:
-
unionMask
public boolean unionMask(java.lang.String name, boolean[][][] to_merge) -
setAllMasks
public void setAllMasks(boolean show) -
applyMask
public void applyMask()Applies the mask specified in params to the data in this volume. NOTE: temporary until I can get the updater to work. This function reloads data from the file filter and applies the given mask to it, whereas I'd prefer to update referenced data directly, since this is much quicker and more seamless.- Parameters:
params-
-
setUpdater
Sets an updater class, descended from Volume3DUpdater, with which to update the data in this volume's grid. All updates to Volume3DInt data for objects with live scene nodes must be performed using such an updater. Grid data must be set by reference (isByRef() = true) in order to set an updater.- Parameters:
u- Volume3DUpdater with which to update this volume's data
-
update
Updates this volume's grid data with the current Volume3DUpdater object. Does nothing if this Volume3DInt is not set by reference (isByRef() = true), or if no updater is currently set. Updaters can be set using the setUpdater method.- Parameters:
type- The type of update to perform: Values only, Colour map only, or both
-
isByRef
public boolean isByRef() -
getGrid
Returns the Grid3D associated with this volume.- Returns:
-
getVertexIndex
public int getVertexIndex(int[] voxel)Obtains an absolute (vertex) index for the specified voxel indices- Parameters:
voxel-- Returns:
-
getVertexIndex
public int getVertexIndex(int i, int j, int k)Obtains an absolute (vertex) index for the specified voxel indices- Parameters:
voxel-- Returns:
-
getDatumAtVoxel
Returns the datum from the current column atindex.- Parameters:
index-- Returns:
-
getDatumAtVoxel
Returns the datum fromcolumnatindex.- Parameters:
column-i-j-k-- Returns:
-
getDatumAtVoxel
Returns the datum from the current column atindex.- Parameters:
index-- Returns:
-
getDatumAtVoxel
Returns the datum fromcolumnatindex.- Parameters:
column-index-- Returns:
-
setDatumAtVoxel
Sets the datum from the current column atindex.- Parameters:
index-- Returns:
-
setDatumAtVoxel
Sets the datum fromcolumnatindex.- Parameters:
column-index-- Returns:
-
setDatumAtVoxel
public boolean setDatumAtVoxel(int[] voxel, double datum)Sets the datum from the current column atindex.- Parameters:
index-- Returns:
-
setDatumAtVoxel
public boolean setDatumAtVoxel(java.lang.String column, int[] voxel, double datum)Sets the datum fromcolumnatindex.- Parameters:
column-index-- Returns:
-
setDatumAtVoxel
Sets the datum from the current column atindex.- Parameters:
index-- Returns:
-
setDatumAtVoxel
Sets the datum fromcolumnatindex.- Parameters:
column-index-- Returns:
-
setDatumAtVoxel
public boolean setDatumAtVoxel(int i, int j, int k, double datum)Sets the datum from the current column atindex.- Parameters:
index-- Returns:
-
setDatumAtVoxel
public boolean setDatumAtVoxel(java.lang.String column, int i, int j, int k, double datum)Sets the datum fromcolumnatindex.- Parameters:
column-index-- Returns:
-
getDatumAtPoint
Returns the datum from the current column for the voxel enclosingpoint.- Parameters:
point-- Returns:
- The value, or
Double.NaNispointis not enclosed by this volume
-
getDatumAtPoint
Returns the datum from thecolumnfor the voxel enclosingpoint.- Parameters:
column-point-- Returns:
- The value, or
nullifpointis not enclosed by this volume
-
getInterpolatedValueAtPoint
public double getInterpolatedValueAtPoint(org.jogamp.vecmath.Point3f p, int t)Returns a value which is interpolated from the voxel enclosingpand its nearest neighbours. Interpolation is an average weighted by the inverse distance of the center points of these neighbouring voxels top. Uses the current data column.- Parameters:
p- The geometric point at which to samplet- The time, if this is a stack of time points- Returns:
- The sampled value, or
Double.NaNif this point is not within the bounds of this grid
-
getInterpolatedValueAtPoint
public double getInterpolatedValueAtPoint(org.jogamp.vecmath.Point3f p)Returns a value which is interpolated from the voxel enclosingpand its nearest neighbours. Interpolation is an average weighted by the inverse distance of the center points of these neighbouring voxels top. Time point is assumed to be 1. Uses the current data column.- Parameters:
p- The geometric point at which to sample- Returns:
- The sampled value, or
Double.NaNif this point is not within the bounds of this grid
-
getInterpolatedValueAtPoint
public double getInterpolatedValueAtPoint(java.lang.String column, org.jogamp.vecmath.Point3f p)Returns a value which is interpolated from the voxel enclosingpand its nearest neighbours. Interpolation is an average weighted by the inverse distance of the center points of these neighbouring voxels top. Time point is assumed to be 1. Uses the current data column.- Parameters:
column- The vertex data columnp- The geometric point at which to sample- Returns:
- The sampled value, or
Double.NaNif this point is not within the bounds of this grid
-
getInterpolatedValueAtPoint
public double getInterpolatedValueAtPoint(java.lang.String column, org.jogamp.vecmath.Point3f p, int t)Returns a value which is interpolated from the voxel enclosingpand its nearest neighbours. Interpolation is an average weighted by the inverse distance of the center points of these neighbouring voxels top.- Parameters:
column- The vertex data columnp- The geometric point at which to samplet- The time, if this is a stack of time points- Returns:
- The sampled value, or
Double.NaNif this point is not within the bounds of this grid
-
sampleFromVolume
Samplessample_volumewhere its geometric bounds cross the bounds of this volume. All non-crossing voxels will be assigned a value ofdata_min. Source and target columns are the current columns of either volume.- Parameters:
sample_grid-- Returns:
-
sampleFromVolume
Samplessample_volumewhere its geometric bounds cross the bounds of this volume. All non-crossing voxels will be assigned a value ofnan_value. Source and target columns are the current columns of either volume.- Parameters:
sample_grid-nan_value- Value to assign if voxel is outsidesample_volume- Returns:
-
sampleFromVolume
public boolean sampleFromVolume(Volume3DInt sample_volume, java.lang.String source_column, java.lang.String target_column)Samplessample_volumewhere its geometric bounds cross the bounds of this volume. All non-crossing voxels will be assigned a value ofdata_min.- Parameters:
sample_grid-source_column- The column insample_volumefrom which to sample.target_column- The target column in this volume. Will be created if it does not exist; otherwise, will be overwritten- Returns:
-
sampleFromVolume
public boolean sampleFromVolume(Volume3DInt sample_volume, java.lang.String source_column, java.lang.String target_column, double nan_value)Samplessample_volumewhere its geometric bounds cross the bounds of this volume. All non-crossing voxels will be assigned a value ofnan_value.- Parameters:
sample_grid-source_column- The column insample_volumefrom which to sample.target_column- The target column in this volume. Will be created if it does not exist; otherwise, will be overwrittennan_value- Value to assign if voxel is outsidesample_volume- Returns:
-
getDataType
public int getDataType()Returns the data type of the current column. Returns -1 if no current column is set.- Returns:
-
getDataType
public int getDataType(java.lang.String column)Returns the data type ofcolumn. Returns -1 if there is no column by that name.- Returns:
-
vertexDataColumnColourMapChanged
- Specified by:
vertexDataColumnColourMapChangedin interfaceVertexDataColumnListener- Overrides:
vertexDataColumnColourMapChangedin classInterfaceShape
-
vertexDataColumnChanged
- Specified by:
vertexDataColumnChangedin interfaceVertexDataColumnListener- Overrides:
vertexDataColumnChangedin classInterfaceShape
-
setMapMax
public void setMapMax(float m) -
getMapMax
public float getMapMax() -
setMapMin
public void setMapMin(float m) -
getMapMin
public float getMapMin() -
setGrid
-
setGrid
-
registerCameraListener
- Overrides:
registerCameraListenerin classShape3DInt
-
deregisterCameraListener
- Overrides:
deregisterCameraListenerin classShape3DInt
-
getCameraListener
- Overrides:
getCameraListenerin classShape3DInt
-
setTexture
public void setTexture()Resets the texture for this volume's renderer. -
setTexture
public void setTexture(boolean setModel)Resets the texture for this volume's renderer.- Parameters:
setModel- - Also resets the colour model
-
updateTextureValues
public void updateTextureValues()Texture values have changed, so the texture must be updated. Does not reset the colour model; use updateTextureColourMap() to do this. -
updateTextureColourMap
public void updateTextureColourMap()Texture values have changed, so the texture must be updated. Does not reset the colour model; use updateTextureColourMap() to do this. -
updateTexture
public void updateTexture()Texture has changed, so the texture must be updated. Also resets the colour model. -
getColourModel
Returns the colour model for the current column, ornullif there is no current column.- Returns:
-
getColourModel
-
attributeUpdated
Description copied from class:Shape3DIntResponds to an update in one of this shape's attributes.Subclasses should override and call this super method AFTER handling the attribute change appropriately. Subclasses should also override needsRedraw() to indicate whether the scene node should be regenerated.
- Specified by:
attributeUpdatedin interfaceAttributeListener- Overrides:
attributeUpdatedin classShape3DInt- Parameters:
e- anAttributeEventspecifying which attribute has been changed
-
setApplyMasks
public void setApplyMasks(boolean b)Sets whether currently set masks are to be applied or not. -
getApplyMasks
public boolean getApplyMasks()Whether currently set masks are to be applied or not.- Returns:
-
getTexture
-
setBounds
-
updateShape
public void updateShape()Description copied from class:Shape3DIntUpdates the geometric bounds of this ShapeInt. Does not callShape3DInt.setScene3DObject().- Overrides:
updateShapein classShape3DInt
-
updateSceneNode
protected void updateSceneNode() -
updateData
public void updateData(org.jogamp.java3d.ImageComponent3D imageComponent, int index, int x, int y, int width, int height)Updates the underlying images for by-reference textures- Specified by:
updateDatain interfaceorg.jogamp.java3d.ImageComponent3D.Updater
-
setScene3DObject
public void setScene3DObject(boolean make_live)Description copied from class:Shape3DIntSets this ShapeInt's Java3D scene node from its current geometry and rendering attributes. This node should be retrieved using theShape3DInt.getShapeSceneNode()method. A scene node will only created if one of these conditions is met:- The shape is auxiliary (i.e., not a model shape, but a helper shape such as a section polygon)
- The shape is associated with a ShapeModel3D, and this model is live (is associated with at least one Java3D scene graph).
- Overrides:
setScene3DObjectin classShape3DInt
-
getRenderMode
public java.lang.String getRenderMode()Returns the current render mode of this volume- Returns:
-
setRenderMode
public void setRenderMode(java.lang.String mode)Sets the current render mode of this volume- Parameters:
mode-
-
getBox
-
hasAlpha
public boolean hasAlpha()Description copied from class:InterfaceShapeQueries whether this shape has transparency.- Overrides:
hasAlphain classShape3DInt- Returns:
-
getShape2D
protected Shape2DInt getShape2D(Plane3D plane, float above_dist, float below_dist, org.jogamp.vecmath.Matrix4d transform)Description copied from class:Shape3DIntTo be overridden by subclasses implementing a 2D representation- Overrides:
getShape2Din classShape3DInt- Parameters:
plane- Plane on which to renderabove_dist- Distance above plane within which to project a shapebelow_dist- Distance below plane within which to project a shape- Returns:
-
colourMapChanged
- Specified by:
colourMapChangedin interfaceColourMapListener
-
hasAlpha
public void hasAlpha(boolean b)Description copied from class:InterfaceShapeSpecifies whether this shape has transparency.- Overrides:
hasAlphain classShape3DInt
-
hasAlpha
public void hasAlpha(java.lang.String column, boolean b) -
toString
public java.lang.String toString()- Overrides:
toStringin classShape3DInt
-
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 classInterfaceShape- 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 classInterfaceShape- Parameters:
localName- Local name of the element- Throws:
org.xml.sax.SAXException
-
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 classInterfaceShape- 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
-
writeFullXML
protected void writeFullXML(int tab, java.io.Writer writer, XMLOutputOptions options, ProgressUpdater progress_bar) throws java.io.IOException- Throws:
java.io.IOException
-