Class SoVRDicomData

java.lang.Object
com.openinventor.inventor.Inventor
com.openinventor.volumeviz.readers.SoVRDicomData

public class SoVRDicomData extends Inventor
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:
  • Constructor Details

    • SoVRDicomData

      public SoVRDicomData()
      Constructor.
  • Method Details

    • readDicomHeader

      public boolean readDicomHeader(String fileName)
      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

      public boolean readDicomImage(String fileName)
      Reads the DICOM image. Returns true upon success.
    • getOrientation

      public SbMatrix getOrientation()
      Returns the orientation of the DICOM volume. This orientation can be used with a transform node, for example SoRotation It 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

      public String getDicomInfo(short group, short element)
      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

      public SiDicomDataSet 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

      public SbVec3f 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 an SoVRDicomData object corresponds to a single DICOM file. Therefore getNumFrames() 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 the SoVRDicomData object was queried from an SoVRDicomFileReader, 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 or SoVolumeData object.
    • getImagePosition

      public SbVec3f 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.