LDM file reader. More...
#include <LDM/readers/SoVRLdmFileReader.h>
Public Member Functions | |
virtual SoType | getTypeId () const |
Returns the type identifier for this specific instance. | |
SoVRLdmFileReader () | |
Default constructor. | |
virtual ReadError | getDataChar (SbBox3f &size, SoDataSet::DataType &type, SbVec3i32 &dim) override |
Gets the characteristics (file header) of the data volume. | |
virtual SbBool | getMinMax (int64_t &min, int64_t &max) |
Returns the minimum and maximum data values. | |
virtual SbBool | getMinMax (double &min, double &max) |
Returns the minimum and maximum data values (for float values). | |
virtual SbBool | getHistogram (std::vector< int64_t > &numVox) |
Returns the distribution of data values, i.e., the number of voxels per data value. | |
virtual int | getNumSignificantBits () |
Returns the number of significant bits. | |
virtual SbBool | isThreadSafe () const |
Return true as this reader is thread safe. | |
Deprecated | |
SoDEPRECATED void | getSubSlice (const SbBox2i32 &subSlice, int sliceNumber, void *data) |
virtual SoDEPRECATED SbBool | getMinMax (int &min, int &max) |
Returns the minimum and maximum data values. | |
Public Member Functions inherited from SoLDMReader | |
SoLDMReader () | |
Constructor. | |
virtual SbBox3f | getSize () |
Returns the bounding box of the total data in world coordinates. | |
virtual SbVec3i32 | getDimension () |
Returns the dimension of the data. | |
virtual SbBool | getTileSize (SbVec3i32 &tile) |
Returns the size of a data tile. | |
virtual SbBool | getBbox (int fileId, SbBox3f &box) |
Returns the bounding box of the data associated with the specified file ID. | |
virtual SbBool | getCenter (int fileId, SbVec3f ¢er) |
Returns the center of the data associated with the specified file ID. | |
virtual SoBufferObject * | readTile (int index, const SbBox3i32 &tilePosition) |
Given an index, reads a tile if the data is organized in tiles (for LDM). | |
virtual SbBool | readXTraceInTile (int index, unsigned char *&buffer, const SbBox3i32 &tilePosition, const SbVec2i32 &tracePosition) |
Read directly from the LDM data source, a trace inside a tile. | |
virtual SbBool | readXSliceInTile (int index, unsigned char *&buffer, const SbBox3i32 &tilePosition, const uint32_t &slicePosition) |
Read directly from the LDM data source, an orthoslice on the X axis inside a tile. | |
virtual SbBool | readYSliceInTile (int index, unsigned char *&buffer, const SbBox3i32 &tilePosition, const uint32_t &slicePosition) |
Read directly from the LDM data source, an orthoslice on the Y axis inside a tile. | |
virtual SbBool | readZSliceInTile (int index, unsigned char *&buffer, const SbBox3i32 &tilePosition, const uint32_t &slicePosition) |
Read directly from the LDM data source, an orthoslice on the Z axis inside a tile. | |
virtual bool | isLittleEndian () |
Returns whether the bytes of the data are stored in big or little endian order. | |
virtual SbString | getOriginalFilename () const |
Returns original file name from which the data has been converted to LDM format if stored in file. | |
virtual SbXmlTag | getXmlTag (const char *tagName) |
Gets the first occurrence of the XML element whose tag name is specified by tagName. | |
virtual SoVolumeReader::ReaderType | getReaderType () |
Returns the reader type. | |
virtual SoVolumeWriter * | getConfiguredWriter () |
Returns a volume writer that corresponds to this reader (same format, parameters, etc). | |
virtual SbVec2d | getTileMinMax (int index) const |
Returns the minimum and maximum data values for the given tile. | |
virtual void | getSubSlice (const SbBox2i32 &subSlice, int sliceNumber, SoBufferObject *dataBuffer) |
Same as getSubSlice( const SbBox2i32& subSlice, int sliceNumber, void * data ) but using an SoBufferObject as the target of the data. | |
virtual SoBufferObject * | readTile (int index, const SbBox3i32 &tilePosition) |
Given an index, reads a tile if the data is organized in tiles (for LDM). | |
virtual SoDEPRECATED SbBool | readTile (int index, unsigned char *&buffer, const SbBox3i32 &tilePosition) |
Given an index, reads a tile if the data is organized in tiles (for LDM). | |
virtual SoDEPRECATED SbBool | readTile (int index, SoBufferObject *buffer, const SbBox3i32 &tilePosition) |
Same as readTile(int index, unsigned char*& buffer, const SbBox3i32& tilePosition) but using an SoBufferObject (allocated by LDM) as the target of the data. | |
virtual SoDEPRECATED int | getBorderFlag () |
Returns the border flag. | |
virtual SoDEPRECATED SbBool | readTile (int index, unsigned char *&buffer, const SbBox3i32 &tilePosition) |
Given an index, reads a tile if the data is organized in tiles (for LDM). | |
Public Member Functions inherited from SoVolumeReader | |
SoVolumeReader () | |
Constructor. | |
virtual SbBool | setInputDataRange (SbBool doChange, double min, double max) |
Requests that the input be converted from the specified range to the range depending on the output data type. | |
SbVec3i32 | getNumVoxels (const SbVec3i32 &realSize, const SbVec3i32 &subsamplingLevel) |
Utility function provided by SoVolumeReader for subclass readers to call. | |
SbVec3i32 | getSizeToAllocate (const SbVec3i32 &realSize, const SbVec3i32 &subsamplingLevel) |
Utility function provided by SoVolumeReader for subclass readers to call. | |
virtual int | setFilename (const SbString &filename) |
Specifies the path of the file. | |
SbString | getFilename () const |
Returns the path of the file. | |
virtual SbBool | isIgnoredFile () const |
Should return TRUE if at least one file has been ignored during reading. | |
virtual SbBool | setDirectCoordSysAutoDetection (SbBool autoValue) |
Sets whether or not the reader should automatically try to detect if the coordinate system used is direct or not. | |
virtual SbBool | getDirectCoordSysAutoDetection () |
Return automatic detection value. | |
virtual SbBool | setDirectCoorSys (SbBool directCoord) |
Specify if the coordinate system used is direct or not. | |
virtual SbBool | getDirectCoordSys () |
Return whether the coordinate system used is direct or not. | |
CoordinateType | getCoordinateType () |
Returns coordinate type used by the data set. | |
const float * | getRectilinearCoordinates (Axis axis) const |
Returns the coordinates for the specified axis. | |
void | setRectilinearCoordinates (const float *x, const float *y, const float *z) |
Sets rectilinear coordinates for the data set. | |
virtual SbBool | isRGBA () const |
Returns TRUE if the data set contains RGBA color values. | |
void | setRGBA (const SbBool flag) |
Specifies if data must be considered as RGBA. | |
Public Member Functions inherited from SoFieldContainer | |
void | setToDefaults () |
Sets all fields in this object to their default values. | |
SbBool | hasDefaultValues () const |
Returns TRUE if all of the object's fields have their default values. | |
SbBool | fieldsAreEqual (const SoFieldContainer *fc) const |
Returns TRUE if this object's fields are exactly equal to fc's fields. | |
void | copyFieldValues (const SoFieldContainer *fc, SbBool copyConnections=FALSE) |
Copies the contents of fc's fields into this object's fields. | |
SoNONUNICODE SbBool | set (const char *fieldDataString) |
Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format. | |
SbBool | set (const SbString &fieldDataString) |
Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format. | |
void | get (SbString &fieldDataString) |
Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string. | |
virtual int | getFields (SoFieldList &list) const |
Appends references to all of this object's fields to resultList, and returns the number of fields appended. | |
virtual int | getAllFields (SoFieldList &list) const |
Returns a list of fields, including the eventIn's and eventOut's. | |
virtual SoField * | getField (const SbName &fieldName) const |
Returns a the field of this object whose name is fieldName. | |
virtual SoField * | getEventIn (const SbName &fieldName) const |
Returns a the eventIn with the given name. | |
virtual SoField * | getEventOut (const SbName &fieldName) const |
Returns the eventOut with the given name. | |
SbBool | getFieldName (const SoField *field, SbName &fieldName) const |
Returns the name of the given field in the fieldName argument. | |
SbBool | enableNotify (SbBool flag) |
Notification at this Field Container is enabled (if flag == TRUE) or disabled (if flag == FALSE). | |
SbBool | isNotifyEnabled () const |
Notification is the process of telling interested objects that this object has changed. | |
virtual void | setUserData (void *data) |
Sets application data. | |
void * | getUserData (void) const |
Gets user application data. | |
Public Member Functions inherited from SoBase | |
virtual void | touch () |
Marks an instance as modified, simulating a change to it. | |
virtual SbName | getName () const |
Returns the name of an instance. | |
virtual void | setName (const SbName &name) |
Sets the name of an instance. | |
void | setSynchronizable (const bool b) |
Sets this to be a ScaleViz synchronizable object. | |
bool | isSynchronizable () const |
Gets the ScaleViz synchronizable state of this object. | |
Public Member Functions inherited from SoRefCounter | |
void | ref () const |
Adds a reference to an instance. | |
void | unref () const |
Removes a reference from an instance. | |
void | unrefNoDelete () const |
unrefNoDelete() should be called when it is desired to decrement the reference count, but not delete the instance if this brings the reference count to zero. | |
int | getRefCount () const |
Returns current reference count. | |
void | lock () const |
lock this instance. | |
void | unlock () const |
unlock this instance. | |
Public Member Functions inherited from SoTypedObject | |
SbBool | isOfType (const SoType &type) const |
Returns TRUE if this object is of the type specified in type or is derived from that type. | |
template<typename TypedObjectClass > | |
SbBool | isOfType () const |
Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class. | |
Static Public Member Functions | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
Static Public Member Functions inherited from SoLDMReader | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
Static Public Member Functions inherited from SoVolumeReader | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
static SoVolumeReader * | getAppropriateReader (const SbString &filename) |
Returns a preconfigured SoVolumeReader instance that can be used to load the given file (based on the filename extension). | |
Static Public Member Functions inherited from SoFieldContainer | |
static SoType | getClassTypeId () |
Returns the type of this class. | |
Static Public Member Functions inherited from SoBase | |
static SoType | getClassTypeId () |
Returns type identifier for this class. | |
Static Public Member Functions inherited from SoTypedObject | |
static SoType | getClassTypeId () |
Returns the type identifier for this class. | |
Additional Inherited Members | |
Public Types inherited from SoLDMReader | |
enum | SoLDMError { LDM_NO_ERROR , LDM_FILE_NOT_FOUND , LDM_XML_ROOT_START_TAG_NOT_FOUND , LDM_XML_ROOT_END_TAG_NOT_FOUND , LDM_ALTERNATE_FILE_NOT_FOUND , LDM_XML_PARSING_ERROR , LDM_SIZE_TAG_MISSING , LDM_COMPLETION_FILE_NOT_FOUND , LDM_RD_NO_ERROR , LDM_RD_FILE_NOT_FOUND_ERROR , LDM_RD_UNSUPPORTED_DATA_TYPE_ERROR , LDM_RD_UNKNOWN_ERROR } |
LDM Reader error code. More... | |
Public Types inherited from SoVolumeReader | |
enum | ReadError { RD_NO_ERROR , RD_FILE_NOT_FOUND_ERROR , RD_INVALID_DATA_ERROR , RD_UNSUPPORTED_DATA_TYPE_ERROR , RD_FILE_FORMAT_NOT_VALID_ERROR , RD_UNKNOWN_ERROR } |
Read error. More... | |
enum | Axis { X , Y , Z } |
Which axis to handle. More... | |
enum | ReaderType { NO_READER , AM , AVS , DICOM , GENERIC , LDM , MEMORY , RASTERSTACK , SEGY , VOL , VOX , TIFF , MRC } |
Available reader type. More... | |
enum | CoordinateType { COORDINATES_UNIFORM = 0 , COORDINATES_RECTILINEAR } |
Coordinate type used by this data set. More... | |
Protected Member Functions inherited from SoVolumeReader | |
virtual | ~SoVolumeReader () |
Destructor. | |
void * | getBuffer (int64_t offset, unsigned int size) |
Returns a pointer to a buffer of size bytes corresponding to a part of the file at offset bytes from the beginning of the file. | |
int64_t | fileSize () |
Returns the size of the file when file I/O is handled by this class. | |
Static Protected Member Functions inherited from SoVolumeReader | |
static bool | registerVolumeReaderExtension (const SbString &fileExtension, const SoType &readerType) |
Register an SoVolumeReader class to handle a file extension. | |
static bool | unregisterVolumeReaderExtensions (const SoType &readerType) |
Unregister all filename extensions associated with the specified SoVolumeReader class. | |
static int | bytesToInt (const unsigned char *ptr, int sizeBytes) |
Utility method that returns an integer from sizeBytes bytes starting at address ptr. | |
static void | swapBytes (int *intPtr, int sizeBytes) |
Utility method to convert an integer into the correct architecture (little/big endian). | |
static void | swapBytesN (void *buffer, int numElements, int numBytesPerElement) |
Utility method to swap bytes of each element of an array of numElements elements. | |
static SbBool | isValidFloat (const float val) |
Utility method to check if value is a valid IEEE 754 floating point number. | |
static SbBox3f | adjustFlatExtent (const SbString &fileName, const SbBox3f &extent, const SbVec3i32 &dim) |
VolumeViz doesn't handles empty extent (for ex. | |
Protected Attributes inherited from SoVolumeReader | |
SoDEPRECATED SbBool | m_dataConverted |
LDM is a format for storing hierarchical multi-resolution volume data, defined by VSG. VolumeViz includes a utility program that can convert other formats (supported by VolumeViz) into this format. Preprocessing volume data into this format provides the maximum benefits from the VolumeViz large data management (LDM) features.
The default VolumeViz LDM file format is based on an octree topology. The data is stored in tiles of different subsampling resolution.
The first tile in the file represents the entire volume at its lowest resolution and corresponds to the root of the octree. The next 8 tiles represent octants of the entire volume at a lower subsample step. There is another set of 8 tiles for each of these tiles, and so on, until reaching tiles of full resolution.
The tile index starts at 0 for the root and increments linearly into the octree (1 to 8 for octree children, 9 to 16 for children of tile 1, and so on).
The data of a tile is accessed with the readTile function by passing an index and allocated buffer.
Definition at line 69 of file SoVRLdmFileReader.h.
SoVRLdmFileReader::SoVRLdmFileReader | ( | ) |
Default constructor.
|
static |
Returns the type identifier for this class.
|
overridevirtual |
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.
Reimplemented from SoLDMReader.
Reimplemented in SoVRLdmFileBorderReader.
|
virtual |
Returns the distribution of data values, i.e., the number of voxels per data value.
numVox(0) is the number of voxels with value 0, numVox(1) is the number of voxels with value 1, and so on.
Reimplemented from SoLDMReader.
|
virtual |
Returns the minimum and maximum data values (for float values).
Reimplemented from SoLDMReader.
|
virtual |
Returns the minimum and maximum data values.
Reimplemented from SoLDMReader.
|
virtual |
Returns the minimum and maximum data values.
Reimplemented from SoLDMReader.
|
inlinevirtual |
Returns the number of significant bits.
Reimplemented from SoVolumeReader.
Definition at line 107 of file SoVRLdmFileReader.h.
|
virtual |
Reimplemented from SoLDMReader.
|
virtual |
Returns the type identifier for this specific instance.
Reimplemented from SoLDMReader.
Reimplemented in SoVRLdmFileBorderReader.
|
virtual |
Return true as this reader is thread safe.
Reimplemented from SoLDMReader.
Reimplemented in SoVRLdmFileBorderReader.