Commit e211f67c authored by remicres's avatar remicres

FIX: bug in debug messages inside controler

parent 33803912
......@@ -161,11 +161,12 @@ template<class TSegmenter>
unsigned int Controller<TSegmenter>::GetNodeMemory()
{
// Create a unique node
const unsigned int n = 100;
typename ImageType::Pointer onePixelImage = ImageType::New();
typename ImageType::IndexType start;
start.Fill(0);
typename ImageType::SizeType size;
size.Fill(1);
size.Fill(n);
typename ImageType::RegionType region(start, size);
onePixelImage->SetRegions(region);
onePixelImage->SetNumberOfComponentsPerPixel(m_InputImage->GetNumberOfComponentsPerPixel());
......@@ -174,7 +175,9 @@ unsigned int Controller<TSegmenter>::GetNodeMemory()
segmenter.SetInput(onePixelImage);
lsrm::GraphOperations<TSegmenter>::InitNodes(onePixelImage,segmenter,FOUR);
return segmenter.GetGraphMemory();
unsigned int memory = segmenter.GetGraphMemory() / (n*n);
itkWarningMacro(<<"Size of a node is " << memory);
return memory;
}
/*
......@@ -325,11 +328,10 @@ void Controller<TSegmenter>::GetAutomaticConfiguration()
// Compute the stability margin
ComputeMaximumStabilityMargin(m_TileWidth, m_TileHeight,m_NumberOfFirstIterations, m_Margin);
TSegmenter segmenter;
segmenter.SetInput(m_InputImage);
unsigned int nodeMemory = GetNodeMemory();
unsigned int memoryUsed = (m_TileHeight + 2*m_Margin)*(m_TileWidth + 2*m_Margin)*nodeMemory;
itkWarningMacro(<< "An amount of " << (memoryUsed / (1024.0*1024.0)) << " Mbytes of RAM will be used for regular tiles of size "
long long unsigned int memoryUsed = GetNodeMemory();
memoryUsed *= static_cast<long long unsigned int>(m_TileHeight + 2*m_Margin);
memoryUsed *= static_cast<long long unsigned int>(m_TileWidth + 2*m_Margin);
itkWarningMacro(<< "An amount of " << memoryUsed/(1024.0*1024.0) << " Mbytes of RAM will be used for regular tiles of size "
<< (m_TileWidth + 2*m_Margin) << "x" << (m_TileHeight + 2*m_Margin) );
}
......
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