Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Cresson Remi
LSGRM
Commits
f1892f1d
Commit
f1892f1d
authored
Aug 31, 2016
by
remicres
Browse files
ENH: fallback to tiling=none when layout size is 1
parent
e0f8c814
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/lsgrmController.h
View file @
f1892f1d
...
...
@@ -35,6 +35,8 @@ public:
Controller
();
~
Controller
();
void
Modified
();
void
RunSegmentation
();
void
SetSpecificParameters
(
const
SegmentationParameterType
&
params
);
...
...
@@ -42,9 +44,9 @@ public:
void
SetInternalMemoryAvailable
(
long
long
unsigned
int
v
);
// expecting a value in Mbytes.
/* Accessors */
void
SetTilingModeNone
(){
m_TilingMode
=
LSGRM_TILING_NONE
;};
void
SetTilingModeUser
(){
m_TilingMode
=
LSGRM_TILING_USER
;};
void
SetTilingModeAuto
(){
m_TilingMode
=
LSGRM_TILING_AUTO
;};
void
SetTilingModeNone
(){
m_TilingMode
=
LSGRM_TILING_NONE
;
Modified
();
};
void
SetTilingModeUser
(){
m_TilingMode
=
LSGRM_TILING_USER
;
Modified
();
};
void
SetTilingModeAuto
(){
m_TilingMode
=
LSGRM_TILING_AUTO
;
Modified
();
};
typename
LabelImageType
::
Pointer
GetLabeledClusteredOutput
();
std
::
vector
<
std
::
string
>
GetTemporaryFilesList
();
...
...
include/lsgrmController.txx
View file @
f1892f1d
...
...
@@ -23,6 +23,13 @@ Controller<TSegmenter>::~Controller()
{
}
template<class TSegmenter>
void Controller<TSegmenter>::Modified()
{
Superclass::Modified();
m_Tiles.clear();
}
template<class TSegmenter>
void Controller<TSegmenter>::RunSegmentation()
{
...
...
@@ -53,7 +60,12 @@ void Controller<TSegmenter>::RunSegmentation()
m_NbTilesX, m_NbTilesY, m_TemporaryFilesPrefix);
// If there is only one tile, then fallback to LSGRM_TILING_NONE case
m_TilingMode = LSGRM_TILING_NONE;
if (m_Tiles.size() == 1)
{
std::cout << "Only one tile is needed. Fallback to tiling=none." << std::endl;
SetTilingModeNone();
}
}
if (m_TilingMode == LSGRM_TILING_AUTO || m_TilingMode == LSGRM_TILING_USER)
...
...
@@ -163,6 +175,9 @@ void Controller<TSegmenter>::RunSegmentation()
}
else if (m_TilingMode == LSGRM_TILING_NONE)// tiling_mode is none
{
// Update input image
m_InputImage->Update();
// Use classic grm
TSegmenter segmenter;
segmenter.SetParam(m_SpecificParameters);
...
...
@@ -171,6 +186,9 @@ void Controller<TSegmenter>::RunSegmentation()
segmenter.SetNumberOfIterations(m_NumberOfIterations);
segmenter.SetInput(m_InputImage);
segmenter.Update();
// Get label image
m_LabelImage = segmenter.GetLabeledClusteredOutput();
}
else
{
...
...
@@ -181,6 +199,7 @@ void Controller<TSegmenter>::RunSegmentation()
/*
* Compute the memory occupied by one node
* TODO: compute the exact value
*/
template<class TSegmenter>
unsigned int Controller<TSegmenter>::GetNodeMemory()
...
...
@@ -228,8 +247,7 @@ long unsigned int Controller<TSegmenter>::GetMaximumNumberOfNodesInMemory()
}
template<class TSegmenter>
void
Controller<TSegmenter>::ComputeMaximumStabilityMargin(unsigned int width,
void Controller<TSegmenter>::ComputeMaximumStabilityMargin(unsigned int width,
unsigned int height, unsigned int &niter, unsigned int &margin)
{
itkDebugMacro(<< "Computing maximum stability margin");
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment