Improved statistics:
- Fixed issue with the range maximum value calculation - Added the number of actual used values
This commit is contained in:
1 parent
63442d58b9
commit
b10a593e01
4 files changed
+47
-1
No files matched your search
@@ -184,6 +184,11 @@ FramePropertiesDock::FramePropertiesDock( QWidget* parent, bool* pbMainPlaySwitc
|
|||||||
labelRangeValue = new QLabel;
|
labelRangeValue = new QLabel;
|
||||||
labelRangeValue->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
|
labelRangeValue->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
|
||||||
|
|
||||||
|
QLabel* nEBinsLabel = new QLabel( tr( "Non empty bins:" ) );
|
||||||
|
nEBinsLabel->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
|
||||||
|
labelNEBinsValue = new QLabel;
|
||||||
|
labelNEBinsValue->setAlignment( Qt::AlignRight | Qt::AlignVCenter );
|
||||||
|
|
||||||
QLabel* meanLabel = new QLabel( tr( "Mean:" ) );
|
QLabel* meanLabel = new QLabel( tr( "Mean:" ) );
|
||||||
meanLabel->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
|
meanLabel->setAlignment( Qt::AlignLeft | Qt::AlignVCenter );
|
||||||
labelMeanValue = new QLabel;
|
labelMeanValue = new QLabel;
|
||||||
@@ -212,6 +217,8 @@ FramePropertiesDock::FramePropertiesDock( QWidget* parent, bool* pbMainPlaySwitc
|
|||||||
statisticsLayout->addWidget( labelCountValue, gridRow++, 1 );
|
statisticsLayout->addWidget( labelCountValue, gridRow++, 1 );
|
||||||
statisticsLayout->addWidget( rangeLabel, gridRow, 0 );
|
statisticsLayout->addWidget( rangeLabel, gridRow, 0 );
|
||||||
statisticsLayout->addWidget( labelRangeValue, gridRow++, 1 );
|
statisticsLayout->addWidget( labelRangeValue, gridRow++, 1 );
|
||||||
|
statisticsLayout->addWidget( nEBinsLabel, gridRow, 0 );
|
||||||
|
statisticsLayout->addWidget( labelNEBinsValue, gridRow++, 1 );
|
||||||
statisticsLayout->addWidget( meanLabel, gridRow, 0 );
|
statisticsLayout->addWidget( meanLabel, gridRow, 0 );
|
||||||
statisticsLayout->addWidget( labelMeanValue, gridRow++, 1 );
|
statisticsLayout->addWidget( labelMeanValue, gridRow++, 1 );
|
||||||
statisticsLayout->addWidget( stdDevLabel, gridRow, 0 );
|
statisticsLayout->addWidget( stdDevLabel, gridRow, 0 );
|
||||||
@@ -274,6 +281,7 @@ void FramePropertiesDock::reset()
|
|||||||
|
|
||||||
m_iLastFrameType = -1;
|
m_iLastFrameType = -1;
|
||||||
|
|
||||||
|
labelNEBinsValue->clear();
|
||||||
labelMeanValue->clear();
|
labelMeanValue->clear();
|
||||||
labelPixelsValue->clear();
|
labelPixelsValue->clear();
|
||||||
labelStdDevValue->clear();
|
labelStdDevValue->clear();
|
||||||
@@ -444,6 +452,9 @@ void FramePropertiesDock::updateStatistiques()
|
|||||||
|
|
||||||
if( frame )
|
if( frame )
|
||||||
{
|
{
|
||||||
|
double numBins = frame->getNEBins( channel );
|
||||||
|
labelNEBinsValue->setText( value.setNum( (float)numBins, 'f', 0 ) );
|
||||||
|
|
||||||
QString rangeText =
|
QString rangeText =
|
||||||
"[" + QString::number( frame->getMinimumPelValue( channel ) ) + ":" + QString::number( frame->getMaximumPelValue( channel ) ) + "]";
|
"[" + QString::number( frame->getMinimumPelValue( channel ) ) + ":" + QString::number( frame->getMaximumPelValue( channel ) ) + "]";
|
||||||
labelRangeValue->setText( rangeText );
|
labelRangeValue->setText( rangeText );
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ private:
|
|||||||
QLabel* labelPixelsValue;
|
QLabel* labelPixelsValue;
|
||||||
QLabel* labelCountValue;
|
QLabel* labelCountValue;
|
||||||
QLabel* labelRangeValue;
|
QLabel* labelRangeValue;
|
||||||
|
QLabel* labelNEBinsValue;
|
||||||
QLabel* labelMeanValue;
|
QLabel* labelMeanValue;
|
||||||
QLabel* labelStdDevValue;
|
QLabel* labelStdDevValue;
|
||||||
QLabel* labelMedianValue;
|
QLabel* labelMedianValue;
|
||||||
|
|||||||
+34
-1
@@ -913,12 +913,45 @@ unsigned int CalypFrame::getMaximumPelValue( unsigned channel )
|
|||||||
{
|
{
|
||||||
if( d->m_puiHistogram[i] > 0 )
|
if( d->m_puiHistogram[i] > 0 )
|
||||||
{
|
{
|
||||||
return i - indexEnd + 1;
|
return i - indexEnd - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int CalypFrame::getNEBins( unsigned channel )
|
||||||
|
{
|
||||||
|
if( !d->m_bHasHistogram )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
channel = d->getRealHistogramChannel( channel );
|
||||||
|
if( channel < 0 )
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
int indexStart;
|
||||||
|
int indexEnd;
|
||||||
|
if( channel == HIST_ALL_CHANNELS )
|
||||||
|
{
|
||||||
|
indexStart = 0;
|
||||||
|
indexEnd = d->m_uiHistoChannels * d->m_uiHistoSegments;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
indexStart = channel * d->m_uiHistoSegments;
|
||||||
|
indexEnd = indexStart + d->m_uiHistoSegments;
|
||||||
|
}
|
||||||
|
|
||||||
|
int nEBins = 0;
|
||||||
|
for( int i = indexStart; i < indexEnd; i++ )
|
||||||
|
{
|
||||||
|
if( d->m_puiHistogram[i] > 0 )
|
||||||
|
{
|
||||||
|
nEBins++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nEBins;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int CalypFrame::getMaximum( unsigned channel )
|
unsigned int CalypFrame::getMaximum( unsigned channel )
|
||||||
{
|
{
|
||||||
if( !d->m_bHasHistogram )
|
if( !d->m_bHasHistogram )
|
||||||
|
|||||||
@@ -361,6 +361,7 @@ public:
|
|||||||
int getMedian( unsigned channel, unsigned int start, unsigned int end );
|
int getMedian( unsigned channel, unsigned int start, unsigned int end );
|
||||||
double getStdDev( unsigned channel, unsigned int start, unsigned int end );
|
double getStdDev( unsigned channel, unsigned int start, unsigned int end );
|
||||||
double getHistogramValue( unsigned channel, unsigned int bin );
|
double getHistogramValue( unsigned channel, unsigned int bin );
|
||||||
|
unsigned int getNEBins( unsigned channel );
|
||||||
int getNumHistogramSegment();
|
int getNumHistogramSegment();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in new issue
Block a user