Commit de0bdbff authored by Luc Hermitte's avatar Luc Hermitte
Browse files

REFACT: Rename ClampROI into ResetMargin

parent ae7c29b0
Pipeline #5711 passed with stages
in 136 minutes and 30 seconds
...@@ -94,8 +94,8 @@ OTB_CREATE_APPLICATION( ...@@ -94,8 +94,8 @@ OTB_CREATE_APPLICATION(
LINK_LIBRARIES ${${otb-module}_LIBRARIES}) LINK_LIBRARIES ${${otb-module}_LIBRARIES})
OTB_CREATE_APPLICATION( OTB_CREATE_APPLICATION(
NAME ClampROI NAME ResetMargin
SOURCES otbClampROI.cxx SOURCES otbResetMargin.cxx
LINK_LIBRARIES ${${otb-module}_LIBRARIES}) LINK_LIBRARIES ${${otb-module}_LIBRARIES})
OTB_CREATE_APPLICATION( OTB_CREATE_APPLICATION(
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
* limitations under the License. * limitations under the License.
*/ */
#include "otbClampROIFilter.h" #include "otbResetMarginFilter.h"
#include "otbWrapperApplication.h" #include "otbWrapperApplication.h"
#include "otbWrapperApplicationFactory.h" #include "otbWrapperApplicationFactory.h"
...@@ -39,21 +39,21 @@ namespace Wrapper ...@@ -39,21 +39,21 @@ namespace Wrapper
* \author Luc Hermitte (CS Group) * \author Luc Hermitte (CS Group)
* \copyright CNES * \copyright CNES
*/ */
class ClampROI : public Application class ResetMargin : public Application
{ {
public: public:
using Self = ClampROI; using Self = ResetMargin;
using Pointer = itk::SmartPointer<Self>; using Pointer = itk::SmartPointer<Self>;
itkNewMacro(Self); itkNewMacro(Self);
itkTypeMacro(ClampROI, otb::Wrapper::Application); itkTypeMacro(ResetMargin, otb::Wrapper::Application);
private: private:
void DoInit() override void DoInit() override
{ {
SetName("ClampROI"); SetName("ResetMargin");
SetDescription("This is the ClampROI application"); SetDescription("This is the ResetMargin application");
SetDocLongDescription( SetDocLongDescription(
"This application is similar to ExtractROI in the sense it extracts a Region of Interrest.\n" "This application is similar to ExtractROI in the sense it extracts a Region of Interrest.\n"
"However, the region outside of the ROI isn't trimmed, but set to 0.\n" "However, the region outside of the ROI isn't trimmed, but set to 0.\n"
...@@ -94,11 +94,11 @@ private: ...@@ -94,11 +94,11 @@ private:
AddRAMParameter(); AddRAMParameter();
SetDocExampleParameterValue("in", "ClampROIInput100x100.tiff"); SetDocExampleParameterValue("in", "ResetMarginInput100x100.tiff");
SetDocExampleParameterValue("threshold.x", "10"); SetDocExampleParameterValue("threshold.x", "10");
SetDocExampleParameterValue("threshold.y.start", "12"); SetDocExampleParameterValue("threshold.y.start", "12");
SetDocExampleParameterValue("threshold.y.end", "25"); SetDocExampleParameterValue("threshold.y.end", "25");
SetDocExampleParameterValue("out", "ClampROI.tiff"); SetDocExampleParameterValue("out", "ResetMargin.tiff");
SetOfficialDocLink(); SetOfficialDocLink();
} }
...@@ -117,9 +117,9 @@ private: ...@@ -117,9 +117,9 @@ private:
if (thrYbot < 0) if (thrYbot < 0)
itkExceptionMacro("The bottom line threshold is expected to be positive"); itkExceptionMacro("The bottom line threshold is expected to be positive");
if (thrX == 0 && thrYtop == 0 && thrYbot == 0) if (thrX == 0 && thrYtop == 0 && thrYbot == 0)
itkExceptionMacro("Don't use ClampROI to clamp nothing!"); itkExceptionMacro("Don't use ResetMargin to clamp nothing!");
auto filter = ClampROIFilter<FloatImageType>::New(); auto filter = ResetMarginFilter<FloatImageType>::New();
assert(thrX >= 0); assert(thrX >= 0);
assert(thrYtop >= 0); assert(thrYtop >= 0);
assert(thrYbot >= 0); assert(thrYbot >= 0);
...@@ -137,4 +137,4 @@ private: ...@@ -137,4 +137,4 @@ private:
} // otb::Wrapper namespace } // otb::Wrapper namespace
} // otb namespace } // otb namespace
OTB_APPLICATION_EXPORT(otb::Wrapper::ClampROI) OTB_APPLICATION_EXPORT(otb::Wrapper::ResetMargin)
...@@ -121,16 +121,16 @@ otb_test_application(NAME apTvUtExtractROIExtentFitVect ...@@ -121,16 +121,16 @@ otb_test_application(NAME apTvUtExtractROIExtentFitVect
${TEMP}/apTvUtExtractROIExtentFitVect.tif) ${TEMP}/apTvUtExtractROIExtentFitVect.tif)
#----------- Clamp ROI tests ---------------- #----------- Clamp ROI tests ----------------
otb_test_application(NAME apTvUtClampROI otb_test_application(NAME apTvUtResetMargin
APP ClampROI APP ResetMargin
OPTIONS -in ${INPUTDATA}/ClampROIInput100x100.tiff OPTIONS -in ${INPUTDATA}/ResetMarginInput100x100.tiff
-out ${TEMP}/apTvUtClampROI.tif -out ${TEMP}/apTvUtResetMargin.tif
-threshold.x 10 -threshold.x 10
-threshold.y.start 12 -threshold.y.start 12
-threshold.y.end 25 -threshold.y.end 25
VALID --compare-image ${NOTOL} VALID --compare-image ${NOTOL}
${OTBAPP_BASELINE}/ClampROIBaseline100x100.tiff ${OTBAPP_BASELINE}/ResetMarginBaseline100x100.tiff
${TEMP}/apTvUtClampROI.tif) ${TEMP}/apTvUtResetMargin.tif)
#----------- Rescale TESTS ---------------- #----------- Rescale TESTS ----------------
otb_test_application(NAME apTvUtRescaleTest otb_test_application(NAME apTvUtRescaleTest
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
* limitations under the License. * limitations under the License.
*/ */
#ifndef otbClampROIFilter_h #ifndef otbResetMarginFilter_h
#define otbClampROIFilter_h #define otbResetMarginFilter_h
#include "itkImageToImageFilter.h" #include "itkImageToImageFilter.h"
...@@ -40,7 +40,7 @@ namespace otb ...@@ -40,7 +40,7 @@ namespace otb
* \copyright CNES * \copyright CNES
*/ */
template <typename TImage> template <typename TImage>
class ClampROIFilter : public itk::ImageToImageFilter<TImage, TImage> class ResetMarginFilter : public itk::ImageToImageFilter<TImage, TImage>
{ {
public: public:
...@@ -57,7 +57,7 @@ public: ...@@ -57,7 +57,7 @@ public:
//@} //@}
/**\name Standard class typedefs */ /**\name Standard class typedefs */
//@{ //@{
using Self = ClampROIFilter; using Self = ResetMarginFilter;
using Superclass = itk::ImageToImageFilter<InputImageType, OutputImageType>; using Superclass = itk::ImageToImageFilter<InputImageType, OutputImageType>;
using Pointer = itk::SmartPointer<Self>; using Pointer = itk::SmartPointer<Self>;
using ConstPointer = itk::SmartPointer<const Self>; using ConstPointer = itk::SmartPointer<const Self>;
...@@ -67,7 +67,7 @@ public: ...@@ -67,7 +67,7 @@ public:
itkNewMacro(Self); itkNewMacro(Self);
/** Run-time type information (and related methods). */ /** Run-time type information (and related methods). */
itkTypeMacro(ClampROIFilter, unused); itkTypeMacro(ResetMarginFilter, unused);
/**\name Image typedef support */ /**\name Image typedef support */
//@{ //@{
...@@ -107,12 +107,12 @@ public: ...@@ -107,12 +107,12 @@ public:
protected: protected:
/// Hidden constructor /// Hidden constructor
ClampROIFilter() = default; ResetMarginFilter() = default;
InputImageType * GetInputImage() { return const_cast<InputImageType*>(this->GetInput()); } InputImageType * GetInputImage() { return const_cast<InputImageType*>(this->GetInput()); }
InputImageType const* GetInputImage() const { return this->GetInput(); } InputImageType const* GetInputImage() const { return this->GetInput(); }
/** otbClampROIFilter doesn't need an input requested region as large as the /** otbResetMarginFilter doesn't need an input requested region as large as the
* output requested region. * output requested region.
* \sa ImageToImageFilter::GenerateInputRequestedRegion() * \sa ImageToImageFilter::GenerateInputRequestedRegion()
*/ */
...@@ -147,7 +147,7 @@ private: ...@@ -147,7 +147,7 @@ private:
} // otb namespace } // otb namespace
#ifndef OTB_MANUAL_INSTANTIATION #ifndef OTB_MANUAL_INSTANTIATION
#include "otbClampROIFilter.hxx" #include "otbResetMarginFilter.hxx"
#endif #endif
#endif // otbClampROIFilter_h #endif // otbResetMarginFilter_h
...@@ -18,10 +18,10 @@ ...@@ -18,10 +18,10 @@
* limitations under the License. * limitations under the License.
*/ */
#ifndef otbClampROIFilter_hxx #ifndef otbResetMarginFilter_hxx
#define otbClampROIFilter_hxx #define otbResetMarginFilter_hxx
#include "otbClampROIFilter.h" #include "otbResetMarginFilter.h"
#include "otbInterval.h" #include "otbInterval.h"
#include "otbMacro.h" #include "otbMacro.h"
#include "otbLogHelpers.h" #include "otbLogHelpers.h"
...@@ -45,7 +45,7 @@ namespace otb ...@@ -45,7 +45,7 @@ namespace otb
template<typename TImage> template<typename TImage>
void void
ClampROIFilter<TImage> ResetMarginFilter<TImage>
::ThreadedGenerateData( ::ThreadedGenerateData(
OutputImageRegionType const& outputRegionForThread, OutputImageRegionType const& outputRegionForThread,
itk::ThreadIdType threadId) itk::ThreadIdType threadId)
...@@ -157,8 +157,8 @@ ClampROIFilter<TImage> ...@@ -157,8 +157,8 @@ ClampROIFilter<TImage>
} }
template<typename TImage> template<typename TImage>
typename ClampROIFilter<TImage>::InputImageRegionType typename ResetMarginFilter<TImage>::InputImageRegionType
ClampROIFilter<TImage> ResetMarginFilter<TImage>
::OutputRegionToInputRegion(OutputImageRegionType const& srcRegion) ::OutputRegionToInputRegion(OutputImageRegionType const& srcRegion)
{ {
auto const* output = this->GetOutput(); auto const* output = this->GetOutput();
...@@ -211,5 +211,5 @@ ClampROIFilter<TImage> ...@@ -211,5 +211,5 @@ ClampROIFilter<TImage>
} // otb namespace } // otb namespace
#endif // otbClampROIFilter_hxx #endif // otbResetMarginFilter_hxx
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