From 53e92963c5c06b2b090ed008f6567f3a7d29b02c Mon Sep 17 00:00:00 2001 From: David Sarrut Date: Wed, 18 Jul 2012 08:16:21 +0200 Subject: [PATCH] Update mask size when label is removed. --- vv/vvToolSegmentation.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vv/vvToolSegmentation.cxx b/vv/vvToolSegmentation.cxx index 1c4fbe9..d4e7a90 100644 --- a/vv/vvToolSegmentation.cxx +++ b/vv/vvToolSegmentation.cxx @@ -515,8 +515,14 @@ void vvToolSegmentation::RemoveLabel() { // Set image label vtkImageData * image = mCurrentCCLImage->GetFirstVTKImageData(); int * pPix = (int*)image->GetScalarPointer(); + int n = 0; for(uint i=0; iGetNumberOfPoints(); i++) { if (pPix[i] == mCurrentLabelUnderMousePointer) pPix[i] = 0; + if (pPix[i] != 0) n++; // count the number of pixels in the foreground } + // Update mask size + mCurrentMaskSizeInPixels = n; + mCurrentMaskSizeInCC = mCurrentMaskImage->GetSpacing()[0] * mCurrentMaskImage->GetSpacing()[1] * mCurrentMaskImage->GetSpacing()[2] * n / (10*10*10); + UpdateMaskSizeLabels(); } //------------------------------------------------------------------------------ -- 2.47.1