[vtkusers] Scale Image Values to [0,1]
HansAusBremen
hansausbremen at gmx.net
Tue Sep 20 08:59:58 EDT 2011
I found a function that might return just what I am looking for.
But when I tried to use it I got a pointer exception ("scalars" seems not to
be filled with data).
This is the function I found
http://www.vtk.org/Wiki/VTK/Examples/Cxx/ImageData/IterateImageData here (at
the bottom of the example) and integrated into my code:
I wrote:
>
> vtkImageReader2 reader
> .
> .
> .
> vtkIntArray* scalars =
> vtkIntArray::SafeDownCast(reader->GetOutput()->GetPointData()->GetArray("ImageScalars"));
> int num = (int) scalars->GetNumberOfComponents();
>
Is it the right function? (returns the number of different values in my
data)
Do I use the function correctly?
What is wrong?
--
View this message in context: http://vtk.1045678.n5.nabble.com/Scale-Image-Values-to-0-1-tp4808465p4822421.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list