From 205d50ce100b70ad4cd986edbea3a79247cc165c Mon Sep 17 00:00:00 2001 From: Juan Prieto Date: Thu, 5 Nov 2009 15:42:58 +0000 Subject: [PATCH] Creating a new instance of an image in each change!!! --- lib/CheckBoard.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/CheckBoard.cpp b/lib/CheckBoard.cpp index d4f5254..afa33d2 100644 --- a/lib/CheckBoard.cpp +++ b/lib/CheckBoard.cpp @@ -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(); + } -- 2.47.1