Commit 619d9964 authored by remicres's avatar remicres

ENH: Improve automatic tiling algo

parent 135fc8bd
......@@ -15,9 +15,9 @@ public:
/** Standard class typedef */
typedef Controller Self;
typedef itk::LightObject Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Runtime information support. */
itkTypeMacro(Controller, itk::Object);
......@@ -25,14 +25,6 @@ public:
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Enum for tiling mode */
enum LSGRMTilingMode
{
LSGRM_TILING_NONE,
LSGRM_TILING_USER,
LSGRM_TILING_AUTO
};
/* Some convenient typedefs */
using SegmenterType = TSegmenter;
using ImageType = typename SegmenterType::ImageType;
......@@ -88,7 +80,16 @@ public:
private:
/** Enum for tiling mode */
enum LSGRMTilingMode
{
LSGRM_TILING_NONE, // No tiling
LSGRM_TILING_USER, // User tiling
LSGRM_TILING_AUTO // Automatic tiling
};
void GetAutomaticConfiguration();
void ComputeMaximumStabilityMargin(unsigned int width, unsigned int height, unsigned int &iter, unsigned int &margin);
long unsigned int GetMaximumNumberOfNodesInMemory();
/* Parameters given by the user */
......@@ -104,19 +105,19 @@ private:
/* Parameters given by the user or computed automatically
* depending of the chosen mode
*/
long long unsigned int m_Memory; // RAM available for the computation.
unsigned int m_NbTilesX;
unsigned int m_NbTilesY;
unsigned int m_NumberOfFirstIterations;
unsigned int m_TileWidth;
unsigned int m_TileHeight;
long long unsigned int m_Memory; // RAM available for the computation.
unsigned int m_NbTilesX; // number of tiles in x dimension
unsigned int m_NbTilesY; // number of tiles in y dimension
unsigned int m_NumberOfFirstIterations; // number of iterations in the first step
unsigned int m_TileWidth; // regular tile width (i.e. not left tiles)
unsigned int m_TileHeight; // regular tile height (i.e. not bottom tiles)
/* read-only variables */
unsigned int m_Margin;
std::vector<ProcessingTile> m_Tiles;
std::vector<std::string> m_TemporaryFilesList;
LSGRMTilingMode m_TilingMode;
typename LabelImageType::Pointer m_LabelImage;
LSGRMTilingMode m_TilingMode; // tiling mode (none/user/auto)
unsigned int m_Margin; // stability margin related to m_NumberOfFirstIterations
std::vector<ProcessingTile> m_Tiles; // list of tiles
std::vector<std::string> m_TemporaryFilesList; // list of temporary files
typename LabelImageType::Pointer m_LabelImage; // output label image
};
} // end of namespace lsgrm
......
This diff is collapsed.
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