Skip to content
Snippets Groups Projects
Commit 503991af authored by Cédric Traizet's avatar Cédric Traizet
Browse files

DOC: rename predictRegression to imageRegression, for consistency

parent 825455eb
No related branches found
No related tags found
No related merge requests found
...@@ -71,8 +71,8 @@ otb_create_application( ...@@ -71,8 +71,8 @@ otb_create_application(
LINK_LIBRARIES ${${otb-module}_LIBRARIES}) LINK_LIBRARIES ${${otb-module}_LIBRARIES})
otb_create_application( otb_create_application(
NAME PredictRegression NAME ImageRegression
SOURCES otbPredictRegression.cxx SOURCES otbImageRegression.cxx
LINK_LIBRARIES ${${otb-module}_LIBRARIES}) LINK_LIBRARIES ${${otb-module}_LIBRARIES})
otb_create_application( otb_create_application(
......
...@@ -74,11 +74,11 @@ private: ...@@ -74,11 +74,11 @@ private:
namespace Wrapper namespace Wrapper
{ {
class PredictRegression : public Application class ImageRegression : public Application
{ {
public: public:
/** Standard class typedefs. */ /** Standard class typedefs. */
typedef PredictRegression Self; typedef ImageRegression Self;
typedef Application Superclass; typedef Application Superclass;
typedef itk::SmartPointer<Self> Pointer; typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer; typedef itk::SmartPointer<const Self> ConstPointer;
...@@ -86,7 +86,7 @@ public: ...@@ -86,7 +86,7 @@ public:
/** Standard macro */ /** Standard macro */
itkNewMacro(Self); itkNewMacro(Self);
itkTypeMacro(PredictRegression, otb::Application); itkTypeMacro(ImageRegression, otb::Application);
/** Filters typedef */ /** Filters typedef */
typedef UInt8ImageType MaskImageType; typedef UInt8ImageType MaskImageType;
...@@ -107,7 +107,7 @@ public: ...@@ -107,7 +107,7 @@ public:
protected: protected:
~PredictRegression() override ~ImageRegression() override
{ {
MachineLearningModelFactoryType::CleanFactories(); MachineLearningModelFactoryType::CleanFactories();
} }
...@@ -115,59 +115,57 @@ protected: ...@@ -115,59 +115,57 @@ protected:
private: private:
void DoInit() override void DoInit() override
{ {
SetName("PredictRegression"); SetName("ImageRegression");
SetDescription("Performs a prediction of the input image according to a regression model file."); SetDescription("Performs a prediction of the input image according to a regression model file.");
// Documentation // Documentation
SetDocLongDescription("This application predict output values from an input" SetDocLongDescription("This application predict output values from an input "
" image, based on a regression model file produced by" "image, based on a regression model file produced either by "
" the TrainRegression application. Pixels of the " "TrainVectorRegression or TrainImagesRegression. "
"output image will contain the predicted values from" "Pixels of the output image will contain the predicted values from "
"the regression model (single band). The input pixels" "the regression model (single band). The input pixels "
" can be optionally centered and reduced according " "can be optionally centered and reduced according "
"to the statistics file produced by the " "to the statistics file produced by the "
"ComputeImagesStatistics application. An optional " "ComputeImagesStatistics application. An optional "
"input mask can be provided, in which case only " "input mask can be provided, in which case only "
"input image pixels whose corresponding mask value " "input image pixels whose corresponding mask value "
"is greater than 0 will be processed. The remaining" "is greater than zero will be processed. The remaining "
" of pixels will be given the value 0 in the output" "of pixels will be given the value zero in the output "
" image."); "image.");
SetDocLimitations("The input image must contain the feature bands used for" SetDocLimitations("The input image must contain the feature bands used for "
" the model training (without the predicted value). " "the model training. "
"If a statistics file was used during training by the " "If a statistics file was used during training by the "
"TrainRegression, it is mandatory to use the same " "TrainRegression, it is mandatory to use the same "
"statistics file for prediction. If an input mask is " "statistics file for prediction. If an input mask is "
"used, its size must match the input image size."); "used, its size must match the input image size.");
SetDocAuthors("OTB-Team"); SetDocAuthors("OTB-Team");
SetDocSeeAlso("TrainRegression, ComputeImagesStatistics"); SetDocSeeAlso("TrainImagesRegression, TrainVectorRegression, VectorRegression, ComputeImagesStatistics");
AddDocTag(Tags::Learning); AddDocTag(Tags::Learning);
AddParameter(ParameterType_InputImage, "in", "Input Image"); AddParameter(ParameterType_InputImage, "in", "Input Image");
SetParameterDescription( "in", "The input image to predict."); SetParameterDescription( "in", "The input image to predict.");
// TODO : use CSV input/output ? AddParameter(ParameterType_InputImage, "mask", "Input Mask");
AddParameter(ParameterType_InputImage, "mask", "Input Mask");
SetParameterDescription( "mask", "The mask restrict the " SetParameterDescription( "mask", "The mask restrict the "
"classification of the input image to the area where mask pixel values " "classification of the input image to the area where mask pixel values "
"are greater than 0."); "are greater than zero.");
MandatoryOff("mask"); MandatoryOff("mask");
AddParameter(ParameterType_InputFilename, "model", "Model file"); AddParameter(ParameterType_InputFilename, "model", "Model file");
SetParameterDescription("model", "A regression model file (produced by " SetParameterDescription("model", "A regression model file (produced either by "
"TrainRegression application)."); "TrainVectorRegression application or the TrainImagesRegression application).");
AddParameter(ParameterType_InputFilename, "imstat", "Statistics file"); AddParameter(ParameterType_InputFilename, "imstat", "Statistics file");
SetParameterDescription("imstat", "An XML file containing mean and standard" SetParameterDescription("imstat", "An XML file containing mean and standard"
" deviation to center and reduce samples before prediction " " deviation to center and reduce samples before prediction "
"(produced by ComputeImagesStatistics application). If this file contains" "(produced by the ComputeImagesStatistics application). If this file contains "
"one more band than the sample size, the last stat of the last band will be" "one more band than the sample size, the last stat of the last band will be"
"applied to expand the output predicted value"); "applied to expand the output predicted value.");
MandatoryOff("imstat"); MandatoryOff("imstat");
AddParameter(ParameterType_OutputImage, "out", "Output Image"); AddParameter(ParameterType_OutputImage, "out", "Output Image");
SetParameterDescription( "out", "Output image containing predicted values"); SetParameterDescription( "out", "Output image containing predicted values");
AddRAMParameter(); AddRAMParameter();
...@@ -283,4 +281,4 @@ private: ...@@ -283,4 +281,4 @@ private:
} }
} }
OTB_APPLICATION_EXPORT(otb::Wrapper::PredictRegression) OTB_APPLICATION_EXPORT(otb::Wrapper::ImageRegression)
...@@ -785,16 +785,16 @@ if(OTB_USE_OPENCV) ...@@ -785,16 +785,16 @@ if(OTB_USE_OPENCV)
${OTBAPP_BASELINE_FILES}/apTvClTrainRegressionTest_monovar.txt ${OTBAPP_BASELINE_FILES}/apTvClTrainRegressionTest_monovar.txt
${TEMP}/apTvClTrainRegressionTest_monovar.txt) ${TEMP}/apTvClTrainRegressionTest_monovar.txt)
#----------- PredictRegression TESTS ---------------- #----------- ImageRegression TESTS ----------------
otb_test_application(NAME apTvClPredictRegressionTest_monovar otb_test_application(NAME apTvClImageRegressionTest_monovar
APP PredictRegression APP ImageRegression
OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_PAN.tif OPTIONS -in ${INPUTDATA}/QB_Toulouse_Ortho_PAN.tif
-model ${OTBAPP_BASELINE_FILES}/apTvClTrainRegressionTest_monovar.rf -model ${OTBAPP_BASELINE_FILES}/apTvClTrainRegressionTest_monovar.rf
-imstat ${INPUTDATA}/QB_Toulouse_Ortho_regression.xml -imstat ${INPUTDATA}/QB_Toulouse_Ortho_regression.xml
-out ${TEMP}/apTvClPredictRegressionTest_monovar.tif -out ${TEMP}/apTvClImageRegressionTest_monovar.tif
VALID --compare-image 1 VALID --compare-image 1
${OTBAPP_BASELINE}/apTvClPredictRegressionTest_monovar.tif ${OTBAPP_BASELINE}/apTvClImageRegressionTest_monovar.tif
${TEMP}/apTvClPredictRegressionTest_monovar.tif) ${TEMP}/apTvClImageRegressionTest_monovar.tif)
endif() endif()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment