_imageoutput->SetSpacing( bbGetInputImageFix()->GetSpacing() );
_imageoutput->SetDimensions( dim[0], dim[1], dim[2] );
_imageoutput->AllocateScalars();
+ // Duplicating Fix Image
+ long sizeimage = dim[0]*dim[1]*dim[2]*bbGetInputImageFix()->GetScalarSize();
+ memcpy( _imageoutput->GetScalarPointer() , bbGetInputImageFix()->GetScalarPointer() , sizeimage);
}
if (bbGetInputType()==1)
{
}
- // Duplicating Fix Image
- long sizeimage = dim[0]*dim[1]*dim[2]*bbGetInputImageFix()->GetScalarSize();
- memcpy( _imageoutput->GetScalarPointer() , bbGetInputImageFix()->GetScalarPointer() , sizeimage);
// Copy the Move Image
int j,k;
int px,py,pz;
+// bbGetInputImageMove()->Modified();
+// bbGetInputImageMove()->Update();
bbGetInputImageMove()->GetWholeExtent(ext);
- int dimMoveX = ext[1]-ext[0]+1;
- int dimMoveY = ext[3]-ext[2]+1;
- int dimMoveZ = ext[5]-ext[4]+1;
+ int dimMoveX = ext[1]-ext[0]+1;
+ int dimMoveY = ext[3]-ext[2]+1;
+ int dimMoveZ = ext[5]-ext[4]+1;
- int spxM=0; // start px MoveImage
- int sizeXM=0; // sizeX MoveImage
+ int spxM = 0; // start px MoveImage
+ int sizeXM = 0; // sizeX MoveImage
- px=bbGetInputOrigin()[0];
- spxM=0;
- if (px<=0)
+ px = bbGetInputOrigin()[0];
+ spxM = 0;
+ if (px<0)
{
spxM=px*(-1);
px=0;
}
sizeXM = dimMoveX-spxM;
if (px+sizeXM>=dim[0]) sizeXM=dim[0]-px;
-
sizeXM=sizeXM*bbGetInputImageFix()->GetScalarSize();
for (k=0; k<dimMoveZ; k++)
{
for (j=0; j<dimMoveY; j++)
{
py=j+bbGetInputOrigin()[1];
- pz=k+bbGetInputOrigin()[2];
-
- if ( (py<dim[1]) && (pz<dim[2]) &&
- (py>=0) && (pz>=0) &&
- (sizeXM>0) )
- {
- memcpy( _imageoutput->GetScalarPointer(px,py,pz) , bbGetInputImageMove()->GetScalarPointer(spxM,j,k) , sizeXM );
- }
+ pz=k+bbGetInputOrigin()[2];
+ if ( (py<dim[1]) && (pz<dim[2]) &&
+ (py>=0) && (pz>=0) &&
+ (sizeXM>0) )
+ {
+ memcpy( _imageoutput->GetScalarPointer(px,py,pz) , bbGetInputImageMove()->GetScalarPointer(spxM,j,k) , sizeXM );
+ }
} // for j
} // for k