creating an image

Tim Hutton T.Hutton at eastman.ucl.ac.uk
Thu Dec 16 11:32:02 EST 1999


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.

Cheers,

Tim.
---------------------------------------------------------------------------
Tim Hutton, Research Assistant            Email: T.Hutton at eastman.ucl.ac.uk
MINORI Project                     http://www.eastman.ucl.ac.uk/~dmi/MINORI
Dental and Medical Informatics                   Tel: [+44] (0171) 915 2344
Eastman Dental Institute, UCL                    Fax: [+44] (0171) 915 2303
256 Gray's Inn Road, London WC1X 8LD, UK
---------------------------------------------------------------------------
This email represents the views of the sender alone and must not be
construed as representing the views of the Eastman Dental Institute. It may
contain confidential information and may be protected by law as a legally
privileged document and copyright work. Its content should not be disclosed
and it should not be given or copied to anyone other than the person(s)
named or referenced above. If you have received this email in error, please
contact the sender.



-----------------------------------------------------------------------------
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