<div class="gmail_quote">On Fri, Apr 29, 2011 at 2:33 AM, Ula Popov <span dir="ltr">&lt;<a href="mailto:ula.popov@gmail.com">ula.popov@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello all,<br><br>I have an object of class vtkImageData.<br>It has two arrays: density (scalar) and velocity (vector).<br><br>I want to know mean and median values of the density field.<br><br>I tried to use vtkImageAccumulate to achieve this goal, but<br>

my program crashes on my input (actually, I don&#39;t know how<br>to specify on which of the arrays I want to apply. How<br>should I do it?)<br>When I tried to specify origin and spacing, I got similar result (seg fault)<br>

<br>        vtkImageAccumulate *Accumulate = vtkImageAccumulate::New();<br>        Accumulate-&gt;SetInput(grid);                                                            <br>        Accumulate-&gt;Update();                                                                       &lt;------- crashes here<br>

        double *mean = Accumulate-&gt;GetMean();<br><br><br>Thank you!<br><font color="#888888">ula<br></font></blockquote><div><br>After a quick try I didn&#39;t get it to work either. I posted this shell: <br></div><div>
<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/WishList/vtkImageAccumulate">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/WishList/vtkImageAccumulate</a><br><br>Maybe someone can see what it wrong with it for you.<br>
<br>David <br></div></div>