[vtkusers] xxxxxSPAMxxxxx xxxxxSPAMxxxxx Access the direct data values of 3D CT data, GetScalarPointer() problem!

David Doria daviddoria+vtk at gmail.com
Fri Feb 12 10:24:49 EST 2010


On Fri, Feb 12, 2010 at 10:19 AM, michiel mentink <
michael.mentink at st-hughs.ox.ac.uk> wrote:

>
> Hi HanJong,
>
> maybe this example will help you:
>
> http://www.cmake.org/Wiki/VTK/Examples/Developers/vtkImageAlgorithm_Source
>
> The method you're looking for might be
> imageData->GetScalarComponentAsDouble(x,y,z,0);
>
>
> cheers,
>
> Michael
>
>
I believe it is actually much better to use:
http://www.vtk.org/Wiki/VTK/Examples/IterateImageData

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.

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100212/c38b0027/attachment.htm>


More information about the vtkusers mailing list