Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Main Repositories
otb
Commits
aa09070f
Commit
aa09070f
authored
May 06, 2011
by
Julien Malik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ENH: replace direct use of MemoryPrintEstimator by integrated functionnality in StreamingFileWriter
parent
cce11710
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
23 deletions
+4
-23
Classification/otbImageSVMClassifier.cxx
Classification/otbImageSVMClassifier.cxx
+4
-23
No files found.
Classification/otbImageSVMClassifier.cxx
View file @
aa09070f
...
...
@@ -26,7 +26,6 @@
#include "otbImageFileReader.h"
#include "otbStreamingImageFileWriter.h"
#include "otbChangeLabelImageFilter.h"
#include "otbPipelineMemoryPrintCalculator.h"
#include "otbStandardWriterWatcher.h"
// itk
...
...
@@ -158,35 +157,17 @@ int ImageSVMClassifier::Execute(otb::ApplicationOptionsResult* parseResult)
//--------------------------
// Save labeled Image
WriterType
::
Pointer
writer
=
WriterType
::
New
();
writer
->
SetInput
(
classificationFilter
->
GetOutput
());
writer
->
SetFileName
(
parseResult
->
GetParameterString
(
"OutputLabeledImage"
));
//Instantiate the pipeline memory print estimator
MemoryCalculatorType
::
Pointer
calculator
=
MemoryCalculatorType
::
New
();
const
double
byteToMegabyte
=
1.
/
vcl_pow
(
2.0
,
20
);
unsigned
int
ram
=
256
;
if
(
parseResult
->
IsOptionPresent
(
"AvailableMemory"
))
{
long
long
int
memory
=
static_cast
<
long
long
int
>
(
parseResult
->
GetParameterUInt
(
"AvailableMemory"
));
calculator
->
SetAvailableMemory
(
memory
/
byteToMegabyte
);
ram
=
parseResult
->
GetParameterUInt
(
"AvailableMemory"
);
}
else
{
calculator
->
SetAvailableMemory
(
256
*
byteToMegabyte
);
}
calculator
->
SetDataToWrite
(
classificationFilter
->
GetOutput
());
calculator
->
Compute
();
writer
->
SetTilingStreamDivisions
(
calculator
->
GetOptimalNumberOfStreamDivisions
());
writer
->
SetInput
(
classificationFilter
->
GetOutput
());
writer
->
SetAutomaticTiledStreaming
(
ram
);
otb
::
StandardWriterWatcher
watcher
(
writer
,
"Classification"
);
writer
->
Update
();
std
::
cout
<<
"Classification done ... "
<<
std
::
endl
;
return
EXIT_SUCCESS
;
}
...
...
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