public class MedicalHelper
extends java.lang.Object
Summary:
dicomAdjustVolume()
dicomAdjustDataRange()
dicomSetWindowCenterWidth()
and
dicomGetWindowCenterWidth()
dicomFindFilesbySeries()
orientView()
DicomInfo
,
Gnomon
,
Magnifier
,
OrthoSliceBorder
,
Ruler
,
SliceOrientationMarkers
,
SliceScaleBar
,
TextBox
Modifier and Type | Class and Description |
---|---|
static class |
MedicalHelper.Axis
Medical axis names.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EXAMPLE_LOGO |
static short |
WINDOW_HEIGHT |
static short |
WINDOW_WIDTH |
Constructor and Description |
---|
MedicalHelper() |
Modifier and Type | Method and Description |
---|---|
static SoSeparator |
buildSliceAnnotation(SoCamera camera,
SoOrthoSlice sliceNode,
java.lang.String filename)
Slice viewer annotations.
|
static SoSeparator |
buildSliceOrientationMarkers(SoOrthoSlice orthoSlice)
Build a scene graph to display slice orientation markers.
|
static SoSeparator |
buildSliceScaleBars(SoCamera camera)
Build a scene graph to display dynamic scale bars for slice viewing.
|
static SoSeparator |
createBoundingBox(SbBox3f bbox,
SbColor color)
Convenience function to draw a specified bounding box as a wireframe
|
static SoSeparator |
createCube(SbBox3f bbox)
Convenience function to retrieve the cube corresponding to the specified
bounding box.
|
static boolean |
dicomAdjustDataRange(SoDataRange rangeNode,
SoVolumeData volume)
Adjust data range based on values in the DICOM file, i.e.
|
static boolean |
dicomAdjustVolume(SoVolumeData volume,
boolean useImagePosition)
Optimize volume data node for DICOM volumes.
|
static boolean |
dicomAdjustVolume(SoVolumeData volume,
SoMatrixTransform imgToPatient)
Similar to dicomAdjustVolume( SoVolumeData, boolean ) above but returns an SoMatrixTransform
that can be used to properly locate VolumeData in patient space in case of non axis aligned
acquisition:
|
static SbVec3f |
dicomGetImagePosition(SoVolumeData volume)
Get the "Image Position (Patient)" attribute (0020,0032) from a DICOM
volume.
|
static boolean |
dicomGetWindowCenterWidth(SoVolumeData volume,
SbVec2f winCW)
Get the window center (level) and width values from a DICOM volume.
|
static void |
dollyZoom(float value,
SoCameraInteractor cameraInteractor)
Make the scene appear larger or smaller.
|
static SoNode |
exampleDicomAnnotation(java.lang.String filename)
Returns a collection of DicomInfo annotation nodes for Open Inventor
medical examples.
|
static <NodeClass extends SoNode> |
find(SoNode root,
java.lang.Class<NodeClass> nodeClass)
Convenience function to find first specified node in the scene graph.
|
static <NodeClass extends SoNode> |
find(SoNode root,
java.lang.Class<NodeClass> nodeClass,
java.lang.String nodeName)
Convenience function to find first specified node in the scene graph.
|
static SbBox3f |
getBoundingBox(SoNode node)
Convenience function to retrieve the bounding box of the specified node.
|
static SoNode |
getExampleLogoNode()
Returns the example logo node
|
static boolean |
orientView(MedicalHelper.Axis axis,
SoCamera camera,
SoVolumeData volume)
Equivalent to
orientView(axis, camera, volume, 1.01f) |
static boolean |
orientView(MedicalHelper.Axis axis,
SoCamera camera,
SoVolumeData volume,
float slack)
Adjusts the camera to view a slice or volume along the specified axis.
|
static SoSeparator |
readFile(java.lang.String filename)
Convenience function to read a .iv file and return pointer to the root of
the created scene graph.
|
public static final java.lang.String EXAMPLE_LOGO
public static final short WINDOW_HEIGHT
public static final short WINDOW_WIDTH
public static SoNode exampleDicomAnnotation(java.lang.String filename)
filename
- Path to a DICOM file from which info will be extractedpublic static void dollyZoom(float value, SoCameraInteractor cameraInteractor)
Provided as a convenience to simplify application code. Values greater than 1 make the scene appear larger. Values less than 1 make the scene appear smaller. For example a of 2 will make the scene approximately 2 times larger in the rendering window. The specific effect on the camera is a 'dolly' or a 'zoom' depending on the type of camera.
This is often useful after calling viewAll(). That method sets the camera parameters based on a bounding sphere around the scene which often leaves the scene not "filling" the viewport.
Details:
Note that the value expected by SoCameraInteractor.dolly is the inverse, which is less intuitive.
value
- The dolly value (ignored if zero).cameraInteractor
- The interactor used to modify the camera (ignored if null).public static SoNode getExampleLogoNode() throws java.io.FileNotFoundException
java.io.FileNotFoundException
- If the example logo resource is not foundpublic static boolean dicomAdjustDataRange(SoDataRange rangeNode, SoVolumeData volume)
public static boolean dicomGetWindowCenterWidth(SoVolumeData volume, SbVec2f winCW)
Uses the Window Center (0028,1050) and Window Width (0028,1051) tags from the first image in the stack. If these tags do not exist in the volume, then window center and width are computed from the actual data min and max values. (Note that querying the actual min and max values may take some time because every voxel must be loaded.) This method may be called with a non-DICOM volume. In that case the actual min and max data values are used.
public static SoSeparator buildSliceOrientationMarkers(SoOrthoSlice orthoSlice)
public static SoSeparator buildSliceScaleBars(SoCamera camera)
This is just a convenience method and helps keep the demo/example programs consistent. Applications can use SliceScaleBar directly.
Note that a typical length, 10 cm, is assumed.
public static SoSeparator buildSliceAnnotation(SoCamera camera, SoOrthoSlice sliceNode, java.lang.String filename)
public static boolean dicomAdjustVolume(SoVolumeData volume, boolean useImagePosition)
The volume properties are modified (but not the data values). Do not call this method before setting the volume data node's fileName field or calling setReader.
public static boolean dicomAdjustVolume(SoVolumeData volume, SoMatrixTransform imgToPatient)
... SoMatrixTransform matrixTransform = new SoMatrixTransfrom(); dicomAdjustVolume(volumeData, matrixTransfrom) root.addChild(matrixTransform); root.addChild(volumeData); ...The computed matrix embeds the image position and image orientation as described here: https://dicom.innolitics.com/ciods/ct-image/image-plane/00200037 Scaling part is embedded in VolumeData extent.
If SoVolumeData is not a DICOM volume, imgToPatient will be set to identity.
public static SbVec3f dicomGetImagePosition(SoVolumeData volume)
DICOM calls this the upper left hand corner of the image, but more precisely it's the center of the first voxel, in millimeters (mm). For VolumeViz the upper left hand corner of the image is literally the corner of the voxel, one-half voxel different from Image Position.
Note the SoVRDicomData getPosition() method does not return the value of the Image Position attribute. It returns a value computed from Image Position. If there are multiple slices, value is taken from the first slice.
public static SoSeparator createBoundingBox(SbBox3f bbox, SbColor color)
public static SbBox3f getBoundingBox(SoNode node)
public static SoSeparator createCube(SbBox3f bbox)
public static boolean orientView(MedicalHelper.Axis axis, SoCamera camera, SoVolumeData volume)
orientView(axis, camera, volume, 1.01f)
public static boolean orientView(MedicalHelper.Axis axis, SoCamera camera, SoVolumeData volume, float slack)
The camera is rotated to give the conventional orientation for the specified axis. If the volume data is specified, then viewAll() is called to center the volume in the view volume.
If the camera is an SoOrthographicCamera (the usual case for viewing a slice) and the volume data node is specified, then the camera (specifically the view volume height) is adjusted to make the slice image fill the viewport. This is convenient because the viewAll() method gives a very loose fit around the slice image.
If the camera is an SoPerspectiveCamera (commonly used for viewing a 3D volume) or the volume data node is specified, then viewAll() is called, but no additional adjustment is done to the camera. 'slack' is ignored in this case.
Axial -> "Feet" view. Coronal -> "Anterior" view. Sagittal -> "Left" view.
axis
- Axial, Coronal or Sagittalcamera
- The camera node that will be modified (fails if null).volume
- The data volume that is being viewed (used to compute view volume,
not modified)slack
- Values greater than 1 will leave additional space between image and window edge.public static <NodeClass extends SoNode> NodeClass find(SoNode root, java.lang.Class<NodeClass> nodeClass, java.lang.String nodeName)
root
- root of scene graph you want to searchnodeClass
- class of the node you want to findnodeName
- Name of the node you want to findpublic static <NodeClass extends SoNode> NodeClass find(SoNode root, java.lang.Class<NodeClass> nodeClass)
root
- root of scene graph you want to searchnodeClass
- class of the node you want to findpublic static SoSeparator readFile(java.lang.String filename)
filename
- of file containing a scene graph.Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com