SoVRImageDataReader Class Reference
[Images]

ImageViz Reads volume from an SoImageDataAdapter. More...

#include <ImageViz/Nodes/Images/SoVRImageDataReader.h>

Inheritance diagram for SoVRImageDataReader:
SoVolumeReader SoFieldContainer SoBase SoRefCounter SoTypedObject

List of all members.

Public Member Functions

virtual SoType getTypeId () const
 SoVRImageDataReader ()
 SoVRImageDataReader (SoImageDataAdapter *_image)
virtual SoVolumeReader::ReadError getDataChar (SbBox3f &size, SoDataSet::DataType &type, SbVec3i32 &dim)
virtual void getSubSlice (const SbBox2i32 &subSlice, int sliceNumber, void *data)
virtual void getSubSlice (const SbBox2i32 &subSlice, int sliceNumber, SoBufferObject *dataBuffer)
virtual int getNumSignificantBits ()
virtual SbBool isThreadSafe () const
virtual SoVolumeWritergetConfiguredWriter ()

Static Public Member Functions

static SoType getClassTypeId ()

Public Attributes

SoSFImageDataAdapter imageData

Detailed Description

ImageViz Reads volume from an SoImageDataAdapter.

SEE ALSO

SoImageDataAdapter, SoVolumeReader

See related examples:

InteractiveThresholding, MarkerPicking, OverlayDisplay, DenoisingImage3D, CreatingImage2D, CreatingImage3D, MedicalSegmentation


Constructor & Destructor Documentation

SoVRImageDataReader::SoVRImageDataReader (  ) 

Default constructor.

SoVRImageDataReader::SoVRImageDataReader ( SoImageDataAdapter _image  ) 

Helper constructor equivalent to:.

 reader = new SoVRImageDataReader();
 reader->imageData = _image

Member Function Documentation

static SoType SoVRImageDataReader::getClassTypeId (  )  [static]

Returns the type identifier for this class.

Reimplemented from SoVolumeReader.

virtual SoVolumeWriter* SoVRImageDataReader::getConfiguredWriter (  )  [virtual]

Returns a volume writer that corresponds to this reader
(same format, parameters, etc). If no writer can be created, NULL is returned.Notes:

  • The simplest way to implement this behavior is to return a new writer every time.
  • The returned writer is not synchronized with this reader nor with other writers.
  • The returned writer must be manually refed/unrefed.
For example:

   MyVolumeReader* reader = new MyVolumeReader();
   reader->setFilename( "someFile.dat" );
   MyVolumeWriter* writer1 = (MyVolumeWriter*)reader->getConfiguredWriter();
   // This writer will write to "someFile.dat"

   reader->setFilename( "someOtherFile.dat" );
   // The writer will still write to "someFile.dat"

   writer1->setFilename( "stillAnotherFile.dat" );
   SoVolumeWriter* writer2 = reader->getConfiguredWriter();
   // writer2 will write to "someOtherFile.dat", because the
   // reader is configured to read from "someOtherFile.dat"

Reimplemented from SoVolumeReader.

virtual SoVolumeReader::ReadError SoVRImageDataReader::getDataChar ( SbBox3f size,
SoDataSet::DataType type,
SbVec3i32 dim 
) [virtual]

Gets the characteristics (file header) of the data volume. See SoDataSet::setVolumeData().
You can use the convenience method setFilename() to specify the file location, in which case you will not have to open the file yourself. Then you can use the convenience method getBuffer() to read the header in order to get the requested information.NOTE: We strongly recommend that readers implement this version of getDataChar, introduced in VolumeViz 5.1, because it uses SbVec3i32 for the volume dimension.

Implements SoVolumeReader.

virtual int SoVRImageDataReader::getNumSignificantBits (  )  [virtual]

This method is optional. It returns the number of significant bits of the volume data.If it is not implemented, the default return value is 0, meaning the number of bits depends on the data type. See the last parameter of SoVolumeData::setVolumeData(). This method is called immediately after getDataChar(). For float data type, number of bits is forced to 32.

Reimplemented from SoVolumeReader.

virtual void SoVRImageDataReader::getSubSlice ( const SbBox2i32 subSlice,
int  sliceNumber,
SoBufferObject dataBuffer 
) [virtual]

Same as getSubSlice( const SbBox2i32& subSlice, int sliceNumber, void * data ) but using an SoBufferObject as the target of the data. If not reimplemented then the version with "unsigned char*" parameter is called

Parameters:
subSlice 2D region of the slice to return.
sliceNumber Slice number on the volume Z axis (first slice is 0).
dataBuffer The target buffer to be filled.

Reimplemented from SoVolumeReader.

virtual void SoVRImageDataReader::getSubSlice ( const SbBox2i32 subSlice,
int  sliceNumber,
void *  data 
) [virtual]

Must copy the rectangular part defined by subSlice of the XY slice sliceNumber to the memory referenced by data. Slices will not always be read sequentially.

Parameters:
subSlice 2D region of the slice to return.
sliceNumber Slice number on the volume Z axis (first slice is 0).
data Copy the data into this buffer.

You can use the convenience method getBuffer() to read data from file. Note: setFilename() must have been called previously.

Implements SoVolumeReader.

virtual SoType SoVRImageDataReader::getTypeId (  )  const [virtual]

Returns the type identifier for this specific instance.

Reimplemented from SoVolumeReader.

virtual SbBool SoVRImageDataReader::isThreadSafe (  )  const [virtual]

Should return TRUE if the reader is thread safe.
This function is called by VolumeViz when using the multiIO mode (LDM only). LDM multi-threaded data loading can only be used if this method returns TRUE.

Reimplemented from SoVolumeReader.


Member Data Documentation

Input image data.


The documentation for this class was generated from the following file:

Open Inventor Toolkit reference manual, generated on 4 Sep 2023
Copyright © Thermo Fisher Scientific All rights reserved.
https://www.openinventor.com/