Reads volume from an SoImageDataAdapter. More...
#include <ImageViz/Nodes/Images/SoVRImageDataReader.h>
Public Member Functions | |
virtual SoType | getTypeId () const |
SoVRImageDataReader () | |
SoVRImageDataReader (SoImageDataAdapter *_image) | |
virtual 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 SoVolumeWriter * | getConfiguredWriter () |
Static Public Member Functions | |
static SoType | getClassTypeId () |
Public Attributes | |
SoSFImageDataAdapter | imageData |
SoImageDataAdapter, SoVolumeReader
InteractiveThresholding, MarkerPicking, OverlayDisplay, DenoisingImage3D, CreatingImage2D, CreatingImage3D, MedicalSegmentation
SoVRImageDataReader::SoVRImageDataReader | ( | ) |
Default constructor.
SoVRImageDataReader::SoVRImageDataReader | ( | SoImageDataAdapter * | _image | ) |
Helper constructor equivalent to:.
reader = new SoVRImageDataReader(); reader->imageData = _image
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:
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 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
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] |
Method required by VolumeViz 3.0. 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.
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.
Input image data.