creating an image
Tim Hutton
T.Hutton at eastman.ucl.ac.uk
Thu Dec 16 12:07:18 EST 1999
At 16:32 16/12/99 +0000, you wrote:
>Quick question, how do you create a new image now? I want something very
>similar to the code on p450 of the book, but updated for vtk2.4
>(vtkImageRegion no longer exists). Everything I'm trying makes my code
>crash, presumably because things aren't being allocated properly.
>
>Here's an example of what I've been trying:
>
> vtkImageCache *im = (vtkImageCache*)vtkImageCache::New();
>
> im->SetWholeExtent(0,100,0,100,0,0);
> im->SetUpdateExtent(0,100,0,100,0,0);
>
> int x,y;
> for(x=0;x<100;x++)
> {
> for(y=0;y<100;y++)
> {
> *(float*)(im->GetData()->GetScalarPointer(x,y,0)) = 0.0F;
> }
> }
>
> return im;
>
>Crashes most reliably.
OK :) Even if I use a concrete class (vtkImageSimpleCache) it still
crashes. Any ideas?
Tim.
-----------------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>. For help, send message body containing
"info vtkusers" to the same address. Live long and prosper.
-----------------------------------------------------------------------------
More information about the vtkusers
mailing list