[OpendTect_Developers] Data access & Seed point generation

David d'Angelo david.d-angelo at iais.fraunhofer.de
Tue Nov 20 16:34:51 CET 2012


Hi Japp,

thanks a lot for your hints.
>
> A few answers to your questions:
>
> > I am working on plugin, which connects the visualization of 2D 
> seismic lines > in OpendTect with Android tablets.
>
> Considering the fact you are calling PlaneDataDisplay, I assume that with
> "2D lines" you do not (or not only) mean the lines in a 2D survey, but 
> the plane inlines, crosslines and timeslices in a 3D survey?
Yes, you are right, in the end I also want to be able to able to share 
the inline crossline and timeslices in a 3D survey.
>
> > 1) I need to get the image data out of the 2D Seismic lines. I used the
> > visBase PlaneDataDisplay class to access the underlying:
> > PlaneDataDisplay * pd = ...;
> > SbVec3i32 size;
> > int bytesPerPixel;
> > unsigned char* data =
> > pd->getChannels()->getChannels()->getValue(size,bytesPerPixel);
> > I get the data, however the dimensions are looking strange.
> > What format does the image have? 8bit grayscale?
>
> The image you get like this is 8bit greyscale, but this is probably
> not the image you want. It is the mapping of the attribute values
> of the planes first attribute onto a 0-255 range. What you probably
> want is the RGBA texture image as you would see it in your scene
> or in a 2D viewer. This is built by the hardware shader from one
> or more of these 8bit greyscale images and one or more color maps.
>
> See: visBase/vistexturechannel2rgba.h:
>
> virtual bool               createRGBA(SbImagei32&);
>
> so the code should probably be something like this:
>
> SbImagei32 img;
> pd->getChannels()->getChannels()->createRGBA( img );
> unsigned char* data = img.getValue(size,bytesPerPixel);
Sorry. I forgot to mention that I called the createRGBA(...) function. I 
use the follwing code to access the image data in my plugin:

     mCBCapsuleUnpack(const visSurvey::PlaneDataDisplay&,pd,cb);
     SbImagei32 img;
     SbVec3i32 size;
     int bytesPerPixel;
     pd.getChannels()->getChannels2RGBA()->createRGBA( img );
     unsigned char* data = img.getValue(size,bytesPerPixel);
     int width = size[0];
     int height = size[1];
     int depth = size[2];

     std::cout << "image size: " << size[0] << " "<< size[1] << size[2] 
<< std::endl;
     std::cout << "bytes per pixel: " << bytesPerPixel << std::endl;

Output:
PIX Image size: 360 1167
PIX bytesPerPixel: 1

The strange thing is that bytesPerPixel is always 1. I assumed I would 
get 4 for the RGBA image. It is also strange that I always get the same 
pixel size regardless of the displayed size of the line (in my case I 
tried it with a crossline). See the two attached screenshots.
Could you think of a reason for this?

>
>
> > 2) I want to be able to remotely add seed points for horizon 
> tracking. Does
> > anybody have an idea of how to do this without faking mouse events?
>
> The usual entrance for this is the Horizon3DSeedPicker class.
>
> See: MPEEngine::horizon3dseedpicker.cc
>
> bool addSeed(const Coord3&,bool drop);
>
> This coordinate is in world coordinates, so there is some transformation
> work to do. You guess you have study how OpendTect itself is passing its
> mouse events from visBase::EventCatcher via visSurvey::MPEClickCatcher
> and uiVis::uiMPEMan towards MPE::Horizon3DSeedPicker to get an idea on
> what has to be done to achieve this.
Thanks. I will have a look at the MPEEngine::horizon3dseedpicker class.

Best regards,
David

>
>
> Best regards,
>
> Jaap Glas
>
>


-- 
David d'Angelo, M. Sc.
Adaptive Reflective Teams
Fraunhofer IAIS
Schloss Birlinghoven
53754 Sankt Augustin
Germany
Fon: +49 (0) 2241 14 3444
Fax: +49 (0) 2241 14 2040

-------------- next part --------------
A non-text attachment was scrubbed...
Name: crossline_cropped.png
Type: image/png
Size: 188321 bytes
Desc: not available
URL: <http://lists.opendtect.org/pipermail/developers/attachments/20121120/812233ed/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crossline_full.png
Type: image/png
Size: 229764 bytes
Desc: not available
URL: <http://lists.opendtect.org/pipermail/developers/attachments/20121120/812233ed/attachment-0001.png>


More information about the Developers mailing list