[vtkusers] Plotting raster data with colormap

Nicholas Kinar n.kinar at usask.ca
Thu Feb 5 00:16:28 EST 2009


Hi T.R.--

Thank you so much for pointing me in the right direction.  These classes 
should perform well for my application.  Once again, thank you!

Nicholas


Shashwath T.R. wrote:
> Hi Nicholas,
>
> On Wed, Feb 4, 2009 at 11:55 PM, Nicholas Kinar <n.kinar at usask.ca 
> <mailto:n.kinar at usask.ca>> wrote:
>
>     I am wondering if it would be possible to plot raster data using
>     VTK in a similar fashion to the Matlab imagesc(X) function.
>      Essentially what I have is a (m x n) matrix of doubles, and I
>     would like to display this matrix as a 2D plot with a colormap.
>      The colormap intensity would correspond to the scaled double
>     values.  Would it be possible to set this up in the form of an
>     animation, i.e. code that continues to update and display the plot
>     on the screen?
>
>
> You'll want to use vtkImageViewer or vtkImageViewer2. Create an image 
> of size MxNx1, fill it with your input data, and set it as input to 
> your image viewer.
>  
>
>     Does anyone have some sample code in C/C++?  Which functions would
>     I use in VTK to create such a plot?
>
>  
> Take a look at the image viewer and image data examples in the VTK 
> source code... They may not exactly contain what you want, but it 
> should point you in the right direction.
>
> HTH
>
> Shash
> ------------------------------------------------------------------------
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>   



More information about the vtkusers mailing list