Skip to content
Snippets Groups Projects
Commit 44e106d8 authored by Aurélien Bricier's avatar Aurélien Bricier
Browse files

ENH: re-enabled LocalHistogram support in ImageFunctionAdaptor

parent badc6fb4
No related branches found
No related tags found
No related merge requests found
......@@ -204,10 +204,8 @@ private:
};
//Histogram
template< class TMeasurement, unsigned int VMeasurementVectorSize, class TFrequencyContainer, class TPrecisionType >
class ITK_EXPORT VariableLengthVectorConverter<typename itk::SmartPointer< const itk::Statistics::Histogram<TMeasurement,
VMeasurementVectorSize,
TFrequencyContainer> >,
template< class TPixel, class TPrecisionType >
class ITK_EXPORT VariableLengthVectorConverter<typename itk::SmartPointer< itk::Statistics::Histogram<TPixel> >,
TPrecisionType> :
public itk::ProcessObject
{
......@@ -226,9 +224,7 @@ public:
typedef TPrecisionType OutputPrecisionType;
typedef typename itk::VariableLengthVector<OutputPrecisionType> OutputType;
typedef typename itk::SmartPointer< const itk::Statistics::Histogram<TMeasurement,
VMeasurementVectorSize,
TFrequencyContainer> > InputType;
typedef typename itk::SmartPointer< itk::Statistics::Histogram<TPixel> > InputType;
OutputType Convert(InputType input);
......
......@@ -49,7 +49,6 @@ VariableLengthVectorConverter< std::vector<std::vector<TInternalInputType> >, TP
rsltIdx ++;
}
}
return result;
}
......@@ -80,7 +79,6 @@ VariableLengthVectorConverter< std::vector<std::vector<std::complex<TInternalInp
rsltIdx ++;
}
}
return result;
}
......@@ -101,20 +99,15 @@ VariableLengthVectorConverter< itk::FixedArray<TInternalInputType, VArrayDimensi
result[rsltIdx] = static_cast<OutputPrecisionType>(input[i]);
rsltIdx ++;
}
return result;
}
// Histogram
template< class TMeasurement, unsigned int VMeasurementVectorSize, class TFrequencyContainer, class TPrecisionType >
typename VariableLengthVectorConverter< itk::SmartPointer< const itk::Statistics::Histogram<TMeasurement,
VMeasurementVectorSize,
TFrequencyContainer> >,
template< class TPixel, class TPrecisionType >
typename VariableLengthVectorConverter< itk::SmartPointer< itk::Statistics::Histogram<TPixel> >,
TPrecisionType>
::OutputType
VariableLengthVectorConverter< itk::SmartPointer<const itk::Statistics::Histogram<TMeasurement,
VMeasurementVectorSize,
TFrequencyContainer> >,
VariableLengthVectorConverter< itk::SmartPointer< itk::Statistics::Histogram<TPixel> >,
TPrecisionType>
::Convert(InputType input)
{
......@@ -131,7 +124,7 @@ VariableLengthVectorConverter< itk::SmartPointer<const itk::Statistics::Histogra
result[rsltIdx] = static_cast<OutputPrecisionType>(input->GetFrequency(i));
rsltIdx ++;
}
std::cout << "Histogram to VLV" << std::endl;
return result;
}
......
......@@ -168,6 +168,8 @@ int otbImageFunctionAdaptor(int argc, char * argv[])
{
std::cout << "ExceptionObject caught for FMDadaptedFunction() !" << std::endl;
std::cout << err << std::endl;
return EXIT_FAILURE;
}
......@@ -202,6 +204,8 @@ int otbImageFunctionAdaptor(int argc, char * argv[])
{
std::cout << "ExceptionObject caught for RMFunction() !" << std::endl;
std::cout << err << std::endl;
return EXIT_FAILURE;
}
try
......@@ -236,6 +240,8 @@ int otbImageFunctionAdaptor(int argc, char * argv[])
{
std::cout << "ExceptionObject caught for CMadaptedFunction() !" << std::endl;
std::cout << err << std::endl;
return EXIT_FAILURE;
}
try
......@@ -261,6 +267,8 @@ int otbImageFunctionAdaptor(int argc, char * argv[])
{
std::cout << "ExceptionObject caught for FMFunction() !" << std::endl;
std::cout << err << std::endl;
return EXIT_FAILURE;
}
try
......@@ -286,6 +294,8 @@ int otbImageFunctionAdaptor(int argc, char * argv[])
{
std::cout << "ExceptionObject caught for HMFunction() !" << std::endl;
std::cout << err << std::endl;
return EXIT_FAILURE;
}
try
......@@ -312,6 +322,8 @@ int otbImageFunctionAdaptor(int argc, char * argv[])
{
std::cout << "ExceptionObject caught for RaMFunction() !" << std::endl;
std::cout << err << std::endl;
return EXIT_FAILURE;
}
try
......@@ -344,6 +356,8 @@ int otbImageFunctionAdaptor(int argc, char * argv[])
{
std::cout << "ExceptionObject caught for LHFunction() !" << std::endl;
std::cout << err << std::endl;
return EXIT_FAILURE;
}
error = vcl_sqrt(error);
......@@ -386,6 +400,8 @@ int otbImageFunctionAdaptor(int argc, char * argv[])
{
std::cout << "ExceptionObject caught for FMDFunctionType() !" << std::endl;
std::cout << err << std::endl;
return EXIT_FAILURE;
}
......
......@@ -81,6 +81,8 @@ int otbStandardMetaImageFunctionBuilder(int argc, char* argv[])
p1.push_back(7);
p1.push_back(128);
p1.push_back(0);
p1.push_back(1500);
p2.push_back(6);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment