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.
TWO_RAD, univ
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 |
---|
CustomVolumeBehavior2(Image3DUniverse universe,
Content content,
Volumes volumes,
VolumesPanel volumesPanel,
ij.ImagePlus imagePlus,
ij.ImagePlus originalImage)
Build an instance of CustomVolumeBehavior.
|
Modifier and Type | Method and Description |
---|---|
int |
computeAllEdgesVolume()
This method is not part of the plugin's advertised public interface.
|
protected void |
doProcess(KeyEvent ke)
Handle the alt arrow mouse events for zooming here because the
superclass does not do anything: zoom(1)
|
void |
doProcess(MouseEvent e)
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, ij.ImagePlus imagePlus, ij.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 Universecontent
- A wrapper around the J3D group representing the graphvolumes
- A set of accumulaters for each selected colorvolumesPanel
- Where the volumes values appearimagePlus
- ImageJ structureoriginalImage
- The original image as an ImajeJ structurepublic void doProcess(MouseEvent e)
doProcess
in class InteractiveBehavior
e
- the mouse event (click, etc.)protected void doProcess(KeyEvent ke)
doProcess
in class InteractiveBehavior
ke
- the key event, e.g., arrow up.public int computeAllEdgesVolume()
Copyright © 2015–2021 Fiji. All rights reserved.