Click or drag to resize
MedicalHelper Class

Utility class for medical applications.

Inheritance Hierarchy
SystemObject
  OIV.Medical.HelpersMedicalHelper

Namespace: OIV.Medical.Helpers
Assembly: OIV.Medical (in OIV.Medical.dll) Version: 2024.1.1.0.Release.cb64a23ffb514e400c7a72e2158dfc53ef4ceb26
Syntax
public class MedicalHelper

The MedicalHelper type exposes the following members.

Constructors
  NameDescription
Public methodMedicalHelper
Initializes a new instance of the MedicalHelper class
Top
Methods
  NameDescription
Public methodStatic memberBuildSliceAnnotation
Slice viewer annotations. This is just a convenience method and helps keep the demo/example programs consistent. Applications can use SliceScaleBar (etc) directly.
Public methodStatic memberBuildSliceOrientationMarkers
Build a scene graph to display slice orientation markers. This is just a convenience method and helps keep the demo/example programs consistent. Applications can use SliceOrientationMarkers directly.
Public methodStatic memberBuildSliceScaleBars
Build a scene graph to display dynamic scale bars for slice viewing. 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 methodStatic memberCreateBoundingBox
Convenience function to draw a specified bbox as a wireframe.
Public methodStatic memberCreateCube
Convenience function to retrieve Cube corresponding to specified bbox.
Public methodStatic memberDicomAdjustDataRange
Adjust data range based on values in the DICOM file, i.e. the window center (0028,1050) and window width (0028,1051) values. If there are multiple slices, values are taken from the first slice. Volume is needed to get DICOM attributes, but is not modified.
Public methodStatic memberDicomAdjustVolume(SoVolumeData, SoMatrixTransform)
Similar to DicomAdjustVolume( SoVolumeData, bool ) above but returns an SoMatrixTransform that can be used to properly locate VolumeData in patient space in case of non axis aligned acquisition:
...
SoMatrixTransform matrixTransform = new SoMatrixTransfrom();
DicomAdjustVolume(volumeData, matrixTransfrom)
root.AddChild(matrixTransform);
root.AddChild(volumeData);
...
The computed matrix embed 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, matrixTransform will be set to identity.
Public methodStatic memberDicomAdjustVolume(SoVolumeData, Boolean)
Optimize volume data node for DICOM volumes. 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. - First, adjusts the LDM tile size to optimize data loading. Note this adjustment is valid for any data format that is not already tiled, i.e. most formats except .lda and .ldm. - Second, adjusts the volume extent in 3D to be the actual physical extent of the data set measured from outside edge to outside edge of the voxels. This is a DICOM specific adjustment. - Third, if 'useImagePosition' is true, adjusts the volume extent so the center of the first voxel is positioned at the coordinates specified in the data set's "Image position" (0020,0032) attribute. By default the DICOM volume reader sets the volume extent so the center of the volume is positioned at 0,0,0 in 3D space. This is a DICOM specific adjustment.
Public methodStatic memberDicomFindFilesbySeries
Given the path to a DICOM file, returns a list containing all the files in the same directory that are part of the same DICOM series, based on the series UID (0x0020,0x000E). (0020,000E) Series instance UID (required) (0020,0011) Series number (required but may be "unknown") (0008,103E) Series description (optional)
Public methodStatic memberDicomGetImagePosition
Get the "Image Position (Patient)" attribute (0020,0032) from a DICOM 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.
Public methodStatic memberDicomGetWindowCenterWidth(SoDataRange)
Get the window center (level) and width values from an SoDataRange node
Public methodStatic memberDicomGetWindowCenterWidth(SoVolumeData, SbVec2f)
Get the window center (level) and width values from a DICOM volume. If the query fails, returns false and sets 'winCW' to 0,0. 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 methodStatic memberDicomSetWindowCenterWidth
Set an SoDataRange node from the window center (level) and width values
Public methodStatic memberDollyZoom
Make the scene appear larger or smaller. 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: - SoPerspectiveCamera: changes the camera 'position' field. For example, values greater than 1 move the camera closer to the focal point (divide the camera's distance from the focal point by the given value), which makes the scene appear larger. This is a 'dolly'. - SoOrthographicCamera: changes the camera 'height' field. For example, values greater than 1 decrease the view volume height (scale the height by the inverse of the given value), which makes the scene appear larger. This is a 'zoom' operation. Note that the value expected by SoCameraInteractor.Dolly is the inverse, which is less intuitive.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodStatic memberExampleDicomAnnotation
Returns a collection of DicomInfo annotation nodes for Open Inventor medical examples. This method is not important for customer applications, but the technique can be useful for adding annotation text to an application window.
Public methodStatic memberExampleLogoNode
Returns a logo image node for Open Inventor medical example. This method is not important for customer applications, but the technique can be useful for adding logo images to an application window.
Public methodStatic memberExampleWindowSize
Returns standard window size for Open Inventor medical examples. This method is not important for customer applications.
Public methodStatic memberFindNodeType
Convenience function to find first specified node in the scene graph Note: The function is Generic with defined constraint of NodeType : SoNode
Public methodStatic memberFindNodesNodeType
Convenience function to find all node of specified type in the scene graph
Public methodStatic memberGetBoundingBox
Convenience function to retrieve boundingBox of specified node. If node contains SoVolumeData, use SoVolumeData extent.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodStatic memberGetImageDataAdapter
Make a VolumeViz data set available in ImageViz. Creates and returns an SoMemoryDataAdapter with the same dimensions, extent and data as the SoVolumeData. Note that this operation makes a copy of the data set. So it must be possible to allocate a contiguous block of memory large enough to hold the whole volume. It is not currently possible for ImageViz and VolumeViz to share a data set. You can use SoVolumeReaderAdapter to get the same result but the performance is much slower because SoVolumeReaderAdapter loads data using the volume's associated volume reader class and re-reads the data from disk. This convenience method is much faster because it loads data using the LDMDataAccess interface which takes advantage of data that VolumeViz already has in memory. Performance depends on the 'tile size' set for the source volume. It will be slow (but still faster than SoVolumeReaderAdapter) if you use the default tile size (64) with a 512^3 volume. We recommend setting the volume's tile size equal to the volume size (or calling the #dicomAdjustVolume() method which does this automatically).
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberGetVolumeData
Make an ImageViz data set available in VolumeViz. Creates an SoVRImageDataReader to access the data and automatically sets the SoVolumeData's 'tile size' to an optimal value. Note that this operation makes a copy of the data set. It is not currently possible for ImageViz and VolumeViz to share a data set. You can use SoVRImageDataReader directly, but the resulting volume may be slow to access if you do not set the tile size and the volume dimensions are larger than the default tile dimension (64). Setting the tile size allows VolumeViz to access the data as a single tile when the dimensions are <= 512 or at least to access the data using a larger tile size (which means a smaller number of tiles).
Public methodStatic memberMedicalAxisFromViewAxis(Axis, SbMatrix)
Public methodStatic memberMedicalAxisFromViewAxis(Axis, SoVolumeData)
Public methodStatic memberOrientView
Adjusts the camera to view a slice or volume along the specified axis. 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. For a 3D volume rendering view, typically specify the Coronal axis.
Public methodStatic memberReadFile
Convenience function to read a .iv file and return pointer to the root of the created scenegraph.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodStatic memberViewAxisFromMedicalAxis(MedicalHelperAxis, SbMatrix)
Public methodStatic memberViewAxisFromMedicalAxis(MedicalHelperAxis, SoVolumeData)
Top
Fields
  NameDescription
Public fieldStatic memberLogoImageFile
Top
Remarks

Utility functions for medical visualization using Open Inventor.

Open Inventor includes a general purpose 3D graphics core library plus optimized extensions for specific data types and markets, including medical visualization. We recommend using these utility functions (and the Medical utility nodes) to get the best performance and productivity from the Open Inventor Medical Edition.

SUMMARY

  • DicomAdjustVolume():

    Call this method to adjust VolumeViz parameters for optimal performance with medical data and to position a DICOM volume correctly in 3D space when using axis aligned acquisitions.

  • DicomAdjustVolume():

    Call this method to adjust VolumeViz parameters for optimal performance with medical data and to position a DICOM volume correctly in 3D space when using oblique acquisitions.

  • DicomAdjustDataRange():

    Call this method to set the VolumeViz data range based on the Window Center and Window Width tags in a DICOM file. If those tags are not present, automatically sets the data range to the actual range of values in the data.

  • DicomSetWindowCenterWidth() and DicomGetWindowCenterWidth():

    In Open Inventor the range of voxel values that map onto the color map are specified as the 'min' and 'max' values of the range (see SoDataRange). These methods provide a convenient way to set and query the data range using the medical convention of 'window center' and 'window width'.

  • DicomFindFilesbySeries():

    Call this method to build a list of DICOM image files in a directory that belong to the same series as the specified file. This list can be passed to the DICOM volume reader using the SetFilenameList() method.

  • GetImageDataAdapter():

    Call this method to get an ImageViz data set (for image processing) from a VolumeViz data set. It's faster than using SoVolumeReaderAdapter.

  • GetVolumeData():

    Call this method to get a VolumeViz data set (for visualization) from an ImageViz data set. It's faster than using SoVRImageDataReader directly.

  • OrientView():

    This method is useful for orienting the camera to view a single image (a slice in VolumeViz jargon) along one of the standard axes (Axial, Coronal or Sagittal). But remember that the volume is always a 3D object to Open Inventor and you must also set the 'axis' field on the SoOrthoSlice node. See the dicomImageViewer example.

See Also