No announcement yet.

get data from SoVolumeData

  • Filter
  • Time
  • Show
Clear All
new posts

  • get data from SoVolumeData

    I'm Loading volume from .LDM format

    SoVolumeData* PVolData = new SoVolumeData() ;
    PVolData->fileName =" Any LDM File" ;

    How can i get data pointer ;
    i tried with this code but the NULL returned pointer ;

    void* data ;
    data = PVolData->Data.getValue(size,type) ;

  • #2
    Re: get data from SoVolumeData

    Hi Mohamed,

    That's correct, you can only get out of the data field what you put into it. If you had a small volume in contiguous memory you could load it directly into the data field (and get it back). In your case the data is coming from an LDM format file on disk. In fact, if you think about it, getting a single pointer to the data in an LDM volume isn't a simple thing because a) the data exists in tiles which are separate chunks of memory and b) the whole volume may not fit in system memory anyway.

    This is why we provide the Data Access API. Take a look at SoLDMDataAccess in the help file. You get this interface from your SoVolumeData object by calling the getLdmDataAccess() method. Data Access allows you to make synchronous or asynchronous calls to retrieve the volume data in a region, on a plane, on a line, etc. There is a programming guide and example code included with the SDK in directory .../src/VolumeViz/Compute