Skip to content
Snippets Groups Projects
Commit 52e37c3e authored by Jordi Inglada's avatar Jordi Inglada
Browse files

ENH: Simplify the histogram summary

no need for the max frequencies; only need to know if they are different
parent 4e14b787
Branches
Tags
No related merge requests found
......@@ -175,10 +175,8 @@ protected:
struct HistoSummary
{
unsigned int freqCenterLabel;
unsigned int majorityFreq;
PixelType majorityLabel;
unsigned int secondFreq;
PixelType secondLabel;
bool majorityUnique;
};
struct CompareHistoFequencies
......
......@@ -72,8 +72,7 @@ NeighborhoodMajorityVotingImageFilter<TInputImage,
else
{
//If the majorityLabel is NOT unique in the neighborhood
if(histoSummary.secondFreq == histoSummary.majorityFreq &&
histoSummary.secondLabel != histoSummary.majorityLabel)
if(!histoSummary.majorityUnique)
{
if (m_KeepOriginalLabelBool == true)
{
......@@ -123,10 +122,8 @@ NeighborhoodMajorityVotingImageFilter<TInputImage, TOutputImage,
typename NeighborhoodMajorityVotingImageFilter<TInputImage, TOutputImage,
TKernel>::HistoSummary result;
result.freqCenterLabel = histoNeigh[nit.GetCenterPixel()];
result.majorityFreq = histoNeighVec[0].second;
result.majorityLabel = histoNeighVec[0].first;
result.secondFreq = histoNeighVec[1].second;
result.secondLabel = histoNeighVec[1].first;
result.majorityUnique = (histoNeighVec[0].second != histoNeighVec[1].second);
return result;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment