From 4904ba529b00e7f8644e1cab19f3c99f86d3e4c0 Mon Sep 17 00:00:00 2001 From: remicres Date: Thu, 1 Sep 2016 17:01:07 +0000 Subject: [PATCH] DOC: Add some TODO (improve memory print estimation) --- include/lsgrmController.txx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/include/lsgrmController.txx b/include/lsgrmController.txx index 33fd537..6683cf9 100644 --- a/include/lsgrmController.txx +++ b/include/lsgrmController.txx @@ -209,7 +209,9 @@ void Controller::RunSegmentation() /* * Compute the memory occupied by one node - * TODO: compute the exact value + * TODO: compute the exact value, e.g. experimental measures shows that + * for one Baatz node (+pixel) memory is about 700-730 bytes... + * And our estimation is of 456! */ template unsigned int Controller::GetNodeMemory() @@ -234,7 +236,17 @@ unsigned int Controller::GetNodeMemory() // Get the memory occupied by the graph, normalize it by n*n unsigned int memory = segmenter.GetGraphMemory() / (n*n); - itkDebugMacro(<<"Size of a node is " << memory); + itkWarningMacro(<<"Size of a node is " << memory); + + // Get the memory occupied by one pixel of the image + unsigned int pixelMemory = sizeof(typename ImageType::PixelType) + + sizeof(typename ImageType::InternalPixelType) * m_InputImage->GetNumberOfComponentsPerPixel(); + + itkWarningMacro(<<"Size of an image pixel is " << pixelMemory); + + memory += pixelMemory; + + itkWarningMacro(<<"Size of a node+pixel is " << memory); return memory; } -- GitLab