From: David Sarrut Date: Wed, 18 Jul 2012 06:16:21 +0000 (+0200) Subject: Update mask size when label is removed. X-Git-Tag: v1.4.0~314 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=53e92963c5c06b2b090ed008f6567f3a7d29b02c;p=clitk.git Update mask size when label is removed. --- 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(); } //------------------------------------------------------------------------------