[vtkusers] vtkImageAccumulate

David Doria daviddoria at gmail.com
Fri Apr 29 07:12:05 EDT 2011


On Fri, Apr 29, 2011 at 2:33 AM, Ula Popov <ula.popov at gmail.com> wrote:

> Hello all,
>
> I have an object of class vtkImageData.
> It has two arrays: density (scalar) and velocity (vector).
>
> I want to know mean and median values of the density field.
>
> I tried to use vtkImageAccumulate to achieve this goal, but
> my program crashes on my input (actually, I don't know how
> to specify on which of the arrays I want to apply. How
> should I do it?)
> When I tried to specify origin and spacing, I got similar result (seg
> fault)
>
>         vtkImageAccumulate *Accumulate = vtkImageAccumulate::New();
>
> Accumulate->SetInput(grid);
>
>
> Accumulate->Update();
> <------- crashes here
>         double *mean = Accumulate->GetMean();
>
>
> Thank you!
> ula
>

After a quick try I didn't get it to work either. I posted this shell:
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/WishList/vtkImageAccumulate

Maybe someone can see what it wrong with it for you.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110429/e98a0c08/attachment.htm>


More information about the vtkusers mailing list