[Developers] How to output attributes in a multi-components cube or 2D data?

Helene Huck helene.huck at dgbes.com
Thu Sep 3 11:43:03 CEST 2009


Dear All,

In the newest version 4.0.1 of OpendTect, there is now the possibility
to handle ( ie: create, compute, export and display ) cubes and 2D data
with multiple components; for those of you developing attribute-plugins
it might be quite interesting to know a little bit more about it:

This is actually dedicated to attributes which can have multiple outputs
computed using the same parameters: in the former versions of OpendTect
you would have had to start a new computation for each output, now you
can compute everything in one go, hence saving a lot of time! The best
example visible in our source code is the Spectral Decomposition
attribute: the amplitude spectrum of the signal can be outputted for a
range of frequencies; since the decomposition of the signal is done
anyway, it is thus easier and much quicker to output in the same cube
the results for frequencies 20 - 25- 30 - 35- 40 Hz, for instance, than
creating 5 different output cubes .

If you are developing such an attribute, what needs to be changed to
output multiple components in a single stored cube/ 2D stored data?
Not a lot actually, in your attribute you will just have to add a
function called "getCompNames" to specify a name for all possible
components you could output, even if this number is dependant on some
parameters. This function is a virtual function available for all
Attrib::Providers, it is public:     void getCompNames(BufferStringSet&)
const;
For a quick example let's please have a look at how it is done in
src/Attributes/specdecompattrib.cc:

void SpecDecomp::getCompNames( BufferStringSet& nms ) const

{

    nms.erase();

    const float nyquistfreq = 0.5 / refstep;            //The Nyquist
frequency determines the number of output we can compute

    const char* basestr = "frequency = ";

    BufferString suffixstr = zIsTime() ? " Hz" : " cycles/mm";

    for ( float freq=deltafreq_; freq<nyquistfreq; freq+=deltafreq_ )

    {

        BufferString tmpstr = basestr; tmpstr += freq; tmpstr += suffixstr;

        nms.add( tmpstr.buf() );

    }

}


Basically this will make the standard "Create Seismic Output" understand
that you can output more than one component (before computing, a dialog
will pop up to allow the user to select which ones he wants to compute
in his cube). Of course once the muti-components cube is created, it is
then possible to compute any attribute on component N and to display all
components one by one or all together as a kind of movie-style display.

In case you have any further question concerning the development of such
a multi-output attribute, do not hesitate to ask;
Best regards,
Helene

-- 
--
-- Helene Huck
-- Geophysical software engineer
-- dGB Earth Sciences B.V.
-- Nijverheidstraat 11-2, 7511 JM Enschede, The Netherlands
-- mailto: helene.huck at dgbes.com, http://www.dgbes.com
-- Tel: +31 53 4315155 , Fax: +31 53 4315104






More information about the Developers mailing list