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: ...@@ -168,16 +168,22 @@ private:
regionMergingFilter->SetInputLabelImage( labelIn ); regionMergingFilter->SetInputLabelImage( labelIn );
regionMergingFilter->SetInputSpectralImage( imageIn ); regionMergingFilter->SetInputSpectralImage( imageIn );
auto myMap = labelStatsFilter->GetLabelPopulationMap(); auto labelPopulationMap = labelStatsFilter->GetLabelPopulationMap();
std::vector<double> Test; std::vector<double> labelPopulation;
for (int i =0; i <= myMap.rbegin()->first; i++) 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( labelStatsFilter->GetLabelPopulationMap() );
regionMergingFilter->SetLabelPopulation( Test ); regionMergingFilter->SetLabelPopulation( labelPopulation );
regionMergingFilter->SetLabelStatistic( labelStatsFilter->GetMeanValueMap() ); regionMergingFilter->SetLabelStatistic( meanValues );
clock_t tic2 = clock(); clock_t tic2 = clock();
for (unsigned int size = 1 ; size < minSize ; size++) for (unsigned int size = 1 ; size < minSize ; size++)
{ {
......
...@@ -82,7 +82,10 @@ public: ...@@ -82,7 +82,10 @@ public:
typedef std::map<InputLabelType, std::set<InputLabelType> > NeigboursMapType; 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::map<InputLabelType, InputLabelType> CorrespondanceMapType;
typedef std::vector<double> CorrespondanceMapType; typedef std::vector<double> CorrespondanceMapType;
......
Markdown is supported
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