[vtkusers] Get the pointer of Scalar data
Matthias Guenther
Matthias.Guenther at AdvancedMRI.com
Tue Feb 5 16:50:08 EST 2002
Hi,
I'm not a VTK expert, but you could try to update your pipeline before
accessing the pointer.
See below.
Jianlong Zhou wrote:
>
> hi, all,
>
> I write a vtk pipeline to computer gradient magnitude of volume data.
> I want to get the pointer to this gradient magnitude. I wrote the
> following pipeline.But I cannot get the pointer to this gradient
> magnitude. The value of the pointer is always 0x0000000.Is there any
> other method to get scalar pointer? How to get the pointer to the
> gradient magnitude?
>
> My pipeline is like this:
>
> vtkImageGradientMagnitude *gradient=vtkImageGradientMagnitude::New();
> gradient->SetDimensionality( 3);
> gradient->SetInput(reader->GetOutput());
>
Add something like that here:
gradient->Update();
> ////Following line is to get scalar pointer, but I can not get its
> pointer.
> unsigned short *Pointer = (unsigned short
> *)gradient->GetOutput()->GetScalarPointer();
> ..............
>
> Thank you in advance.
>
> Jianlong
I hope, that helps.
Bye,
Matthias
More information about the vtkusers
mailing list