Commit de0bdbff authored by Luc Hermitte's avatar Luc Hermitte

REFACT: Rename ClampROI into ResetMargin

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