[vtkusers] Rapid access to scalar data in vtkImageData

Jothy jothybasu at gmail.com
Wed Oct 12 04:46:50 EDT 2011


I have tried that, it works pretty much faster!

Thanks

Jothy

On Tue, Oct 11, 2011 at 9:17 PM, David Doria <daviddoria at gmail.com> wrote:

> On Mon, Oct 10, 2011 at 11:41 AM, Martijn Steenwijk
> <martijnsteenwijk at gmail.com> wrote:
> > You might be looking for an iterator, something like this:
> > reader->Update();
> > ImagePointer img = reader->GetOutput();
> > ImageIteratorType img_it(img, img->GetLargestPossibleRegion() );
> > for(img_it.GoToBegin(); !img_it.IsAtEnd(); ++img_it){
> >     double value = img_it.Get();
> > }
> > Best,
> > Martijn
>
> Martijn, this is the VTK list :)
>
> Jothy, I think you're looking for imageData->GetScalarPointer(). Then
> you can access the data with normal pointer arithmetic.
>
> David
>



-- 
Jothybasu K Selvaraj
PhD Student
University of Liverpool
Liverpool,UK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111012/1c5fbb2e/attachment.htm>


More information about the vtkusers mailing list