Program: bbtk
Module: $RCSfile: bbvtkUnMosaic.cxx,v $
Language: C++
- Date: $Date: 2010/10/06 16:37:36 $
- Version: $Revision: 1.2 $
+ Date: $Date: 2011/05/31 09:39:11 $
+ Version: $Revision: 1.3 $
=========================================================================*/
/* ---------------------------------------------------------------------
unsigned short *output =(unsigned short *)(vtkImageOut->GetScalarPointer());
unsigned short *dest = output;
- int lgrLigne = outputdims[0];
- int lgrImage = lgrLigne*outputdims[1]; //*sizeof(unsigned short);
+ int dimXImageElem = outputdims[0];
+ int dimYImageElem = outputdims[1];
+ int lgrImage = dimXImageElem*dimYImageElem;
int debImage;
for (int i=0; i<numberOfImagesInMosaic; i++)
{
- //debImage=(i%nbImagesPerRow) * lgrImage*nbImagesPerRow + (i%nbImagesPerRow)*lgrLigne;
- debImage=(i/nbImagesPerRow) * lgrImage*nbImagesPerRow + (i%nbImagesPerRow)*lgrLigne;
- for(int j=0; j<outputdims[1]; j++)
+ debImage=(i/nbImagesPerRow) * lgrImage*nbImagesPerRow + (i%nbImagesPerRow)*dimXImageElem;
+ for(int j=0; j<dimYImageElem; j++)
{
- memcpy(dest, input+debImage, lgrLigne*sizeof(unsigned short));
- debImage += lgrLigne*nbImagesPerRow;
- dest += lgrLigne;
+ memcpy(dest, input+debImage, dimXImageElem*sizeof(unsigned short));
+ debImage += dimXImageElem*nbImagesPerRow;
+ dest += dimXImageElem;
}
}
return vtkImageOut;