Commit d8b9cce5 authored by Jonathan Guinet's avatar Jonathan Guinet

ENH: deprecated class and associated tests have been removed from library.

parent 4d6c87da
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __otbQuickLookImageGenerator_h
#define __otbQuickLookImageGenerator_h
// This class is deprecated. Use StreamingShrinkImageFilter instead
#include "vcl_deprecated_header.h"
#include "otbMacro.h"
#include "otbStreamingShrinkImageFilter.h"
namespace otb
{
/** \class QuickLookImageGenerator
* \brief <b>DEPRECATED:</b> Use StreamingShrinkImageFilter instead
*
* \deprecated Use StreamingShrinkImageFilter instead
*
*/
template <class TInputImage, class TOutputImage>
class ITK_EXPORT QuickLookImageGenerator :
public otb::StreamingShrinkImageFilter<TInputImage, TOutputImage>
{
public:
/** Standard class typedefs. */
typedef QuickLookImageGenerator Self;
typedef TInputImage InputImageType;
typedef TOutputImage OutputImageType;
typedef typename otb::StreamingShrinkImageFilter<TInputImage, TOutputImage> Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
void SetVariance(double var)
{
itkWarningMacro(<< "DEPRECATED function")
}
double GetVariance()
{
itkWarningMacro(<< "DEPRECATED function")
return 0;
}
void UseImageSpacing(bool boo)
{
itkWarningMacro(<< "DEPRECATED function")
}
bool GetUseImageSpacing()
{
itkWarningMacro(<< "DEPRECATED function")
return true;
}
void SetMaximumKernelWidth(unsigned int width)
{
itkWarningMacro(<< "DEPRECATED function")
}
unsigned int GetMaximumKernelWidth()
{
itkWarningMacro(<< "DEPRECATED function")
return 0;
}
void SetMaximumError(double error)
{
itkWarningMacro(<< "DEPRECATED function")
}
double GetMaximumError()
{
itkWarningMacro(<< "DEPRECATED function")
return 0;
}
void SetSampleRatio(unsigned int sr)
{
this->SetShrinkFactor(sr);
}
unsigned int GetSampleRatio(unsigned int sr)
{
return this->GetShrinkFactor(sr);
}
protected:
QuickLookImageGenerator() {}
virtual ~QuickLookImageGenerator(){}
private:
QuickLookImageGenerator(const Self &); //purposely not implemented
void operator =(const Self&); //purposely not implemented
};
} // End namespace otb
#endif
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __otbGeometricMomentImageFunction_h
#define __otbGeometricMomentImageFunction_h
#include "vcl_deprecated_header.h"
#include "itkImageFunction.h"
namespace otb
{
/**
* \class GeometricMomentImageFunction
* \brief Virtual class for the Geometric moments for an image function
*
* For backward compatibility only
*
*
* \ingroup ImageFunctions
*/
template <class TInput,
class TOutput = float,
class TPrecision = double,
class TCoordRep = float>
class ITK_EXPORT GeometricMomentImageFunction :
public itk::ImageFunction<TInput, TOutput, TCoordRep>
{
public:
/** Standard class typedefs. */
typedef GeometricMomentImageFunction Self;
typedef itk::ImageFunction<TInput, TOutput, TCoordRep> Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Run-time type information (and related methods). */
itkTypeMacro(GeometricMomentImageFunction, itk::ImageFunction);
/** InputImageType typedef support. */
typedef typename Superclass::InputType InputType;
typedef typename Superclass::IndexType IndexType;
typedef typename Superclass::ContinuousIndexType ContinuousIndexType;
typedef typename Superclass::PointType PointType;
typedef TOutput OutputType;
/** Type for calculation precision */
typedef TPrecision PrecisionType;
/** Get/Set the radius of the neighborhood over which the
statistics are evaluated */
itkSetMacro(NeighborhoodRadius, int);
itkGetConstReferenceMacro(NeighborhoodRadius, int);
protected:
GeometricMomentImageFunction()
{
m_NeighborhoodRadius = -1;
};
~GeometricMomentImageFunction() {}
void PrintSelf(std::ostream& os, itk::Indent indent) const
{
Superclass::PrintSelf(os, indent);
os << indent << " m_NeighborhoodRadius: " << m_NeighborhoodRadius << std::endl;
}
private:
GeometricMomentImageFunction(const Self &); //purposely not implemented
void operator =(const Self&); //purposely not implemented
int m_NeighborhoodRadius;
};
} // namespace otb
#endif
......@@ -747,24 +747,7 @@ ADD_TEST(coTvRemoteSensingRegion ${COMMON_TESTS7}
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ otbCommonTests8 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ------------- otb::QuickLookImageGenerator ----------------------------
ADD_TEST(coTuQuickLookImageGeneratorNew ${COMMON_TESTS8}
otbQuickLookImageGeneratorNew
)
ADD_TEST(coTvQuickLookImageGenerator ${COMMON_TESTS8}
--compare-image ${EPSILON_9}
${BASELINE}/coQuickLookImageGenerator.tif
${TEMP}/coQuickLookImageGenerator.tif
otbQuickLookImageGenerator
${INPUTDATA}/qb_RoadExtract.img.hdr
${TEMP}/coQuickLookImageGenerator.tif
10 # sr
2 # variance
0.5 # max error
4 # max kernel width
1 # usespacing
)
# ------------- otb::ImageRegionTileMapSplitter ----------------------------
ADD_TEST(coTuImageRegionTileMapSplitterNew ${COMMON_TESTS8}
......@@ -1361,8 +1344,6 @@ otbRemoteSensingRegion.cxx
SET(BasicCommon_SRCS8
otbCommonTests8.cxx
otbQuickLookImageGeneratorNew.cxx
otbQuickLookImageGenerator.cxx
otbImageRegionTileMapSplitterNew.cxx
otbImageRegionTileMapSplitter.cxx
otbImageRegionSquareTileSplitter.cxx
......
......@@ -24,8 +24,6 @@
void RegisterTests()
{
REGISTER_TEST(otbQuickLookImageGeneratorNew);
REGISTER_TEST(otbQuickLookImageGenerator);
REGISTER_TEST(otbImageRegionTileMapSplitterNew);
REGISTER_TEST(otbImageRegionTileMapSplitter);
REGISTER_TEST(otbImageRegionSquareTileSplitterNew);
......
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "itkMacro.h"
#include "otbQuickLookImageGenerator.h"
#include "otbVectorImage.h"
#include "otbImageFileReader.h"
#include "otbImageFileWriter.h"
int otbQuickLookImageGenerator(int argc, char* argv[])
{
const char * inputFileName = argv[1];
const char * outputFileName = argv[2];
typedef otb::VectorImage<double, 2> ImageType;
typedef otb::ImageFileReader<ImageType> ReaderType;
typedef otb::ImageFileWriter<ImageType> WriterType;
typedef otb::QuickLookImageGenerator<ImageType, ImageType> FilterType;
FilterType::Pointer filter = FilterType::New();
ReaderType::Pointer reader = ReaderType::New();
WriterType::Pointer writer = WriterType::New();
reader->SetFileName(inputFileName);
filter->SetInput(reader->GetOutput());
filter->SetSampleRatio(atoi(argv[3]));
filter->SetVariance(atof(argv[4]));
filter->SetMaximumError(atof(argv[5]));
filter->SetMaximumKernelWidth(atoi(argv[6]));
filter->UseImageSpacing(atoi(argv[7]));
filter->Update();
writer->SetInput(filter->GetOutput());
writer->SetFileName(outputFileName);
writer->Update();
return EXIT_SUCCESS;
}
/*=========================================================================
Program: ORFEO Toolbox
Language: C++
Date: $Date$
Version: $Revision$
Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
See OTBCopyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#include "itkMacro.h"
#include "otbQuickLookImageGenerator.h"
#include "otbVectorImage.h"
int otbQuickLookImageGeneratorNew(int argc, char* argv[])
{
typedef otb::VectorImage<double, 2> ImageType;
typedef otb::QuickLookImageGenerator<ImageType, ImageType> FilterType;
FilterType::Pointer filter = FilterType::New();
std::cout << filter << std::endl;
return EXIT_SUCCESS;
}
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