Commit 4167eafa authored by Julien Malik's avatar Julien Malik

TEST: change itk::ImageFileReader/Writer to otb::ImageFileReader/Writer

parent 61228813
......@@ -19,6 +19,6 @@ IF(NOT OTB_INSTALL_NO_DEVELOPMENT)
FILE(GLOB __files1 "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
FILE(GLOB __files2 "${CMAKE_CURRENT_SOURCE_DIR}/*.txx")
INSTALL(FILES ${__files1} ${__files2}
DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/OTBObjectDetection
DESTINATION ${OTB_INSTALL_INCLUDE_DIR_CM24}/ObjectDetection
COMPONENT Development)
ENDIF(NOT OTB_INSTALL_NO_DEVELOPMENT)
......@@ -182,7 +182,7 @@ int main(int argc, char * argv[])
rescaler->SetOutputMinimum(0);
rescaler->SetOutputMaximum(255);
typedef itk::ImageFileWriter<WriteImageType> WriterType;
typedef otb::ImageFileWriter<WriteImageType> WriterType;
WriterType::Pointer writer = WriterType::New();
writer->SetFileName(argv[2]);
......
......@@ -84,8 +84,8 @@ int main(int argc, char * argv[])
// We can now instantiate the types of the reader and writer. These two
// classes are parameterized over the image type.
//
// \index{itk::ImageFileReader!Instantiation}
// \index{itk::ImageFileWriter!Instantiation}
// \index{otb::ImageFileReader!Instantiation}
// \index{otb::ImageFileWriter!Instantiation}
//
// Software Guide : EndLatex
......
......@@ -32,12 +32,12 @@
//
// Software Guide : EndLatex
#include "itkImage.h"
#include "otbImage.h"
// Software Guide : BeginCodeSnippet
#include "itkImageLinearConstIteratorWithIndex.h"
// Software Guide : EndCodeSnippet
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
#include "otbImageFileReader.h"
#include "otbImageFileWriter.h"
int main(int argc, char *argv[])
{
......@@ -60,11 +60,11 @@ int main(int argc, char *argv[])
// Software Guide : BeginCodeSnippet
typedef unsigned char PixelType;
typedef itk::Image<PixelType, 3> Image3DType;
typedef itk::Image<PixelType, 4> Image4DType;
typedef otb::Image<PixelType, 3> Image3DType;
typedef otb::Image<PixelType, 4> Image4DType;
typedef itk::ImageFileReader<Image4DType> Reader4DType;
typedef itk::ImageFileWriter<Image3DType> Writer3DType;
typedef otb::ImageFileReader<Image4DType> Reader4DType;
typedef otb::ImageFileWriter<Image3DType> Writer3DType;
Reader4DType::Pointer reader4D = Reader4DType::New();
reader4D->SetFileName(argv[1]);
......
......@@ -98,15 +98,15 @@
//
// Software Guide : EndLatex
#include "itkImage.h"
#include "otbImage.h"
#include "vnl/vnl_math.h"
// Software Guide : BeginCodeSnippet
#include "itkImageSliceConstIteratorWithIndex.h"
#include "itkImageLinearIteratorWithIndex.h"
// Software Guide : EndCodeSnippet
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
#include "otbImageFileReader.h"
#include "otbImageFileWriter.h"
int main(int argc, char *argv[])
{
......@@ -131,8 +131,8 @@ int main(int argc, char *argv[])
// Software Guide : BeginCodeSnippet
typedef unsigned short PixelType;
typedef itk::Image<PixelType, 2> ImageType2D;
typedef itk::Image<PixelType, 3> ImageType3D;
typedef otb::Image<PixelType, 2> ImageType2D;
typedef otb::Image<PixelType, 3> ImageType3D;
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
......@@ -146,8 +146,8 @@ int main(int argc, char *argv[])
typedef itk::ImageSliceConstIteratorWithIndex<ImageType3D> SliceIteratorType;
// Software Guide : EndCodeSnippet
typedef itk::ImageFileReader<ImageType3D> ReaderType;
typedef itk::ImageFileWriter<ImageType2D> WriterType;
typedef otb::ImageFileReader<ImageType3D> ReaderType;
typedef otb::ImageFileWriter<ImageType2D> WriterType;
ImageType3D::ConstPointer inputImage;
ReaderType::Pointer reader = ReaderType::New();
......
......@@ -72,8 +72,8 @@ int main(int argc, char * argv[])
}
typedef float PixelType;
typedef itk::Image<PixelType, 2> ImageType;
typedef itk::ImageFileReader<ImageType> ReaderType;
typedef otb::Image<PixelType, 2> ImageType;
typedef otb::ImageFileReader<ImageType> ReaderType;
typedef itk::ConstNeighborhoodIterator<ImageType> NeighborhoodIteratorType;
typedef itk::ImageRegionIterator<ImageType> IteratorType;
......@@ -187,8 +187,8 @@ int main(int argc, char * argv[])
// Software Guide : EndLatex
typedef unsigned char WritePixelType;
typedef itk::Image<WritePixelType, 2> WriteImageType;
typedef itk::ImageFileWriter<WriteImageType> WriterType;
typedef otb::Image<WritePixelType, 2> WriteImageType;
typedef otb::ImageFileWriter<WriteImageType> WriterType;
typedef itk::RescaleIntensityImageFilter<ImageType,
WriteImageType> RescaleFilterType;
......
......@@ -76,7 +76,7 @@ int main(int argc, char * argv[])
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
typedef itk::ImageFileReader<ImageType> ReaderType;
typedef otb::ImageFileReader<ImageType> ReaderType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(argv[1]);
// Software Guide : EndCodeSnippet
......@@ -127,7 +127,7 @@ int main(int argc, char * argv[])
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
typedef itk::ImageFileWriter<ImageType> WriterType;
typedef otb::ImageFileWriter<ImageType> WriterType;
WriterType::Pointer writer = WriterType::New();
writer->SetInput(l2i->GetOutput());
writer->SetFileName(argv[2]);
......
......@@ -29,8 +29,9 @@
// Software Guide : BeginCodeSnippet
// Software Guide : EndCodeSnippet
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
#include "otbImage.h"
#include "otbImageFileReader.h"
#include "otbImageFileWriter.h"
#include "itkSimpleFilterWatcher.h"
//#include "itkLabelStatisticsKeepNObjectsImageFilter.h"
......@@ -55,16 +56,16 @@ int main(int argc, char * argv[])
const int dim = 3;
typedef unsigned char PixelType;
typedef itk::Image<PixelType, dim> IType;
typedef otb::Image<PixelType, dim> IType;
typedef itk::ImageFileReader<IType> ReaderType;
typedef otb::ImageFileReader<IType> ReaderType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(argv[1]);
ReaderType::Pointer reader2 = ReaderType::New();
reader2->SetFileName(argv[2]);
typedef itk::StatisticsLabelObject<PixelType, dim> LabelObjectType;
typedef itk::StatisticsLabelObject<PixelType, dim> LabelObjectType;
typedef itk::LabelMap<LabelObjectType> LabelMapType;
typedef itk::LabelImageToLabelMapFilter<IType, LabelMapType> LabelizerType;
......@@ -107,7 +108,7 @@ int main(int argc, char * argv[])
opening->SetAttribute( argv[7] );
itk::SimpleFilterWatcher watcher(opening, "filter");
*/
typedef itk::ImageFileWriter<IType> WriterType;
typedef otb::ImageFileWriter<IType> WriterType;
WriterType::Pointer writer = WriterType::New();
writer->SetInput(binarizer->GetOutput());
writer->SetFileName(argv[3]);
......
......@@ -74,7 +74,7 @@ int main(int argc, char * argv[])
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
typedef itk::ImageFileReader<ImageType> ReaderType;
typedef otb::ImageFileReader<ImageType> ReaderType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName(argv[1]);
// Software Guide : EndCodeSnippet
......
......@@ -55,7 +55,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "itkImageSeriesReader.h"
#include "itkNumericSeriesFileNames.h"
#include "itkPointSetToImageFilter.h"
#include "itkImageFileWriter.h"
#include "otbImageFileWriter.h"
int main(int argc, char *argv[])
{
......@@ -90,11 +90,11 @@ int main(int argc, char *argv[])
typedef float
PixelType;
typedef itk::Image<PixelType,
typedef otb::Image<PixelType,
Dimension> FixedImageType;
typedef itk::ScaleInvariantFeatureImageFilter<FixedImageType,
Dimension> SiftFilterType;
typedef itk::Image<unsigned char,
typedef otb::Image<unsigned char,
Dimension> OutputImageType;
typedef itk::ImageSource<FixedImageType> ImageSourceType;
......@@ -112,7 +112,7 @@ int main(int argc, char *argv[])
std::cerr << "ImageFile1 = " << inputImage1 << "\n";
std::cerr << "SIFT Feature\n" << std::endl;
typedef itk::ImageFileReader<FixedImageType> FixedImageReaderType;
typedef otb::ImageFileReader<FixedImageType> FixedImageReaderType;
FixedImageReaderType::Pointer tmpImageReader = FixedImageReaderType::New();
tmpImageReader = FixedImageReaderType::New();
......@@ -159,7 +159,7 @@ int main(int argc, char *argv[])
pointSet1->SetSize(fixedImage->GetLargestPossibleRegion().GetSize());
pointSet1->Update();
typedef itk::ImageFileWriter<OutputImageType> WriterType;
typedef otb::ImageFileWriter<OutputImageType> WriterType;
WriterType::Pointer writer = WriterType::New();
writer->SetFileName(outputImageKeys1);
......
......@@ -530,7 +530,7 @@ int main(int argc, char *argv[])
resample->SetOutputSpacing(fixedImage->GetSpacing());
resample->SetDefaultPixelValue(100);
typedef itk::ImageFileWriter<FixedImageType> WriterFixedType;
typedef otb::ImageFileWriter<FixedImageType> WriterFixedType;
WriterFixedType::Pointer writer = WriterFixedType::New();
......@@ -579,7 +579,7 @@ int main(int argc, char *argv[])
intensityRescaler->SetInput(difference->GetOutput());
typedef itk::ImageFileWriter<OutputImageType> WriterType;
typedef otb::ImageFileWriter<OutputImageType> WriterType;
WriterType::Pointer writer2 = WriterType::New();
......
......@@ -632,7 +632,7 @@ int main(int argc, char *argv[])
// with a viewer to help determine an appropriate threshold to be used on
// the output of the \code{fastmarching} filter.
//
typedef itk::ImageFileWriter<InternalImageType> InternalWriterType;
typedef otb::ImageFileWriter<InternalImageType> InternalWriterType;
InternalWriterType::Pointer mapWriter = InternalWriterType::New();
mapWriter->SetInput(fastMarching->GetOutput());
......
......@@ -21,8 +21,7 @@
#endif
#include "itkExceptionObject.h"
#include "itkImage.h"
#include "itkImageFileWriter.h"
#include "otbImage.h"
#include "itkPolyLineParametricPath.h"
#include "otbImageFileReader.h"
......@@ -38,14 +37,14 @@ int otbDrawPathDessinCarre(int argc, char * argv[])
typedef unsigned char OutputPixelType;
const unsigned int Dimension = 2;
typedef itk::Image<InputPixelType, Dimension> InputImageType;
typedef itk::Image<OutputPixelType, Dimension> OutputImageType;
typedef otb::Image<InputPixelType, Dimension> InputImageType;
typedef otb::Image<OutputPixelType, Dimension> OutputImageType;
typedef InputImageType::PointType InputImagePointType;
typedef itk::PolyLineParametricPath<Dimension> PathType;
typedef otb::ImageFileReader<InputImageType> ReaderType;
typedef itk::ImageFileWriter<OutputImageType> WriterType;
typedef otb::ImageFileWriter<OutputImageType> WriterType;
typedef otb::DrawPathFilter<InputImageType, PathType, OutputImageType> DrawPathFilterType;
......
......@@ -21,8 +21,7 @@
#endif
#include "itkExceptionObject.h"
#include "itkImage.h"
#include "itkImageFileWriter.h"
#include "otbImage.h"
#include "itkPolyLineParametricPath.h"
#include "otbImageFileReader.h"
......@@ -40,14 +39,14 @@ int otbDrawPathAlign(int argc, char * argv[])
typedef unsigned char OutputPixelType;
const unsigned int Dimension = 2;
typedef itk::Image<InputPixelType, Dimension> InputImageType;
typedef itk::Image<OutputPixelType, Dimension> OutputImageType;
typedef otb::Image<InputPixelType, Dimension> InputImageType;
typedef otb::Image<OutputPixelType, Dimension> OutputImageType;
typedef itk::PolyLineParametricPath<Dimension> PathType;
typedef PathType::Pointer PathPointerType;
typedef otb::ImageFileReader<InputImageType> ReaderType;
typedef itk::ImageFileWriter<OutputImageType> WriterType;
typedef otb::ImageFileWriter<OutputImageType> WriterType;
typedef otb::ImageToPathListAlignFilter<InputImageType, PathType> PathListType;
typedef PathListType::OutputPathListType OutputPathListType;
......
......@@ -29,6 +29,5 @@ void RegisterTests()
REGISTER_TEST(otbImageFileReaderTest);
REGISTER_TEST(otbImageFileReaderRGBTest);
REGISTER_TEST(otbImageFileWriterTest);
REGISTER_TEST(otbImageFileReaderRGBTest);
REGISTER_TEST(otbImageFileWriterRGBTest);
}
......@@ -18,8 +18,8 @@
#pragma warning ( disable : 4786 )
#endif
#include "itkImage.h"
#include "itkImageFileReader.h"
#include "otbImage.h"
#include "otbImageFileReader.h"
#include "itkScalarImageToGreyLevelRunLengthMatrixGenerator.h"
#include "itkGreyLevelRunLengthMatrixTextureCoefficientsCalculator.h"
......@@ -35,9 +35,9 @@ int ijGreyLevelRunLengthMatrixTextureCoefficientsCalculatorTest( int argc, char*
const unsigned int ImageDimension = 2;
typedef float RealType;
typedef itk::Image<PixelType, ImageDimension> ImageType;
typedef otb::Image<PixelType, ImageDimension> ImageType;
typedef itk::ImageFileReader<ImageType> ReaderType;
typedef otb::ImageFileReader<ImageType> ReaderType;
ReaderType::Pointer imageReader = ReaderType::New();
imageReader->SetFileName( argv[1] );
imageReader->Update();
......
#include "itkImageFileReader.h"
#include "otbImage.h"
#include "otbImageFileReader.h"
#include "itkShapeLabelObject.h"
#include "itkLabelMap.h"
#include "itkLabelImageToStatisticsLabelMapFilter.h"
......@@ -14,7 +15,7 @@ int ijObjectLabelAttributeValuesTest(int argc, char * argv[])
{
const int dim = 3;
typedef unsigned char PixelType;
typedef itk::Image< PixelType, dim > ImageType;
typedef otb::Image< PixelType, dim > ImageType;
if( argc != 3)
{
......@@ -23,7 +24,7 @@ int ijObjectLabelAttributeValuesTest(int argc, char * argv[])
exit(1);
}
typedef itk::ImageFileReader< ImageType > ReaderType;
typedef otb::ImageFileReader< ImageType > ReaderType;
ReaderType::Pointer reader1 = ReaderType::New();
reader1->SetFileName( argv[1] );
......
......@@ -39,7 +39,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "itkImageSeriesReader.h"
#include "itkNumericSeriesFileNames.h"
#include "itkPointSetToImageFilter.h"
#include "itkImageFileWriter.h"
#include "otbImage.h"
#include "otbImageFileReader.h"
#include "otbImageFileWriter.h"
#include "otbMath.h"
int itk2DScaleInvariantFeatureImageFilterTest( int argc, char *argv[])
......@@ -66,9 +68,9 @@ int itk2DScaleInvariantFeatureImageFilterTest( int argc, char *argv[])
int mode = 's';
typedef float PixelType;
typedef itk::Image<PixelType, Dimension> FixedImageType;
typedef otb::Image<PixelType, Dimension> FixedImageType;
typedef itk::ScaleInvariantFeatureImageFilter<FixedImageType, Dimension> SiftFilterType;
typedef itk::Image<unsigned char, Dimension> OutputImageType;
typedef otb::Image<unsigned char, Dimension> OutputImageType;
typedef itk::ImageSource<FixedImageType> ImageSourceType;
......@@ -84,7 +86,7 @@ int itk2DScaleInvariantFeatureImageFilterTest( int argc, char *argv[])
std::cerr << "ImageFile1 = " << inputImage1 << "\n";
std::cerr << "SIFT Feature\n" << std::endl;
typedef itk::ImageFileReader< FixedImageType > FixedImageReaderType;
typedef otb::ImageFileReader< FixedImageType > FixedImageReaderType;
FixedImageReaderType::Pointer tmpImageReader = FixedImageReaderType::New();
tmpImageReader = FixedImageReaderType::New();
......@@ -130,7 +132,7 @@ int itk2DScaleInvariantFeatureImageFilterTest( int argc, char *argv[])
pointSet1->SetSize(fixedImage->GetLargestPossibleRegion().GetSize());
pointSet1->Update();
typedef itk::ImageFileWriter<OutputImageType> WriterType;
typedef otb::ImageFileWriter<OutputImageType> WriterType;
WriterType::Pointer writer = WriterType::New();
writer->SetFileName(outputImageKeys1);
......
......@@ -75,10 +75,9 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "itkLinearInterpolateImageFunction.h"
#include "itkNearestNeighborInterpolateImageFunction.h"
#include "itkImage.h"
#include "otbImage.h"
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
#include "otbImageFileWriter.h"
#include "itkAffineTransform.h"
#include "itkIdentityTransform.h"
......
......@@ -674,7 +674,7 @@ namespace itk
if (VDimension != 2) return;
typedef itk::Image< unsigned char, VDimension > OutImageType;
typedef typename itk::ImageFileWriter< OutImageType > FixedWriterType;
typedef typename otb::ImageFileWriter< OutImageType > FixedWriterType;
typedef itk::ResampleImageFilter< TFixedImageType, OutImageType >
OutResampleFilterType;
......
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