[vtkusers] A simple and efficient histogram class?

Miguel Nunes m.nunes at fratoria.com
Wed Sep 20 10:09:18 EDT 2017


Hello,
I would like to ask this list about histograms in VTK c++. I have been a vtk
user for several years, but never had the need to use histograms through vtk
as I was using pure c++ and openGL.
Now, I would like to simply plot a basic histogram of a float 3d image. I
have taken a look at the examples provided but I find myself quite confused.
  
Honestly, for an advanced visualization toolkit I am quite surprised to find
it so complicated. There are classes such as vtkPlot that allow bars, then
there is vtkBarChartActor, vtkImageAccumulate, vtkXYPlotActor,
vtkImageHistogramStatistics and vtkImageHistogram.

It all needs to be remixed, connected and many properties have to be set
manually.

Maybe I am missing a class (or the point), but in general terms I would like
to easily plot and render a simple histogram, like:

myHistogram->setData( vtkImagaData *)
myHistogram->setXRange(range[2]) // clips values under and above the range specified
myHistogram->setNumberOfBins(15) // calculates the bin width and each bins' Y
myHistogram->update()            //generate the whole thing
renderer->getActor()->setData(myHistogram)

...and then its done.

Any chance this actually exist? Thank you very much!



More information about the vtkusers mailing list