Class SoImageDataAdapter
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.misc.SoBase
-
- com.openinventor.inventor.fields.SoFieldContainer
-
- com.openinventor.imageviz.nodes.images.SoImageDataAdapter
-
- All Implemented Interfaces:
SafeDisposable
- Direct Known Subclasses:
SoFileDataAdapter
,SoMemoryDataAdapter
,SoProxyDataAdapter
,SoVolumeReaderAdapter
public class SoImageDataAdapter extends SoFieldContainer
Abstract base class for all ImageViz image data adapter classes. See for example:SoFileDataAdapter
to use data in a file.SoMemoryDataAdapter
to use data already in memory.SoProxyDataAdapter
to use a subset of data already in anSoImageDataAdapter
.SoVolumeReaderAdapter
to use data from anSoVolumeReader
.
NOTE:
SoImageDataAdapter
provides access to the image data but does not guarantee that all the data is loaded in memory. OnlySoMemoryDataAdapter
is guaranteed to do that. As a result, only anSoMemoryDataAdapter
(or anSoProxyDataAdapter
that is attached to anSoMemoryDataAdapter
) is completely safe to use as input for ImageViz filter engines. Many engines will work with data partially in memory, but some, for exampleSoImageRegistrationTransform
, will only work if the image is completely in memory. See the documentation for the specific engines you are using. Conveniently, the utility method SoImageDataAdapterHelper.getAppropriateAdapter() returns anSoMemoryDataAdapter
object if there is enough memory to load all the data.ImageViz Overview
SoFieldContainer
,SbImageDataAdapterHelper
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SoImageDataAdapter.Interpretations
Image Interpretation.-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
Fields Modifier and Type Field Description SoSFBox3f
extent
Theextent
andorientation
fields define the position, size and orientation of the image in 3D (typicallly the physical space).SoSFEnum<SoImageDataAdapter.Interpretations>
interpretation
Image Interpretation Default isVALUE
.SoSFRotation
orientation
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SbVec3f
getColumnDirection()
Returns the vector in physical coordinate that points from the origin (0,0,0) to the point (0,1,0).SbImageDataAccessor
getDataAccessor()
Returns anSbImageDataAccessor
.SbBox3f
getExtent()
Returns the extent of the image in 3D.SbImageDataType
getImageDataType()
Returns the data type of the image.SbMatrix
getIndexToPhysicalTransformation()
Returns the transformation that maps a position in the image coordinate system to a position in the physical coordinate system.SoImageDataAdapter.Interpretations
getInterpretation()
Returns the current interpretation of the image.SbVec3f
getOrigin()
Returns the image origin in 3D.SbVec3f
getPlaneDirection()
Returns the vector in physical coordinate that points from the origin (0,0,0) to the point (0,0,1).SbVec3f
getRowDirection()
Returns the vector in physical coordinate that points from the origin (0,0,0) to the point (1,0,0).SbVec4i32
getSize()
Returns a vector representing the dimensions of the image data.SbVec3f
getVoxelSize()
Returns the size of a voxel in 3D.void
setDirection(SbVec3f rowDirection, SbVec3f columnsDirection)
Set the direction cosines of rows and columns.void
setInterpretation(SoImageDataAdapter.Interpretations interpretation)
Sets the interpretation of the image.void
setOrigin(SbVec3f origin)
Sets the image origin in 3D.void
setVoxelSize(SbVec3f voxelSize)
Sets the voxel size in 3D.-
Methods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
-
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable, touch
-
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
-
-
-
Field Detail
-
interpretation
public final SoSFEnum<SoImageDataAdapter.Interpretations> interpretation
Image Interpretation Default isVALUE
. This field defines the way the data values in the image should be interpreted. Some engines require their input image to have a specific interpretation type and give an error if the interpretation type is incorrect. Engines automatically set the appropriate interpretation type in their output image(s). The application is responsible for setting the appropriate interpretation type in images created by the application, for example if a mask image is loaded from disk. .
-
extent
public final SoSFBox3f extent
Theextent
andorientation
fields define the position, size and orientation of the image in 3D (typicallly the physical space). The extent field defines an axis aligned box in 3D. It has a 'min' corner, which is the image origin, and a 'max' corner. The orientation field defines a rotation around the image origin.If the image is loaded from a file format that specifies a physical extent and/or orientation (for example DICOM), then these fields are initialized with the information specifies in the image file. If no extent is specified, then the extent field is set to (0, 0, 0, sizeX, sizeY, sizeZ). If no rotation is specified, then the orientation field is set to identity. The application can set either or both of these fields as needed.
The voxel size is the extent divided by the image dimensions (see
getSize()
).
-
orientation
public final SoSFRotation orientation
- See Also:
SoImageDataAdapter.extent
-
-
Method Detail
-
getOrigin
public SbVec3f getOrigin()
Returns the image origin in 3D. The image origin is the "min" corner of the imageextent
.
-
getInterpretation
public SoImageDataAdapter.Interpretations getInterpretation()
Returns the current interpretation of the image. Convenience method to get the value of theinterpretation
field. .
-
getVoxelSize
public SbVec3f getVoxelSize()
-
getRowDirection
public SbVec3f getRowDirection()
Returns the vector in physical coordinate that points from the origin (0,0,0) to the point (1,0,0). The vector is normalized.
-
getExtent
public SbBox3f getExtent()
Returns the extent of the image in 3D. Convenience method to get the value of theextent
field.
-
setOrigin
public void setOrigin(SbVec3f origin)
Sets the image origin in 3D. Modifies the "min" corner of the imageextent
. The width and height of the extent are unchanged and therefore the voxel size is unchanged.
-
setVoxelSize
public void setVoxelSize(SbVec3f voxelSize)
-
setDirection
public void setDirection(SbVec3f rowDirection, SbVec3f columnsDirection)
Set the direction cosines of rows and columns. The row direction is a vector that points from the origin to the point (1,0,0). The column direction is a vector that points from the origin to the point (0,1,0).In the DICOM standard, this information corresponds to the tag "Image Orientation (Patient) (0020,0037)"
-
getColumnDirection
public SbVec3f getColumnDirection()
Returns the vector in physical coordinate that points from the origin (0,0,0) to the point (0,1,0). The vector is normalized.
-
getIndexToPhysicalTransformation
public SbMatrix getIndexToPhysicalTransformation()
Returns the transformation that maps a position in the image coordinate system to a position in the physical coordinate system.
-
setInterpretation
public void setInterpretation(SoImageDataAdapter.Interpretations interpretation)
Sets the interpretation of the image. Convenience method to set the value of theinterpretation
field. .
-
getDataAccessor
public SbImageDataAccessor getDataAccessor()
Returns anSbImageDataAccessor
. TheSbImageDataAccessor
can be used to access data contained inside thisSoImageDataAdapter
.
-
getSize
public SbVec4i32 getSize()
Returns a vector representing the dimensions of the image data. Indices 0, 1 and 2 refer to width, height and depth of image. Index 3 refers to timestep. For a 2D image index 2 is 1.
-
getPlaneDirection
public SbVec3f getPlaneDirection()
Returns the vector in physical coordinate that points from the origin (0,0,0) to the point (0,0,1). The vector is normalized.
-
getImageDataType
public SbImageDataType getImageDataType()
Returns the data type of the image.
-
-