<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
Thanks David,<div><br></div><div>This looks suitable.</div><div><br></div><div>I have a follow up question (actually two). Firstly, is it possible to label the different scalars in a vtkImageData? And secondly, some of my quantities are vectors, can I also associate vectors with a regular grid like this or would a different data structure be more appropriate?</div><div><br></div><div>Cheers,</div><div>Dan</div><div><br><div>&gt; Date: Mon, 28 Nov 2011 17:30:52 -0500<br>&gt; Subject: Re: [vtkusers] (no subject)<br>&gt; From: daviddoria@gmail.com<br>&gt; To: djb_ro@hotmail.co.uk<br>&gt; CC: vtkusers@vtk.org<br>&gt; <br>&gt; On Mon, Nov 28, 2011 at 5:18 PM, Dan Barker &lt;djb_ro@hotmail.co.uk&gt; wrote:<br>&gt; &gt; Dear All,<br>&gt; &gt; I have a vtkImageData object which has several scalar components set as<br>&gt; &gt; &nbsp; &nbsp;voxels-&gt;SetNumberOfScalarComponents(4);<br>&gt; &gt; and set as<br>&gt; &gt; &nbsp; &nbsp;voxels-&gt;SetScalarComponentFromDouble(i,j,k,comp,0.0);<br>&gt; &gt; I wish to run vtkMarchingCubes algorithm on each scalar component<br>&gt; &gt; individually. How do I access this? When I had just one component I could<br>&gt; &gt; simply do<br>&gt; &gt; &nbsp; &nbsp; vtkMarchingCubes *surface = vtkMarchingCubes::New();<br>&gt; &gt; &nbsp; &nbsp;&nbsp;surface-&gt;SetInput(voxels);<br>&gt; &gt; &nbsp; &nbsp; // etc ...<br>&gt; &gt; And marching cubes would run correctly and return a very nice looking<br>&gt; &gt; surface. But now I cannot see a way to tell vtkMarchingCubes which component<br>&gt; &gt; to use.<br>&gt; &gt; Any help with this would be most appreciated.<br>&gt; &gt; Regards,<br>&gt; &gt; Dan<br>&gt; <br>&gt; You may be looking for vtkImageExtractComponents:<br>&gt; <br>&gt; http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/ExtractComponents<br>&gt; <br>&gt; David<br></div></div>                                               </div></body>
</html>