SoLDMDataAccess Class Reference
[Misc]

Large Data Management Volume data access methods. More...

#include <LDM/SoLDMDataAccess.h>

List of all members.

Classes

struct  CopyInfo
struct  DataInfo
 Information about returned data when directly accessing the data rather than copying the data. More...
struct  DataInfoBox
 Information about data returned for an arbitrary box (subvolume). More...
struct  DataInfoLine
 Information about data returned for an arbitrary line. More...
struct  DataInfoPlane
 Information about data returned for an arbitrary plane. More...
class  DataInfoPolyLine
 Information about data returned for an arbitrary polyline. More...
struct  DataInfoTrace
 Information about data returned for an arbitrary trace (column of voxels). More...

Public Types

enum  ErrorValue {
  CORRECT,
  INCORRECT_RESOLUTION,
  INCORRECT_SUBVOLUME,
  INCORRECT_LINE,
  INCORRECT_POLYLINE,
  INCORRECT_PLANE,
  INCORRECT_POSITION,
  INCORRECT_COORDINATE,
  MEMORY_FULL,
  REQUEST_NOT_COMPLETED,
  REQUEST_NOT_FOUND,
  INCORRECT_BUFFER
}
enum  GetDataMode {
  CACHE,
  DIRECT,
  DIRECT_AND_PREFETCH
}

Public Member Functions

 SoLDMDataAccess ()
virtual ~SoLDMDataAccess ()
void setDataSet (SoDataSet *v)
SoDataSetgetDataSet ()
DataInfoBox getData (int resolution, const SbBox3i32 &subVolume0, SoBufferObject *bufferObj=NULL)
DataInfoPlane getData (int resolution, const SbBox3i32 &subVolume0, const SbPlane &plane, SoBufferObject *bufferObj=NULL)
DataInfoLine getData (int resolution, const SbBox3i32 &subVolume0, const SbLine &line, SoBufferObject *bufferObj=NULL)
DataInfoTrace getData (int resolution, const SbBox3i32 &subVolume, const SbVec2i32 coord, SoBufferObject *bufferObj=NULL)
void getData (DataInfoPolyLine &infoPolyline, int resolution, const SbBox3i32 &subVolume, int numPoints, const SbVec3i32 *polyline, SoBufferObject *bufferObj=NULL)
DataInfo getData (int resolution, const SbVec3i32 &dataPosition)
void releaseData (SoLDMTileID tileID)
SbBool isTileUniform (int resolution, const SbVec3i32 &dataPosition, double &uniformValue)
int requestData (int resolution, const SbBox3i32 &box, SoBufferObject *bufferObj)
void getRequestedData (int requestId, DataInfoBox &infoBox)
int requestData (int resolution, const SbBox3i32 &subVolume, const SbPlane &plane, SoBufferObject *bufferObj)
void getRequestedData (int requestId, DataInfoPlane &infoPlane)
int requestData (int resolution, const SbBox3i32 &subVolume0, const SbLine &line, SoBufferObject *bufferObj)
void getRequestedData (int requestId, DataInfoLine &infoLine)
int requestData (int resolution, const SbBox3i32 &subVolume, int numPoints, const SbVec3i32 *polyline, SoBufferObject *bufferObj)
void getRequestedData (int requestId, DataInfoPolyLine &infoPolyline)
int requestData (int resolution, const SbBox3i32 &subVolume0, const SbVec2i32 &coord, SoBufferObject *bufferObj)
void getRequestedData (int requestId, DataInfoTrace &infoTrace)
virtual void endRequest (int requestId)
SbVec3f voxelToXYZ (const SbVec3i32 &dataPosition)
SbBox3f voxelToXYZ (const SbBox3i32 &boxIJK)
SbVec3i32 XYZToVoxel (const SbVec3f &dataPosition)
SbBox3i32 XYZToVoxel (const SbBox3f &boxXYZ)
bool setGetDataMode (const GetDataMode getDataMode)
GetDataMode getGetDataMode ()

Deprecated



SoDEPRECATED DataInfoBox getData (int resolution, const SbBox3i32 &subVolume, void *buffer)
SoDEPRECATED DataInfoPlane getData (int resolution, const SbBox3i32 &subVolume, const SbPlane &plane, void *buffer)
SoDEPRECATED DataInfoLine getData (int resolution, const SbBox3i32 &subVolume, const SbLine &line, void *buffer)
SoDEPRECATED DataInfoTrace getData (int resolution, const SbBox3i32 &subVolume, const SbVec2i32 coord, void *buffer)
SoDEPRECATED void getData (DataInfoPolyLine &infoPolyline, int resolution, const SbBox3i32 &subVolume, int numPoints, const SbVec3i32 *polyline, void *buffer)
SoDEPRECATED int requestData (int resolution, const SbBox3i32 &subVolume, void *buffer)
SoDEPRECATED int requestData (int resolution, const SbBox3i32 &subVolume, const SbPlane &plane, void *buffer)
SoDEPRECATED int requestData (int resolution, const SbBox3i32 &subVolume, const SbLine &line, void *buffer)
SoDEPRECATED int requestData (int resolution, const SbBox3i32 &subVolume, int numPoints, const SbVec3i32 *polyline, void *buffer)
SoDEPRECATED int requestData (int resolution, const SbBox3i32 &subVolume, const SbVec2i32 &coord, void *buffer)

Detailed Description

Large Data Management Volume data access methods.

The Data Access API provides methods to conveniently extract data from a volume. This is useful, for example, to extract data for computation, for segmentation or for display using other primitives. The data is accessible whether the SoVolumeData is part of a scene graph or not. These methods are only valid in LDM mode (which is the default mode). The Data Access API automatically takes advantage of LDM multi-threaded data loading when multiple tiles (not already in cache) are needed to complete the request.

The Data Access API automatically loads all data required to satisfy the request and can be invoked asynchronously to allow simultaneous loading and computation. The application can request data at any resolution level, e.g. full resolution (level 0) data, independent of the resolution level currently being used for rendering. For some requests, e.g. line and plane, the application can also specify a subvolume (region of interest) that limits the extent of the data request.

SoLDMDataAccess provides the following data requests:

Each data request returns information struct specific to the request type. For example, SoLDMDataAccess::DataInfoBox is returned by the subvolume request. All these structs contain an errorFlag member containing the result of the request and a bufferSize member containing the amount of data (in bytes) returned. The application should always check these values. Note that even when errorFlag is CORRECT, bufferSize may be zero, meaning no data was returned. This happens, for example, if the specified plane is completely outside the volume.

The application is responsible for allocating and freeing the memory to store the requested data. Calling the data request method with a null bufferObject will return the size of the memory needed, in bytes, in the bufferSize member of the information struct. Once the buffer is allocated, a second call will extract the data from the volume. Since Open Inventor 8.0 we recommend using the methods that return data into an SoBufferObject. Because this class abstracts access to data stored on different devices it is possible, for example, to conveniently fetch data into CPU memory or directly into GPU memory.

Each data request can be either synchronous or asynchronous. Synchronous means that all the data will be loaded before the function returns. Asynchronous means that the function will return immediately and you will be notified when the data is actually available. This allows the application to continue to work while the data is being loaded, for example to overlap data loading and computation. Synchronous access is done using the getData methods.

To do asynchronous access, you must create a new class derived from SoLDMDataAccess and implement your own version of the endRequest method. Begin a request by calling the appropriate requestData method. This method will return a requestId.

Three different modes are available to control how data is requested from the volume reader when the necessary tiles are not already present in LDM cache memory:

Note that DIRECT access requires that specific methods are implemented in the data set reader, for example readXSliceInTile (see SoLDMReader and SoVolumeReader). The default LDM reader implements these methods for the standard Open Inventor LDM file format. Custom LDM readers may need to be enhanced.

EXAMPLE


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