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
NDVITimeSeries
Commits
e94caadd
Commit
e94caadd
authored
Apr 12, 2018
by
remi cresson
Browse files
ENH: remove lsgrm part
parent
1627d23f
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/otbLandscapeStratification.cxx
View file @
e94caadd
...
...
@@ -31,27 +31,24 @@
#include "otbImageList.h"
#include "otbMultiChannelExtractROI.h"
// Vectorization
#include "otbLabelImageToVectorDataFilter.h"
namespace
otb
{
namespace
Wrapper
{
class
LandscapeStratification
:
public
CompositeApplication
class
LandscapeStratification
Metric
:
public
CompositeApplication
{
public:
/** Standard class typedefs. */
typedef
LandscapeStratification
Self
;
typedef
LandscapeStratification
Metric
Self
;
typedef
Application
Superclass
;
typedef
itk
::
SmartPointer
<
Self
>
Pointer
;
typedef
itk
::
SmartPointer
<
const
Self
>
ConstPointer
;
/** Standard macro */
itkNewMacro
(
Self
);
itkTypeMacro
(
LandscapeStratification
,
otb
::
Wrapper
::
CompositeApplication
);
itkTypeMacro
(
LandscapeStratification
Metric
,
otb
::
Wrapper
::
CompositeApplication
);
/** Typedefs for image concatenation */
typedef
otb
::
ImageList
<
FloatImageType
>
ImageListType
;
...
...
@@ -62,8 +59,6 @@ public:
typedef
otb
::
MultiChannelExtractROI
<
FloatVectorImageType
::
InternalPixelType
,
FloatVectorImageType
::
InternalPixelType
>
ExtractFilterType
;
/** Typedefs for vector data generation */
typedef
otb
::
LabelImageToVectorDataFilter
<
UInt32ImageType
>
VectorizationFilterType
;
private:
...
...
@@ -71,11 +66,11 @@ private:
void
DoInit
()
{
SetName
(
"LandscapeStratification"
);
SetName
(
"LandscapeStratification
Metric
"
);
SetDescription
(
"Compute a landscape stratification metric"
);
// Documentation
SetDocName
(
"LandscapeStratification"
);
SetDocName
(
"LandscapeStratification
Metric
"
);
SetDocLongDescription
(
"This application implements the method of Bellon et al. (http://dx.doi.org/10.3390/rs9060600)"
);
SetDocLimitations
(
"None"
);
SetDocAuthors
(
"Remi Cresson"
);
...
...
@@ -86,37 +81,26 @@ private:
// Add applications
AddApplication
(
"ImageTimeSeriesGapFilling"
,
"gapfillling"
,
"Image time series gap filling"
);
AddApplication
(
"DimensionalityReduction"
,
"pca"
,
"Principal component analysis"
);
AddApplication
(
"LSGRM"
,
"lsgrm"
,
"Large scale generic region merging"
);
// Fixed parameters
GetInternalApplication
(
"gapfillling"
)
->
SetParameterString
(
"it"
,
"linear"
,
false
);
GetInternalApplication
(
"gapfillling"
)
->
SetParameterInt
(
"comp"
,
1
,
false
);
GetInternalApplication
(
"pca"
)
->
SetParameterString
(
"method"
,
"pca"
,
false
);
GetInternalApplication
(
"lsgrm"
)
->
SetParameterString
(
"criterion"
,
"bs"
,
false
);
GetInternalApplication
(
"lsgrm"
)
->
SetParameterString
(
"tiling"
,
"auto"
,
false
);
// Shared parameters
ShareParameter
(
"mask"
,
"gapfillling.mask"
,
"Mask"
,
"Input time series mask"
);
ShareParameter
(
"id"
,
"gapfillling.id"
,
"DatesFile"
,
"Input time series dates file"
);
ShareParameter
(
"cw"
,
"lsgrm.criterion.bs.cw"
,
"SpectralH"
,
"Weight for the spectral homogeneity"
);
ShareParameter
(
"sw"
,
"lsgrm.criterion.bs.sw"
,
"SpatialH"
,
"Weight for the spatial homogeneity"
);
ShareParameter
(
"th"
,
"lsgrm.threshold"
,
"Threshold"
,
"Segmentation threshold (scale factor)"
);
ShareParameter
(
"tmpdir"
,
"lsgrm.tmpdir"
,
"TempDir"
,
"Temporary directory for segmentation"
);
// Input NDVI time series images
AddParameter
(
ParameterType_InputImageList
,
"ndvits"
,
"Input NDVI time series images"
);
// PCA ranges
AddParameter
(
ParameterType_Int
,
"cbegin"
,
"Component range begin"
);
SetMinimumParameterIntValue
(
"cbegin"
,
1
);
SetDefaultParameterInt
(
"cbegin"
,
2
);
MandatoryOff
(
"cbegin"
);
AddParameter
(
ParameterType_Int
,
"cend"
,
"Component range end"
);
SetMinimumParameterIntValue
(
"cbegin"
,
1
);
SetMinimumParameterIntValue
(
"cend"
,
1
);
SetDefaultParameterInt
(
"cbegin"
,
2
);
MandatoryOff
(
"cbegin"
);
MandatoryOff
(
"cend"
);
SetMinimumParameterIntValue
(
"cend"
,
1
);
MandatoryOff
(
"cend"
);
// Output
vector
AddParameter
(
ParameterType_Output
VectorData
,
"out
vec
"
,
"
O
utput
land units map (vector)
"
);
// Output
image
AddParameter
(
ParameterType_Output
Image
,
"out"
,
"
o
utput
metric image
"
);
// ram
AddRAMParameter
();
...
...
@@ -215,19 +199,7 @@ private:
m_ExtractChannelsFilter
->
SetInput
(
static_cast
<
FloatVectorImageType
*>
(
GetInternalApplication
(
"pca"
)
->
GetParameterOutputImage
(
"out"
)));
// Segmentation
FloatVectorImageType
::
Pointer
extractedPCAChans
=
m_ExtractChannelsFilter
->
GetOutput
();
extractedPCAChans
->
UpdateOutputInformation
();
GetInternalApplication
(
"lsgrm"
)
->
SetParameterInputImage
(
"in"
,
static_cast
<
FloatVectorImageType
*>
(
extractedPCAChans
.
GetPointer
()));
ExecuteInternal
(
"lsgrm"
);
// Vectorization
m_VectorizationFilter
=
VectorizationFilterType
::
New
();
m_VectorizationFilter
->
SetInput
(
static_cast
<
UInt32ImageType
*>
(
GetInternalApplication
(
"lsgrm"
)
->
GetParameterOutputImage
(
"out"
)));
SetParameterOutputVectorData
(
"outvec"
,
m_VectorizationFilter
->
GetOutput
());
SetParameterOutputImage
(
"out"
,
m_ExtractChannelsFilter
->
GetOutput
());
}
// DOExecute()
...
...
@@ -241,9 +213,9 @@ private:
ExtractROIFilterListType
::
Pointer
m_NDVIExtractorList
;
ImageListType
::
Pointer
m_NDVIImageList
;
ExtractFilterType
::
Pointer
m_ExtractChannelsFilter
;
VectorizationFilterType
::
Pointer
m_VectorizationFilter
;
};
}
}
OTB_APPLICATION_EXPORT
(
otb
::
Wrapper
::
LandscapeStratification
)
OTB_APPLICATION_EXPORT
(
otb
::
Wrapper
::
LandscapeStratification
Metric
)
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