]> Creatis software - creaRigidRegistration.git/commitdiff
Creating a new instance of an image in each change!!!
authorJuan Prieto <Juan.Prieto@creatis.insa-lyon.fr>
Thu, 5 Nov 2009 15:42:58 +0000 (15:42 +0000)
committerJuan Prieto <Juan.Prieto@creatis.insa-lyon.fr>
Thu, 5 Nov 2009 15:42:58 +0000 (15:42 +0000)
lib/CheckBoard.cpp

index d4f52540b7e182fcbcada8bcee1d7575acfdc753..afa33d2c9e98bea1551be40099aa496eac14a3dc 100644 (file)
@@ -13,6 +13,7 @@ CheckBoard::CheckBoard()
        squaresY=0;
        newImage = NULL;
        processed=false;
+       newImage = NULL;
 }
 
 /*
@@ -124,12 +125,16 @@ void CheckBoard::calculateImage()
 void CheckBoard::initialize(int dimensions[], double spacing[])
 {
        // Setting the new image
+       if(newImage != NULL){
+                       newImage->Delete();
+       }
        newImage = vtkImageData::New();
        newImage->SetScalarType(type);
        newImage->SetSpacing(spacing);
        newImage->SetDimensions(dimensions);
        newImage->AllocateScalars();
        newImage->Update();
+       
 
 }