[vtkusers] 2D Histogram (or spectrogram) chart

Mohamed Amine Mzoughi aminemzoughi at febus-optics.com
Mon Dec 17 04:12:27 EST 2018


Hello,

Thank you very much sir, this is what I am looking for ! Handling a 2D 
color map (spectrogram) in a 3D space is very messy.

I don't know why they chose the name "histogram" for this VTK chart and 
why it isn't popular (It is not used in ParaView, and "histogram" isn't 
the chart with bars used in image processing ?).

I hope this chart will allow me to display a waterfall in a 
not-too-disgusting way//. In a 3D space, I'm modifiying the camera 
parameters to show the waterfall effect.

However, in the test example, I commented these lines :

//chart->MouseButtonPressEvent(mouseEvent);
//chart->MouseButtonReleaseEvent(mouseEvent); // segfault

As, in "vtkIdType vtkPlotHistogram2D::GetNearestPoint(const vtkVector2f& 
point, const vtkVector2f& tolerance, vtkVector2f* location)"

the member "Input" (vtkSmartPointer<vtkImageData>) is not checked 
against nullptr.

Best regards.

Le 15/12/2018 à 07:14, kenichiro yoshimi a écrit :
> Hi,
>
> I had a look at this test which you were just looking for:
> https://github.com/Kitware/VTK/blob/master/Charts/Core/Testing/Cxx/TestHistogram2D.cxx
>
> Best,
>
> 2018年12月14日(金) 23:57 Mohamed Amine Mzoughi <aminemzoughi at febus-optics.com>:
>> Hello,
>>
>> I've seen this screenshot of a 2D chart :
>> https://www.na-mic.org/wiki/File:VTK-Charts-Histogram2D.png and I didn't
>> find the VTK class that allows me to create it. (the original link is :
>> https://www.na-mic.org/wiki/2011_Summer_Project_Week_Breakout_Session_VTKCharts).
>> Is this chart was removed ? where can I found its source code ?
>>
>> Currently I am using a vtkImageActor to display a 2-D color map (or
>> spectrogram) but I am struggling with the camera and the scale of the
>> actor to make it right (to fit the whole window) and I am drawing the
>> axis in another QVTKOpenGL widget managing a 2D scene (vtkAxis - like
>> the ParaView Slice View). I am not really comfortable with this solution.
>>
>> I don't want to use APIs like QCustomPlot or Qwt because I will have to
>> convert my data to use them and this will add another dependency to my
>> program.
>>
>> I played a little with vtkContextView, vtkContextArea and vtkImageItem
>> to display a vtkImageData, but there is no possibility to change the
>> color or display a vtkImageData whose point data array has a single
>> compnent (it should have 4 components: r,g,b,a).
>>
>> Thanks.
>>
>> _______________________________________________
>> 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
>>
>> Search the list archives at: http://markmail.org/search/?q=vtkusers
>>
>> Follow this link to subscribe/unsubscribe:
>> https://public.kitware.com/mailman/listinfo/vtkusers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20181217/97046aa0/attachment.html>


More information about the vtkusers mailing list