<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.

  Copyright (c) Institut Telecom / Telecom Bretagne. All rights reserved. 
  See GETCopyright.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 <iostream>

#include "otbImage.h"
#include "otbImageFileReader.h"
#include "otbImageFileWriter.h"
#include "otbCommandProgressUpdate.h"
#include "otbCommandLineArgumentParser.h"

#include "otbKullbackLeiblerSupervizedDistanceImageFilter.h"

int main ( int argc, char * argv[] )
{
	try {

        typedef otb::CommandLineArgumentParser ParserType;
        ParserType::Pointer parser = ParserType::New();
        parser->AddOption( "--InputImage1", "Give Before image", "-1", 1, true );
	parser->AddOption( "--InputImage2", "Give After image", "-2", 1, true );
        parser->AddOption( "--Roi", "Give ROI image", "-r", 1, true );
	parser->AddOption( "--winSize", "Sliding window size (def. 35)", "-w", 1, false );
	parser->AddOutputImage();

	typedef otb::CommandLineArgumentParseResult ParserResultType;	
	ParserResultType::Pointer  parseResult = ParserResultType::New();
    
	try
        {	
                parser->ParseCommandLine(argc,argv,parseResult);
	}
	catch( itk::ExceptionObject & err )
	{
		std::string descriptionException = err.GetDescription();
		if ( descriptionException.find("ParseCommandLine(): Help Parser")
				!= std::string::npos )
			return EXIT_SUCCESS;
		if(descriptionException.find("ParseCommandLine(): Version Parser")
				!= std::string::npos )
			return EXIT_SUCCESS;
		return EXIT_FAILURE;
	}

	/*
	 *	declaration des types
	 */
	
	const unsigned int Dimension = 2;

	typedef double InputPixelType;
	typedef unsigned char TrainingPixelType;

	typedef otb::Image< InputPixelType, Dimension > ImageType;
	typedef otb::ImageFileReader< ImageType > ReaderType;

	typedef otb::Image< TrainingPixelType, Dimension > TrainingImageType; 
	typedef otb::ImageFileReader< TrainingImageType > TrainingReaderType;

	/*
	 * Accs aux paramtres
	 */
	 
	int c;
	const char * inputImageFileName1 = parseResult->GetParameterString("--InputImage1").c_str();
	const char * inputImageFileName2 = parseResult->GetParameterString("--InputImage2").c_str();
	const char * inputTrainingImageFileName = parseResult->GetParameterString("--Roi").c_str();
	const char * outputImageFileName = parseResult->GetOutputImage().c_str();
	
	int winSize = 35;
	if ( parseResult->IsOptionPresent("--winSize") )
		winSize = parseResult->GetParameterInt("--winSize");
	
	/*
	 *	JustDoIt
	 */
	

	ImageType::Pointer img1 = ImageType::New();
	ReaderType::Pointer reader1 = ReaderType::New();
	reader1->SetFileName( inputImageFileName1 );
	//reader1->Update();<commit_msg>Suppression warning (variable "int c" déclarée mais non utilisé)<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.

  Copyright (c) Institut Telecom / Telecom Bretagne. All rights reserved. 
  See GETCopyright.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 <iostream>

#include "otbImage.h"
#include "otbImageFileReader.h"
#include "otbImageFileWriter.h"
#include "otbCommandProgressUpdate.h"
#include "otbCommandLineArgumentParser.h"

#include "otbKullbackLeiblerSupervizedDistanceImageFilter.h"

int main ( int argc, char * argv[] )
{
	try {

        typedef otb::CommandLineArgumentParser ParserType;
        ParserType::Pointer parser = ParserType::New();
        parser->AddOption( "--InputImage1", "Give Before image", "-1", 1, true );
	parser->AddOption( "--InputImage2", "Give After image", "-2", 1, true );
        parser->AddOption( "--Roi", "Give ROI image", "-r", 1, true );
	parser->AddOption( "--winSize", "Sliding window size (def. 35)", "-w", 1, false );
	parser->AddOutputImage();

	typedef otb::CommandLineArgumentParseResult ParserResultType;	
	ParserResultType::Pointer  parseResult = ParserResultType::New();
    
	try
        {	
                parser->ParseCommandLine(argc,argv,parseResult);
	}
	catch( itk::ExceptionObject & err )
	{
		std::string descriptionException = err.GetDescription();
		if ( descriptionException.find("ParseCommandLine(): Help Parser")
				!= std::string::npos )
			return EXIT_SUCCESS;
		if(descriptionException.find("ParseCommandLine(): Version Parser")
				!= std::string::npos )
			return EXIT_SUCCESS;
		return EXIT_FAILURE;
	}

	/*
	 *	declaration des types
	 */
	
	const unsigned int Dimension = 2;

	typedef double InputPixelType;
	typedef unsigned char TrainingPixelType;

	typedef otb::Image< InputPixelType, Dimension > ImageType;
	typedef otb::ImageFileReader< ImageType > ReaderType;

	typedef otb::Image< TrainingPixelType, Dimension > TrainingImageType; 
	typedef otb::ImageFileReader< TrainingImageType > TrainingReaderType;

	/*
	 * Accs aux paramtres
	 */
	 
	const char * inputImageFileName1 = parseResult->GetParameterString("--InputImage1").c_str();
	const char * inputImageFileName2 = parseResult->GetParameterString("--InputImage2").c_str();
	const char * inputTrainingImageFileName = parseResult->GetParameterString("--Roi").c_str();
	const char * outputImageFileName = parseResult->GetOutputImage().c_str();
	
	int winSize = 35;
	if ( parseResult->IsOptionPresent("--winSize") )
		winSize = parseResult->GetParameterInt("--winSize");
	
	/*
	 *	JustDoIt
	 */
	

	ImageType::Pointer img1 = ImageType::New();
	ReaderType::Pointer reader1 = ReaderType::New();
	reader1->SetFileName( inputImageFileName1 );
	//reader1->Update();
{'fraction_non_alphanumeric': 0.1632941176470588, 'fraction_numerical': 0.0069019607843137255, 'mean_word_length': 4.68270944741533, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 41, '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': '4940312', 'n_tokens_mistral': 1974, 'n_tokens_neox': 1800, 'n_words': 457}