[vtkusers] displaying histogram using vtkImageAccumulate
Prathamesh Kulkarni
prathameshmkulkarni at gmail.com
Tue Jul 20 16:50:16 EDT 2010
Thanks for the pointer to the example.
As the example says:
"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 "
However, just in case, this can be bypassed by setting (for a 1D histogram):
histogram->SetComponentExtent(1, x_max, 0, 0, 0, 0); instead of
histogram->SetComponentExtent(0, x_max, 0, 0, 0, 0);
Prathamesh
On Tue, Jul 20, 2010 at 10:50 AM, David Gobbi <david.gobbi at gmail.com> wrote:
> Hi Prathamesh,
>
> The output of vtkImageAccumulate must be plotted in order to show the
> histogram:
> http://www.vtk.org/Wiki/VTK/Examples/Images/HistogramXYPlot
>
> David
>
>
>
> On Tue, Jul 20, 2010 at 8:44 AM, Prathamesh Kulkarni
> <prathameshmkulkarni at gmail.com> wrote:
> >
> > Hello all,
> >
> > I want to be able to display histogram of a part of an image. Following
> is
> > what I did so far:
> >
> > image_accumulate->SetInput(vtkImageData);
> > image_accumulate->SetStencil(vtkImageStencilData);
> > image_accumulate->Update();
> >
> > histogram_image = image_accumulate->GetOutput();
> > histogram_image->Update();
> >
> >
> > When I cast the histogram image to unsigned char and render it using
> > vtkImageActor, I see a blank white image. Am I missing something here?
> >
> >
> > Thanks,
> > Prathamesh
> >
> >
> >
> >
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the VTK FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100720/afacd395/attachment.htm>
More information about the vtkusers
mailing list