[Insight-users] help with ImageRegionIterator
Renaud Isabelle
renauisa at yahoo.fr
Mon Jul 18 09:43:27 EDT 2005
Hi,
Can someone tell me the difference between using GetRequestedRegion() and GetBufferedRegion().
I'm implemented a simple function. I have no error at building but always an error at execution such as Error in memory, DAMAGE AFTER NORMAL BLOCK. I took a look on the web to check out the meaning: it seems that I am overwriting in memory.
Maybe it comes from my iterators. Here is what I did.
Please help,
Isa
ImageType3D::Pointer outputImage = ImageType3D::New();
ImageType3D::IndexType start;
start[0] = 0; // first index on X
start[1] = 0; // first index on Y
start[2] = 0; // first index on Z
ImageType3D::SizeType size;
size[0] = width; // size along X
size[1] = height; // size along Y
size[2] = iNumFrames; // size along Z
ImageType3D::RegionType outputRegion;
outputRegion.SetSize( size );
outputRegion.SetIndex( start );
outputImage->SetRegions(outputRegion);
outputImage->SetSpacing(imageInitiale->GetSpacing());
outputImage->SetOrigin(imageInitiale->GetOrigin());
outputImage->Allocate();
typedef itk::ImageRegionConstIterator<ImageType3D> ConstIteratorType;
ConstIteratorType inputIt(imageInitiale, imageInitiale->GetBufferedRegion());
typedef itk::ImageRegionIterator<ImageType3D> IteratorType;
IteratorType outputIt(outputImage, imageInitiale->GetBufferedRegion());
inputIt.GoToBegin();
outputIt.GoToBegin();
float** MatriceImgR=fmatrix_allocate_2d(height,width);
float** MatriceImgI=fmatrix_allocate_2d(height,width);
/*Initialisation a zero de toutes les matrices */
for(int i=0;i<height;i++)
for(int j=0;j<width;j++)
{
MatriceImgI[i][j]=0.0;
MatriceImgR[i][j]= (float)(inputIt.Get());
++inputIt;
}
/*FFT*/
fft2D(MatriceImgR,MatriceImgI,height,width);
---------------------------------
Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger
Téléchargez le ici !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20050718/4132d34c/attachment.html
More information about the Insight-users
mailing list