public class CustomVolumeBehavior2 extends InteractiveBehavior
CustomVolumeBehavior2 implements the special Java 3d Picking behavior needed by the Volume_Calculator. Here we are only concerned with the MOUSE_CLICKED event, any others are passed up unless the user has chosen to use keyboard navigation only. In this case, keyboard events are processed.
The special behavior consists of waiting for two clicks of the mouse button followed by the identification of the Java 3D nodes that are in a path connected between the two click points. This path is traversed calculating the volume. If there is no path, the user is warned and nothing is done.
For an explanation of how the voxels are counted, please see the
reconstructEdge method comments.
The InteractiveBehavior of the 3D Viewer is extended so as to catch these events first.
ALLOW_AUTO_COMPUTE_BOUNDS_READ, ALLOW_AUTO_COMPUTE_BOUNDS_WRITE, ALLOW_BOUNDS_READ, ALLOW_BOUNDS_WRITE, ALLOW_COLLIDABLE_READ, ALLOW_COLLIDABLE_WRITE, ALLOW_LOCAL_TO_VWORLD_READ, ALLOW_LOCALE_READ, ALLOW_PARENT_READ, ALLOW_PICKABLE_READ, ALLOW_PICKABLE_WRITE, ENABLE_COLLISION_REPORTING, ENABLE_PICK_REPORTING
|Constructor and Description|
Build an instance of CustomVolumeBehavior.
|Modifier and Type||Method and Description|
This method is not part of the plugin's advertised public interface.
Handle the alt arrow mouse events for zooming here because the superclass does not do anything: zoom(1)
Intercept the 3D Viewer's mouse event processing so that we can focus on the clicking of network paths first.
getExternalBehaviors, initialize, processStimulus, setExternalBehaviours
getEnable, getNumSchedulingIntervals, getSchedulingBoundingLeaf, getSchedulingBounds, getSchedulingInterval, getView, getWakeupCondition, postId, setEnable, setSchedulingBoundingLeaf, setSchedulingBounds, setSchedulingInterval, updateNodeReferences, wakeupOn
cloneNode, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, cloneTree, duplicateNode, getBounds, getBoundsAutoCompute, getCollidable, getLocale, getLocalToVworld, getLocalToVworld, getParent, getPickable, setBounds, setBoundsAutoCompute, setCollidable, setPickable
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString
public CustomVolumeBehavior2(Image3DUniverse universe, Content content, Volumes volumes, VolumesPanel volumesPanel, ImagePlus imagePlus, ImagePlus originalImage)
Build an instance of CustomVolumeBehavior. It is a subclass of InteractiveBehavior which means that its basic role is to intercept key and mouse events.
Mouse events are those that select an edge from a display graph.
Key events can be used for navigational control (eg, left, right, etc)
The bulk of the logic determines whether one can traverse between the clicks on an edge or edges. If so, for every edge - inclusive - between the two selected edges, the coordinates of the edge are used to extract the pixels (present and eroded) from the original image.
The so-called blob lists are built in this constructor for late use.
universe- The J3D Universe
content- A wrapper around the J3D group representing the graph
volumes- A set of accumulaters for each selected color
volumesPanel- Where the volumes values appear
imagePlus- ImageJ structure
originalImage- The original image as an ImajeJ structure
public void doProcess(MouseEvent e)
protected void doProcess(KeyEvent ke)
public int computeAllEdgesVolume()
Copyright © 2015–2017 Fiji. All rights reserved.