<commit_before>/*=========================================================================

 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 "otbWrapperApplication.h"
#include "otbWrapperApplicationFactory.h"

#include "itkTranslationTransform.h"
#include "otbStreamingResampleImageFilter.h"

namespace otb
{
namespace Wrapper
{

class RigidTransformResample : public Application
{
public:
  /** Standard class typedefs. */
  typedef RigidTransformResample        Self;
  typedef Application                   Superclass;
  typedef itk::SmartPointer<Self>       Pointer;
  typedef itk::SmartPointer<const Self> ConstPointer;

  /** Standard macro */
  itkNewMacro(Self);

  itkTypeMacro(RigidTransformResample, otb::Application);

private:

  RigidTransformResample()
  {
    SetName("RigidTransformResample");
    SetDescription("Resample an image with a rigid transform");
    // Documentation
    SetDocName("Image resampling with a rigid transform");
    SetDocLongDescription("This application performs an translation on the input image.\n Parameters of the translation can be set with tx and ty options.");
    SetDocLimitations("None");
    SetDocAuthors("OTB-Team");
    SetDocSeeAlso("Translation application");
    //SetDocCLExample("otbApplicationLauncherCommandLine RigidTransformResample ${OTB-BIN}/bin --in ${OTB-Data}/Input/QB_Toulouse_Ortho_XS.tif --out otbConvertWithScalingOutput.png uchar --type linear");
    AddDocTag("Conversion");
    AddDocTag("Image Projection");
  }

  virtual ~RigidTransformResample()
  {
  }

  void DoCreateParameters()
  {
    AddParameter(ParameterType_InputImage,   "in",   "Input image");
    AddParameter(ParameterType_OutputImage,  "out",  "Output image");
    AddParameter(ParameterType_Float,        "tx",   "The X translation (in physical units)");
    AddParameter(ParameterType_Float,        "ty",   "The Y translation (in physical units)");
  }
  
  void DoUpdateParameters()
  {
    // Nothing to do here : all parameters are independent
  }

  void DoExecute()
  {
    typedef itk::TranslationTransform<double, FloatVectorImageType::ImageDimension> TransformType;
    typedef otb::StreamingResampleImageFilter<FloatVectorImageType, FloatVectorImageType, double>    ResampleFilterType;
    FloatVectorImageType* inputImage = GetParameterImage("in");
    
    TransformType::Pointer transform = TransformType::New();<commit_msg>DOC: add commandLine example on  otbRigidTransformResample application example.<commit_after>/*=========================================================================

 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 "otbWrapperApplication.h"
#include "otbWrapperApplicationFactory.h"

#include "itkTranslationTransform.h"
#include "otbStreamingResampleImageFilter.h"

namespace otb
{
namespace Wrapper
{

class RigidTransformResample : public Application
{
public:
  /** Standard class typedefs. */
  typedef RigidTransformResample        Self;
  typedef Application                   Superclass;
  typedef itk::SmartPointer<Self>       Pointer;
  typedef itk::SmartPointer<const Self> ConstPointer;

  /** Standard macro */
  itkNewMacro(Self);

  itkTypeMacro(RigidTransformResample, otb::Application);

private:

  RigidTransformResample()
  {
    SetName("RigidTransformResample");
    SetDescription("Resample an image with a rigid transform");
    // Documentation
    SetDocName("Image resampling with a rigid transform");
    SetDocLongDescription("This application performs an translation on the input image.\n Parameters of the translation can be set with tx and ty options.");
    SetDocLimitations("None");
    SetDocAuthors("OTB-Team");
    SetDocSeeAlso("Translation application");
    SetDocCLExample("otbApplicationLauncherCommandLine RigidTransformResample ${OTB-BIN}/bin --in ${OTB-Data}/Input/poupees.tif --out rigitTransformImage.tf --tx 5 --ty 5");
    AddDocTag("Conversion");
    AddDocTag("Image Projection");
  }

  virtual ~RigidTransformResample()
  {
  }

  void DoCreateParameters()
  {
    AddParameter(ParameterType_InputImage,   "in",   "Input image");
    AddParameter(ParameterType_OutputImage,  "out",  "Output image");
    AddParameter(ParameterType_Float,        "tx",   "The X translation (in physical units)");
    AddParameter(ParameterType_Float,        "ty",   "The Y translation (in physical units)");
  }
  
  void DoUpdateParameters()
  {
    // Nothing to do here : all parameters are independent
  }

  void DoExecute()
  {
    typedef itk::TranslationTransform<double, FloatVectorImageType::ImageDimension> TransformType;
    typedef otb::StreamingResampleImageFilter<FloatVectorImageType, FloatVectorImageType, double>    ResampleFilterType;
    FloatVectorImageType* inputImage = GetParameterImage("in");
    
    TransformType::Pointer transform = TransformType::New();
{'fraction_non_alphanumeric': 0.14028903771589707, 'fraction_numerical': 0.00035248501938667606, 'mean_word_length': 4.749746707193515, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '931747', 'n_tokens_mistral': 1547, 'n_tokens_neox': 1473, 'n_words': 405}