<div class="gmail_quote">On Fri, Feb 12, 2010 at 10:19 AM, michiel mentink <span dir="ltr"><<a href="mailto:michael.mentink@st-hughs.ox.ac.uk">michael.mentink@st-hughs.ox.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>Hi HanJong,<br><br>maybe this example will help you:<br><br><a href="http://www.cmake.org/Wiki/VTK/Examples/Developers/vtkImageAlgorithm_Source" target="_blank">http://www.cmake.org/Wiki/VTK/Examples/Developers/vtkImageAlgorithm_Source</a><br>
<br>The method you're looking for might be <br>imageData->GetScalarComponentAsDouble(x,y,z,0);<br><br><br>cheers, <br><br>Michael<br><br></blockquote><div><br></div><div>I believe it is actually much better to use:</div>
<div><a href="http://www.vtk.org/Wiki/VTK/Examples/IterateImageData">http://www.vtk.org/Wiki/VTK/Examples/IterateImageData</a> </div></div><div><br></div><div>Because then you control the type explicitly. I never liked "GetScalarComponentAsDouble" when the data wasn't double. Same for SetScalarComponentFromDouble - with GetScalarPointer, you can set and get the value while explicitly controlling the type.</div>
<br><div>Thanks,<br><br>David</div>