<div dir="ltr">Thanks for the pointer to the example.<br><br>As the example says:<br><br>"It appears the maximum frequency of a histogram generated by
vtkImageAccumulate, when that frequency corresponds to the value of 0,
cannot be disabled by setting ignore zero to true! See lines
245 and 218 in vtkImageAccumulate.cxx
"<br><br>However, just in case, this can be bypassed by setting (for a 1D histogram):<br><br>histogram->SetComponentExtent(1, x_max, 0, 0, 0, 0); instead of <br>histogram->SetComponentExtent(0, x_max, 0, 0, 0, 0);<br>
<br><br>Prathamesh<br><br><div class="gmail_quote">On Tue, Jul 20, 2010 at 10:50 AM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi Prathamesh,<br>
<br>
The output of vtkImageAccumulate must be plotted in order to show the histogram:<br>
<a href="http://www.vtk.org/Wiki/VTK/Examples/Images/HistogramXYPlot" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Images/HistogramXYPlot</a><br>
<br>
David<br>
<div><div></div><div class="h5"><br>
<br>
<br>
On Tue, Jul 20, 2010 at 8:44 AM, Prathamesh Kulkarni<br>
<<a href="mailto:prathameshmkulkarni@gmail.com">prathameshmkulkarni@gmail.com</a>> wrote:<br>
><br>
> Hello all,<br>
><br>
> I want to be able to display histogram of a part of an image. Following is<br>
> what I did so far:<br>
><br>
> image_accumulate->SetInput(vtkImageData);<br>
> image_accumulate->SetStencil(vtkImageStencilData);<br>
> image_accumulate->Update();<br>
><br>
> histogram_image = image_accumulate->GetOutput();<br>
> histogram_image->Update();<br>
><br>
><br>
> When I cast the histogram image to unsigned char and render it using<br>
> vtkImageActor, I see a blank white image. Am I missing something here?<br>
><br>
><br>
> Thanks,<br>
> Prathamesh<br>
><br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
><br>
</blockquote></div><br></div>