public class DicomPlaneViewer extends TexturePlaneBase
CompositeComponent.NavpanelDisplay
ModelComponent.NavpanelVisibility
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_DICOM_VISIBLE |
static PropertyList |
myProps |
dynamicVelInWorldCoords, myRenderFrame
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
TG_ARTICULATED, TG_DRAGGER, TG_PRESERVE_ORIENTATION, TG_SIMULATING
COPY_REFERENCES, REST_POSITION
TRANSPARENT, TWO_DIMENSIONAL
Constructor and Description |
---|
DicomPlaneViewer()
Creates an empty image-plane viewer widget.
|
DicomPlaneViewer(java.lang.String name,
DicomViewer dviewer,
PolygonalMesh templateMesh,
RigidTransform3d TPW,
RigidTransform3d TVI)
Creates a new image-plane viewer widget, with supplied name and DICOM image
|
DicomPlaneViewer(java.lang.String name,
DicomViewer dviewer,
Vector2d widths,
RigidTransform3d TPW)
Creates a new image-plane viewer widget, with supplied name and DICOM image
|
DicomPlaneViewer(java.lang.String name,
DicomViewer dviewer,
Vector2d widths,
RigidTransform3d TPW,
RigidTransform3d TVI)
Creates a new image-plane viewer widget, with supplied name and DICOM image
|
Modifier and Type | Method and Description |
---|---|
static RenderProps |
createDefaultRenderProps() |
RenderProps |
createRenderProps()
Factory method to create render properties appropriate to this object.
|
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
boolean |
getDicomVisible() |
DicomImage |
getImage() |
PolygonalMesh |
getImageMesh() |
DicomPixelInterpolator |
getPixelInterpolator() |
Vector2d |
getSize()
Returns the size of the plane
|
void |
getSoftReferences(java.util.List<ModelComponent> refs)
Appends all soft references for this component to a list.
|
boolean |
getSpatialInterpolation()
Checks if spatial interpolation between voxels is enabled
|
int |
getTimeIndex() |
IntegerInterval |
getTimeIndexRange() |
java.lang.String[] |
getWindowNames() |
StringRange |
getWindowRange() |
boolean |
isSelectable()
Returns true if this object is in fact selectable.
|
int |
numWindows() |
void |
prerender(RenderList list)
Called prior to rendering to allow this object to update the internal
state required for rendering (such as by caching rendering coordinates).
|
void |
scaleMesh(double s) |
void |
setDicomVisible(boolean enable) |
void |
setImageFromViewer(DicomViewer dviewer,
RigidTransform3d TPW)
Sets the texture image from a dicom viewer.
|
void |
setSize(Vector2d widths)
Sets the widths of the plane
|
void |
setSpatialInterpolation(boolean set)
Sets whether to use spatial interpolation (tri-linear) or nearest neighbour
when computing voxels.
|
void |
setTimeIndex(int idx)
Sets the current time index.
|
void |
setWindow(java.lang.String presetName)
Sets the current interpolation window to use, based on a preset name.
|
void |
transformGeometry(GeometryTransformer gtr,
TransformGeometryContext context,
int flags)
Transforms the geometry of this component, using the geometry transformer
gtr to transform its individual attributes. |
void |
updateReferences(boolean undo,
java.util.Deque<java.lang.Object> undoInfo)
May be called by the system if any of the soft references for
this component are removed from the the component hierarchy.
|
void |
updateRenderProps() |
addMarker, canAddMarker, componentChanged, copy, createMarker, createMarker, createMarker, findComponent, get, get, getByNumber, getChildren, getMarkers, getNavpanelDisplay, getNumberLimit, getSurfaceMesh, getSurfaceMeshes, hasChildren, hasState, hierarchyContainsReferences, indexOf, iterator, numComponents, numSurfaceMeshes, postscan, render, scaleDistance, scan, setDisplayMode, transformGeometry, updateBounds, updateNameMap
add1DConstraintBlocks, add2DConstraintBlocks, addEffectiveFrameMass, addEffectivePointMass, addExternalForce, addForce, addForce, addFrameForce, addPointForce, addPointForce, addPosImpulse, addPosJacobian, addRelativeVelocity, addScaledExternalForce, addSolveBlock, addSolveBlocks, addTargetJacobian, addToPointVelocity, addTransformableDependencies, addVelJacobian, applyExternalForces, applyForces, applyGravity, collectMasterComponents, computeAppliedWrench, computeForceOnMasters, computeFrameLocation, computeFramePosition, computeFramePosVel, computeFrameVelocity, computePointCoriolis, computePointLocation, computePointPosition, computePointPosVel, computePointVelocity, createFrameAttachment, createMassBlock, createPointAttachment, getAxisDrawStyle, getAxisLength, getBodyForce, getBodyVelocity, getBodyVelState, getCopyReferences, getEffectiveMass, getEffectiveMass, getEffectiveMassForces, getExternalForce, getForce, getForce, getForce, getFrameDamping, getFrameDampingMode, getJacobianType, getMass, getMass, getMoment, getOrientation, getOrientation, getPosDerivative, getPose, getPose, getPosition, getPosState, getPosStateSize, getRenderFrame, getRotaryDamping, getRotaryDampingMode, getRotation, getSelection, getState, getTargetActivity, getTargetOrientation, getTargetPos, getTargetPose, getTargetPosition, getTargetVel, getTargetVelocity, getTraceablePositionProperty, getTraceables, getTransForce, getVelocity, getVelocity, getVelState, getVelStateSize, getWorldVelState, hasForce, isDuplicatable, isMassConstant, mulInverseEffectiveMass, resetEffectiveMass, resetTargets, scaleMass, setAxisDrawStyle, setAxisLength, setBodyVelocity, setContactConstraint, setExternalForce, setForce, setForce, setFrameDamping, setFrameDampingMode, setOrientation, setPose, setPosition, setPosState, setRandomForce, setRandomPosState, setRandomVelState, setRotaryDamping, setRotaryDampingMode, setRotation, setState, setState, setTargetActivity, setTargetOrientation, setTargetPos, setTargetPose, setTargetPosition, setTargetVel, setTargetVelocity, setVelocity, setVelocity, setVelState, transformPose, updateAttachmentPosStates, velocityLimitExceeded, zeroExternalForces, zeroForces
addAttachmentRequest, addConstrainer, addMasterAttachment, connectToHierarchy, disconnectFromHierarchy, getAttachment, getConstrainers, getInverseMass, getMasterAttachments, getSolveIndex, isActive, isAttached, isControllable, isDynamic, isParametric, removeAttachmentRequest, removeConstrainer, removeMasterAttachment, setAttached, setSolveIndex
defaultRenderPropsAreNull, getRenderHints, getRenderProps, isVisible, numSelectionQueriesNeeded, setRenderProps, setVisible, updateRenderProps
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, createTempFlag, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, isFixed, isMarked, isScanning, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, isFixed, isMarked, isSelected, notifyParentOfChange, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable
getProperty
isWritable, write
addTransformableDependencies, transformPriority
addAttachmentRequest, removeAttachmentRequest
addConstrainer, addMasterAttachment, getAttachment, getConstrainers, getInverseMass, getMasterAttachments, getSolveIndex, isActive, isAttached, isControllable, isDynamic, isParametric, removeConstrainer, removeMasterAttachment, setAttached, setSolveIndex
advanceState, getAuxVarDerivative, getAuxVarState, getStateVersion, numAuxVars, requiresAdvance, setAuxVarState
isControllable
public static boolean DEFAULT_DICOM_VISIBLE
public static PropertyList myProps
public DicomPlaneViewer()
public DicomPlaneViewer(java.lang.String name, DicomViewer dviewer, PolygonalMesh templateMesh, RigidTransform3d TPW, RigidTransform3d TVI)
name
- widget namedviewer
- DicomViewer providing the DICOM image datatemplateMesh
- defines the topology of the mesh onto which the image
will be mappedTPW
- location/orientation of image plane center (world coordinates)TVI
- if non-null, gives transform from image to viewerpublic DicomPlaneViewer(java.lang.String name, DicomViewer dviewer, Vector2d widths, RigidTransform3d TPW, RigidTransform3d TVI)
name
- widget namedviewer
- DicomViewer providing the DICOM image datawidths
- widths of image planeTPW
- location/orientation of image plane center (world coordinates)TVI
- if non-null, gives transform from image to viewerpublic DicomPlaneViewer(java.lang.String name, DicomViewer dviewer, Vector2d widths, RigidTransform3d TPW)
name
- widget namedviewer
- DicomViewer providing the DICOM image datawidths
- widths of image planeTPW
- location/orientation of image plane center (world coordinates)public PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class Frame
public static RenderProps createDefaultRenderProps()
public boolean getDicomVisible()
public void setDicomVisible(boolean enable)
public void scaleMesh(double s)
public void setImageFromViewer(DicomViewer dviewer, RigidTransform3d TPW)
public RenderProps createRenderProps()
HasRenderProps
createRenderProps
in interface HasRenderProps
createRenderProps
in class Frame
public void updateRenderProps()
public DicomImage getImage()
public PolygonalMesh getImageMesh()
public int numWindows()
public java.lang.String[] getWindowNames()
public void setWindow(java.lang.String presetName)
presetName
- name of the interpolation windowpublic void prerender(RenderList list)
IsRenderable
list.addIfVisible (obj);
for each of the objects in question.prerender
in interface IsRenderable
prerender
in class TexturePlaneBase
list
- list of objects to be renderedpublic DicomPixelInterpolator getPixelInterpolator()
public StringRange getWindowRange()
public boolean isSelectable()
RenderableComponentBase
isSelectable
in interface IsSelectable
isSelectable
in class RenderableComponentBase
public void setSize(Vector2d widths)
widths
- plane widthspublic Vector2d getSize()
public boolean getSpatialInterpolation()
public void setSpatialInterpolation(boolean set)
set
- enable/disable spatial interpolationpublic int getTimeIndex()
public void setTimeIndex(int idx)
idx
- time indexpublic IntegerInterval getTimeIndexRange()
public void transformGeometry(GeometryTransformer gtr, TransformGeometryContext context, int flags)
TransformableGeometry
gtr
to transform its individual attributes. The
context
argument supplies information about what other
components are currently being transformed, and also allows the
requesting of update actions to be performed after all transform called
have completed. The context is also the usual entity that calls
this method, from within its TransformGeometryContext.apply(maspack.geometry.GeometryTransformer, int)
method. The argument flags
provides flags to specify
various conditions associated with the the transformation.
At present, the available flags are TransformableGeometry.TG_SIMULATING
and
TransformableGeometry.TG_ARTICULATED
.
This method is not usually called directly by applications.
Instead, it is typically called from within the
TransformGeometryContext.apply(maspack.geometry.GeometryTransformer, int)
method of the context,
which takes care of the various operations needed for a
complete transform operation, including calling
TransformableGeometry.addTransformableDependencies(artisynth.core.modelbase.TransformGeometryContext, int)
to collect other
components that should be transformed, calling
TransformableGeometry.transformGeometry(maspack.matrix.AffineTransform3dBase)
for each component, notifying
component parents that the geometry has changed, and calling
any requested TransformGeometryAction
s. More details
are given in the documentation for
TransformGeometryContext.apply(maspack.geometry.GeometryTransformer, int)
.
TransformGeometryContext
provides a number of
static convenience transform
methods
which take care of building the context and calling
apply()
for a specified set of components.
This method should not
generally call transformGeometry()
for its descendant
components. Instead, descendants needing transformation should be
specified by adding them to the context in the method TransformableGeometry.addTransformableDependencies(artisynth.core.modelbase.TransformGeometryContext, int)
.
transformGeometry
in interface TransformableGeometry
transformGeometry
in class TexturePlaneBase
gtr
- transformer implementing the transformcontext
- context information, including what other components
are being transformedflags
- specifies conditions associated with the transformationpublic void getSoftReferences(java.util.List<ModelComponent> refs)
updateReferences()
method will
be called to update its internal reference information.getSoftReferences
in interface ModelComponent
getSoftReferences
in class ModelComponentBase
refs
- list to which soft references are appendedpublic void updateReferences(boolean undo, java.util.Deque<java.lang.Object> undoInfo)
ModelComponentBase
undo
equal to false
,
this component should then examine its soft references and
use ComponentUtils.areConnected()
to determine which of them have been disconnected from the hierarchy.
Disconnected references should be removed, and sufficient information
should be appended to undoInfo
to allow this update
to be undone if this method is called later with undo
equal to true
. When undoing an update, the undo
information should be removed from the front of undoInfo
.updateReferences
in interface ModelComponent
updateReferences
in class ModelComponentBase
undo
- if true
, indicates that the most
recent reference update should be undone, using the supplied
undo information.undoInfo
- if undo
is false
, should be used
to store information allowing the reference update to be undone.
Otherwise, if undo
is true
, then this
supplied information to undo the most recent update.