[Insight-users] fast copy

Julien Jomier julien.jomier at kitware.com
Mon Mar 13 12:15:46 EST 2006


Hi Arnaud,

You can look at the itkImageDuplicator class to copy an image.
This class uses memcpy() internally.

Julien

Arnaud Garcia wrote:
> Hello,
> 
> Is it the fast and safe ;-) way to do a full copy of images:
> 
> unsigned long outputImageDataSize = 
> outputImage->GetPixelContainer()->Size();
> OutputImagePixelType* importPointer = 
> imageOne->GetPixelContainer()->GetBufferPointer();
> OutputImagePixelType* bufferPointer 
> =imageTwo->GetPixelContainer()->GetBufferPointer();
> memcpy(bufferPointer, importPointer, 
> outputImageDataSize*sizeof(OutputImagePixelType));
> 
> thanks,
> 
> 
> Arnaud
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 



More information about the Insight-users mailing list