From: <rha...@us...> - 2012-03-05 16:44:40
|
Revision: 408 http://mevislabmodules.svn.sourceforge.net/mevislabmodules/?rev=408&view=rev Author: rhameeteman Date: 2012-03-05 16:44:30 +0000 (Mon, 05 Mar 2012) Log Message: ----------- KH. * If autoUpdate is on or apply is pressed and either input is not valid, the statistics are now reset to their default value. Previously they were not changed, which leads to invalid values. Modified Paths: -------------- trunk/Community/General/Sources/ML/CVLSegmentationEvaluationMetric/mlSegmentationEvaluationMetric.cpp trunk/Community/General/Sources/ML/CVLSegmentationEvaluationMetric/mlSegmentationEvaluationMetric.h Modified: trunk/Community/General/Sources/ML/CVLSegmentationEvaluationMetric/mlSegmentationEvaluationMetric.cpp =================================================================== --- trunk/Community/General/Sources/ML/CVLSegmentationEvaluationMetric/mlSegmentationEvaluationMetric.cpp 2012-03-02 15:38:20 UTC (rev 407) +++ trunk/Community/General/Sources/ML/CVLSegmentationEvaluationMetric/mlSegmentationEvaluationMetric.cpp 2012-03-05 16:44:30 UTC (rev 408) @@ -105,8 +105,12 @@ { ML_TRACE_IN("SegmentationEvaluationMetric::handleNotification ()"); - if (getUpdatedInImg(0) && getUpdatedInImg(1) && (_isAutoApplyFld->isOn() || (field == _applyFld))) { - _process(); + if (_isAutoApplyFld->isOn() || (field == _applyFld)) { + if (getUpdatedInImg(0) && getUpdatedInImg(1) ) { + _process(); + } else { + _reset(); + } } } @@ -119,6 +123,7 @@ // Update members to new field state here. // Call super class functionality to enable notification handling again. + handleNotification(NULL); BaseOp::activateAttachments (); } @@ -292,5 +297,24 @@ _cFactorFld->setDoubleValue(cFactor); } +//---------------------------------------------------------------------------------- +//! Reset parameters +//---------------------------------------------------------------------------------- +void SegmentationEvaluationMetric::_reset() +{ + ML_TRACE_IN("SegmentationEvaluationMetric::_reset()"); + + _truePositiveFld->setIntValue(0); + _trueNegativeFld->setIntValue(0); + _falsePositiveFld->setIntValue(0); + _falseNegativeFld->setIntValue(0); + _sensitivityFld->setDoubleValue(0.0); + _specificityFld->setDoubleValue(0.0); + _prevalenceFld->setDoubleValue(0.0); + _levelOfTestFld->setDoubleValue(0.0); + _diceSimilarityCoefficientFld->setDoubleValue(0.0); + _cFactorFld->setDoubleValue(0.0); +} + ML_END_NAMESPACE Modified: trunk/Community/General/Sources/ML/CVLSegmentationEvaluationMetric/mlSegmentationEvaluationMetric.h =================================================================== --- trunk/Community/General/Sources/ML/CVLSegmentationEvaluationMetric/mlSegmentationEvaluationMetric.h 2012-03-02 15:38:20 UTC (rev 407) +++ trunk/Community/General/Sources/ML/CVLSegmentationEvaluationMetric/mlSegmentationEvaluationMetric.h 2012-03-05 16:44:30 UTC (rev 408) @@ -65,6 +65,9 @@ //! Main routine. void _process(); + //! reset parameters on empty input + void _reset(); + //! Number of true positives. unsigned int _numTruePositive; //! Number of true negatives. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |