<div>Hi Nicholas,</div><div><br></div><div>On Wed, Feb 4, 2009 at 11:55 PM, Nicholas Kinar <span dir="ltr">&lt;<a href="mailto:n.kinar@usask.ca">n.kinar@usask.ca</a>&gt;</span> wrote:</div><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

I am wondering if it would be possible to plot raster data using VTK in a similar fashion to the Matlab imagesc(X) function. &nbsp;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. &nbsp;The colormap intensity would correspond to the scaled double values. &nbsp;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?</blockquote>
<div><br></div><div>You&#39;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.</div><div>&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Does anyone have some sample code in C/C++? &nbsp;Which functions would I use in VTK to create such a plot?<br></blockquote><div>&nbsp;</div><div>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.</div>
<div><br></div><div>HTH</div><div><br></div><div>Shash</div></div></div>