Commit 38fb2f95 authored by Cédric Traizet's avatar Cédric Traizet
Browse files

ENH : use vector to store mean

parent 7ddc6a27
......@@ -168,16 +168,22 @@ private:
regionMergingFilter->SetInputLabelImage( labelIn );
regionMergingFilter->SetInputSpectralImage( imageIn );
auto myMap = labelStatsFilter->GetLabelPopulationMap();
std::vector<double> Test;
for (int i =0; i <= myMap.rbegin()->first; i++)
auto labelPopulationMap = labelStatsFilter->GetLabelPopulationMap();
std::vector<double> labelPopulation;
for (int i =0; i <= labelPopulationMap.rbegin()->first; i++)
{
Test.push_back(myMap[i]);
labelPopulation.push_back(labelPopulationMap[i]);
}
auto meanValueMap = labelStatsFilter->GetMeanValueMap();
std::vector<itk::VariableLengthVector<double> > meanValues;
for (int i =0; i <= meanValueMap.rbegin()->first; i++)
{
meanValues.push_back(meanValueMap[i]);
}
//regionMergingFilter->SetLabelPopulation( labelStatsFilter->GetLabelPopulationMap() );
regionMergingFilter->SetLabelPopulation( Test );
regionMergingFilter->SetLabelStatistic( labelStatsFilter->GetMeanValueMap() );
regionMergingFilter->SetLabelPopulation( labelPopulation );
regionMergingFilter->SetLabelStatistic( meanValues );
clock_t tic2 = clock();
for (unsigned int size = 1 ; size < minSize ; size++)
{
......
......@@ -82,7 +82,10 @@ public:
typedef std::map<InputLabelType, std::set<InputLabelType> > NeigboursMapType;
typedef std::map<InputLabelType, RealVectorPixelType > LabelStatisticMapType;
//typedef std::map<InputLabelType, RealVectorPixelType > LabelStatisticMapType;
typedef std::vector<RealVectorPixelType > LabelStatisticMapType;
//typedef std::map<InputLabelType, InputLabelType> CorrespondanceMapType;
typedef std::vector<double> CorrespondanceMapType;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment