Class SoVRDicomData
java.lang.Object
com.openinventor.inventor.Inventor
com.openinventor.volumeviz.readers.SoVRDicomData
DICOM data.
Access data in a DICOM data set.
DICOM is a widely used format for storing medical image data (CT, MRI, etc), defined by the National Electrical Manufacturers Association (NEMA) (http://medical.nema.org).
This class can be used to directly open and query information from DICOM format files. It can also be used to get DICOM specific information from a file opened by VolumeViz (see SoVRDicomFileReader).
Note that it only returns information for a single file, not (in general) for the complete volume.
To conveniently iterate over or randomly access all the DICOM attributes, see the getDicomDataSet() method.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand -
Field Summary
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanclose()Closes the underlying reader.intReturns the number of bits stored.intReturns the number of bytes per pixel.Returns a DICOM data object that allows accessing all the DICOM attributes.getDicomInfo(short group, short element) Generic method to get DICOM info.intReturns the high bit.intReturns the image height.intReturns the image number.Returns the position of the first frame's top left voxel center in the patient space.intReturns the image width.floatReturns the intercept.intReturns the number of frames.Returns the orientation of the DICOM volume.Returns the 3D position of the center of the image.intReturns the number of samples per pixel.intReturns the series number.intReturns the image size in bytes.floatReturns the image location in mm.floatReturns the slice spacing.floatReturns the slice thickness in mm.floatgetSlope()Returns the slope.floatReturns the X pixel size in mm.floatReturns the Y pixel size in mm.booleanreadDicomHeader(String fileName) Reads the DICOM file header.booleanreadDicomImage(String fileName) Reads the DICOM image.intReturns the signed flag.booleanReturns true if the transfer syntax is supported by Open Inventor.Methods inherited from class com.openinventor.inventor.Inventor
dispose, getNativeResourceHandle
-
Constructor Details
-
SoVRDicomData
public SoVRDicomData()Constructor.
-
-
Method Details
-
readDicomHeader
Reads the DICOM file header. Returns true upon success. -
getHighBit
public int getHighBit()Returns the high bit. -
getBitsStored
public int getBitsStored()Returns the number of bits stored. -
readDicomImage
Reads the DICOM image. Returns true upon success. -
getOrientation
Returns the orientation of the DICOM volume. This orientation can be used with a transform node, for exampleSoRotationIt is computed from the DICOM Image Orientation Patient. If this element is not available, orientation will be set to the identity matrix.- Returns:
- True if file contains orientation information.
-
getSlope
public float getSlope()Returns the slope. -
getDicomInfo
Generic method to get DICOM info. The group and element parameters should be given using the hexadecimal tag values defined by the DICOM specification. For example Rescale Slope is (0028,1053) and Rescale Intercept is (0028,1052).To conveniently access the DICOM attributes, see the
getDicomDataSet()method.- Parameters:
group- hexadecimal group tag value to retrieve info from.element- hexadecimal element tag value to retrieve info from in the group.- Returns:
- value info.
-
getDicomDataSet
Returns a DICOM data object that allows accessing all the DICOM attributes.- Returns:
- a pointer to the created data set, that must be deleted by the application. If an error occurs, returns NULL.
-
signedData
public int signedData()Returns the signed flag. -
getIntercept
public float getIntercept()Returns the intercept. -
getBytesPerPixel
public int getBytesPerPixel()Returns the number of bytes per pixel. -
getSeriesNumber
public int getSeriesNumber()Returns the series number. -
getSizeInBytes
public int getSizeInBytes()Returns the image size in bytes. -
getImageNumber
public int getImageNumber()Returns the image number. -
getSamplesPerPixel
public int getSamplesPerPixel()Returns the number of samples per pixel. -
getSliceThicknessMM
public float getSliceThicknessMM()Returns the slice thickness in mm. If the thickness information is not present in the file, will return NaN. -
getSliceSpacing
public float getSliceSpacing()Returns the slice spacing. -
supportedTransferSyntax
public boolean supportedTransferSyntax()Returns true if the transfer syntax is supported by Open Inventor. -
getPosition
Returns the 3D position of the center of the image. This position represents the "origin" of the image in a 3D graphics sense and be used with a transform node, for example,SoTranslation. It is computed from the DICOM Image Position Patient attribute, but is not the same as the Image Position Patient (which is the position of the center of the first voxel). If this element is not available, position will be set to (0, 0, 0).- Returns:
- True if file contains position
-
getNumFrames
public int getNumFrames()Returns the number of frames. Currently anSoVRDicomDataobject corresponds to a single DICOM file. ThereforegetNumFrames()returns the number of images in the associated DICOM file, not (in general) the number of images in the volume. Typically it returns 1 because there is a single image in the file. Note that even if theSoVRDicomDataobject was queried from anSoVRDicomFileReader, it does not return the number of images in the volume except in the special case where all images are stored in a single file. To get the number of images in the volume use the volume reader orSoVolumeDataobject. -
getImagePosition
Returns the position of the first frame's top left voxel center in the patient space. This correspond to Dicom tag ImagePositionPatient (0020, 0032) of image stack first slice. -
close
public boolean close()Closes the underlying reader. -
getYPixelSize
public float getYPixelSize()Returns the Y pixel size in mm. -
getImageHeight
public int getImageHeight()Returns the image height. -
getSliceLocation
public float getSliceLocation()Returns the image location in mm. This is the DICOM ImagePosition transformed by the DICOM ImageOrientation. -
getImageWidth
public int getImageWidth()Returns the image width. -
getXPixelSize
public float getXPixelSize()Returns the X pixel size in mm.
-