Commit 9d0e2be2 authored by Emmanuel Christophe's avatar Emmanuel Christophe

STYLE: replace tabulation by spaces

parent ceb83892
......@@ -57,13 +57,13 @@ namespace otb
/** Get parameter*/
template<typename T> T GetParameter(const std::string & key) const {
if(m_OTBConfig == NULL)
{
itkExceptionMacro(<<"Configuration file not found.");
}
if(m_OTBConfig == NULL)
{
itkExceptionMacro(<<"Configuration file not found.");
}
try
try
{
return m_OTBConfig->read<T>( key );
}
......
......@@ -367,21 +367,21 @@ ImageFileReader<TOutputImage>
ossimImageHandler* handler = ossimImageHandlerRegistry::instance()->open(ossimFilename(lFileNameOssimKeywordlist.c_str()));
if (!handler)
{
otbMsgDevMacro( <<"OSSIM Open Image FAILED ! ");
}
{
otbMsgDevMacro( <<"OSSIM Open Image FAILED ! ");
}
else
{
otbMsgDevMacro( <<"OSSIM Open Image SUCCESS ! ");
// hasMetaData = handler->getImageGeometry(geom_kwl);
ossimProjection* projection = handler->getImageGeometry()->getProjection();
if (projection)
{
hasMetaData = projection->saveState(geom_kwl);
}
}
{
otbMsgDevMacro( <<"OSSIM Open Image SUCCESS ! ");
// hasMetaData = handler->getImageGeometry(geom_kwl);
ossimProjection* projection = handler->getImageGeometry()->getProjection();
if (projection)
{
hasMetaData = projection->saveState(geom_kwl);
}
}
// Free memory
delete handler;
}
......
......@@ -486,12 +486,12 @@ TerraSarImageMetadataInterface::GetNoisePolynomialCoefficientsList( const MetaDa
polCoef.clear();
// set <= condition because degree N means N+1 coeff
for(unsigned int j=0; j<=polDegs.size(); j++)
{
oss.str("");
oss << "noise[" << i << "]imageNoise.noiseEstimate.coefficient[" << j <<"]";
ossimString tempVal = kwl.find(oss.str().c_str());
polCoef.push_back( static_cast<double>(tempVal.toDouble()) );
}
{
oss.str("");
oss << "noise[" << i << "]imageNoise.noiseEstimate.coefficient[" << j <<"]";
ossimString tempVal = kwl.find(oss.str().c_str());
polCoef.push_back( static_cast<double>(tempVal.toDouble()) );
}
polCoefList.push_back(polCoef);
}
......
......@@ -30,11 +30,11 @@ namespace otb {
template < class TImage >
GCPsToRPCSensorModelImageFilter<TImage>
::GCPsToRPCSensorModelImageFilter() : m_UseImageGCPs(true),
m_RMSGroundError(0.),
m_UseDEM(false),
m_MeanElevation(0.),
m_DEMHandler(),
m_GCPsContainer()
m_RMSGroundError(0.),
m_UseDEM(false),
m_MeanElevation(0.),
m_DEMHandler(),
m_GCPsContainer()
{
// This filter does not modify the image buffer, but only its
// metadata.Therefore, it can be run inplace to reduce memory print.
......@@ -161,7 +161,7 @@ GCPsToRPCSensorModelImageFilter< TImage >
// Fill geo point
geoPoint = ossimGpt(imagePtr->GetGCPX(i),imagePtr->GetGCPY(i),
imagePtr->GetGCPZ(i));
imagePtr->GetGCPZ(i));
// Add the sensor point to the list
sensorPoints.push_back(sensorPoint);
......
......@@ -84,18 +84,18 @@ public:
typedef TPoint PointType;
typedef typename PointType::CoordRepType PrecisionType;
typedef itk::CovariantVector<PrecisionType,
PointDimension> CovariantVectorType;
PointDimension> CovariantVectorType;
typedef std::pair<PointType,PointType> TiePointsType;
typedef std::vector<TiePointsType> TiePointsContainerType;
/** Affine transform components typedefs */
typedef itk::Matrix<PrecisionType,
PointDimension,
PointDimension> MatrixType;
PointDimension,
PointDimension> MatrixType;
typedef itk::Vector<PrecisionType,
PointDimension> VectorType;
PointDimension> VectorType;
typedef itk::AffineTransform<PrecisionType,
PointDimension> AffineTransformType;
PointDimension> AffineTransformType;
typedef typename AffineTransformType::Pointer AffineTransformPointerType;
/** Get the affine transform matrix */
......
......@@ -29,11 +29,11 @@ namespace otb {
template < class TPoint >
LeastSquareAffineTransformEstimator<TPoint>
::LeastSquareAffineTransformEstimator() : m_TiePointsContainer(),
m_RMSError(),
m_RelativeResidual(),
m_Matrix(),
m_Offset(),
m_AffineTransform()
m_RMSError(),
m_RelativeResidual(),
m_Matrix(),
m_Offset(),
m_AffineTransform()
{
// Build the affine transform object
m_AffineTransform = AffineTransformType::New();
......@@ -119,9 +119,9 @@ LeastSquareAffineTransformEstimator<TPoint>
// Iterate on dimension (second loop)
for(unsigned int dim2 = 0; dim2 < PointDimension; ++dim2)
{
matrixPerDim[dim1](pId,dim2) = static_cast<double>(m_TiePointsContainer[pId].first[dim2]);
}
{
matrixPerDim[dim1](pId,dim2) = static_cast<double>(m_TiePointsContainer[pId].first[dim2]);
}
// Fill the last column
matrixPerDim[dim1](pId,PointDimension) = 1.;
......@@ -139,8 +139,8 @@ LeastSquareAffineTransformEstimator<TPoint>
if(linearSystem.get_number_of_unknowns() > nbPoints*PointDimension)
{
itkExceptionMacro(<<"There are "<<linearSystem.get_number_of_unknowns()
<<" unknowns in the linear systems but only "<<nbPoints
<<" points are provided.");
<<" unknowns in the linear systems but only "<<nbPoints
<<" points are provided.");
}
otbMsgDebugMacro(<<"Number of unknowns: "<<linearSystem.get_number_of_unknowns());
otbMsgDebugMacro(<<"Number of equations: "<<nbPoints);
......
......@@ -90,7 +90,7 @@ public:
/** "typedef" for standard classes. */
typedef TerraSarBrightnessImageFilter Self;
typedef itk::UnaryFunctorImageFilter< InputImageType,
OutputImageType, FunctorType > Superclass;
OutputImageType, FunctorType > Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
......
......@@ -93,9 +93,9 @@ public:
/** Extract input and output images dimensions.*/
itkStaticConstMacro( InputImageDimension, unsigned int,
TInputImage::ImageDimension);
TInputImage::ImageDimension);
itkStaticConstMacro( OutputImageDimension, unsigned int,
TOutputImage::ImageDimension);
TOutputImage::ImageDimension);
/** "typedef" to simplify the variables definition
* and the declaration. */
......@@ -110,7 +110,7 @@ public:
/** Calibration functor typedef */
typedef typename Functor::TerraSarCalibrationFunctor<InputValueType,
OutputValueType> CalibrationFunctorType;
OutputValueType> CalibrationFunctorType;
/** typedef to access metadata */
typedef itk::MetaDataDictionary MetaDataDictionaryType;
......
......@@ -35,14 +35,14 @@ namespace otb
template <class TInputImage, class TOutputImage>
TerraSarCalibrationImageFilter<TInputImage,TOutputImage>
::TerraSarCalibrationImageFilter() : m_CalibrationFactor(itk::NumericTraits<double>::Zero),
m_LocalIncidentAngle(itk::NumericTraits<double>::Zero),
m_PRF(1.),
m_OriginalProductSize(),
m_UseFastCalibration(false),
m_ResultsInDecibels(false),
m_NoiseRecords(),
m_DefaultValue(0.00001)
m_LocalIncidentAngle(itk::NumericTraits<double>::Zero),
m_PRF(1.),
m_OriginalProductSize(),
m_UseFastCalibration(false),
m_ResultsInDecibels(false),
m_NoiseRecords(),
m_DefaultValue(0.00001)
{}
template <class TInputImage, class TOutputImage>
......@@ -128,15 +128,15 @@ TerraSarCalibrationImageFilter<TInputImage,TOutputImage>
std::vector<double> noiseTimes = lImageMetadata->GetNoiseTimeUTCList(this->GetInput()->GetMetaDataDictionary());
if(!m_UseFastCalibration && ( noiseTimes.empty() || nbNoiseRecords == 0))
{
itkExceptionMacro(<<"No noise records found. Consider using fast calibration.");
}
{
itkExceptionMacro(<<"No noise records found. Consider using fast calibration.");
}
// For each noise record, add it
for(unsigned int i = 0; i < nbNoiseRecords;++i)
{
this->AddNoiseRecord(noiseTimes[i],noiseRecords->get_imageNoise()[i]);
}
{
this->AddNoiseRecord(noiseTimes[i],noiseRecords->get_imageNoise()[i]);
}
// Free memory
delete noiseRecords;
......@@ -251,18 +251,18 @@ TerraSarCalibrationImageFilter<TInputImage,TOutputImage>
// And check if we changed of NoiseRecord
if(currentAzimuthPosition < currentNoiseRecordAzimuthPosition)
{
// Update the iterator
++currentNoiseRecordIt;
// If we are not at the last record
if(currentNoiseRecordIt != m_NoiseRecords.end())
{
// Update the functor noise record
currentNoiseRecordAzimuthPosition = currentNoiseRecordIt->first;
calibrationFunctor.SetNoiseRecord(currentNoiseRecordIt->second);
}
}
{
// Update the iterator
++currentNoiseRecordIt;
// If we are not at the last record
if(currentNoiseRecordIt != m_NoiseRecords.end())
{
// Update the functor noise record
currentNoiseRecordAzimuthPosition = currentNoiseRecordIt->first;
calibrationFunctor.SetNoiseRecord(currentNoiseRecordIt->second);
}
}
}
// Apply the calibration functor
outputIt.Set( calibrationFunctor( inputIt.Get(), inputIt.GetIndex() ) );
......
......@@ -231,37 +231,37 @@ StandardImageViewer<TImage,TVectorData,TWidgetManager>
if(listSize>0)
{
if(listSize==1)
{
typename HistogramCurveType::Pointer grayhistogram = HistogramCurveType::New();
grayhistogram->SetHistogram(m_ImageLayer->GetHistogramList()->GetNthElement(0));
grayhistogram->SetHistogramColor(gray);
grayhistogram->SetLabelColor(gray);
m_CurveWidget->AddCurve(grayhistogram);
}
{
typename HistogramCurveType::Pointer grayhistogram = HistogramCurveType::New();
grayhistogram->SetHistogram(m_ImageLayer->GetHistogramList()->GetNthElement(0));
grayhistogram->SetHistogramColor(gray);
grayhistogram->SetLabelColor(gray);
m_CurveWidget->AddCurve(grayhistogram);
}
else
{
typename HistogramCurveType::Pointer rhistogram = HistogramCurveType::New();
rhistogram->SetHistogram(m_ImageLayer->GetHistogramList()->GetNthElement(0));
rhistogram->SetHistogramColor(red);
rhistogram->SetLabelColor(red);
m_CurveWidget->AddCurve(rhistogram);
}
{
typename HistogramCurveType::Pointer rhistogram = HistogramCurveType::New();
rhistogram->SetHistogram(m_ImageLayer->GetHistogramList()->GetNthElement(0));
rhistogram->SetHistogramColor(red);
rhistogram->SetLabelColor(red);
m_CurveWidget->AddCurve(rhistogram);
}
if(listSize>1)
{
typename HistogramCurveType::Pointer ghistogram = HistogramCurveType::New();
ghistogram->SetHistogram(m_ImageLayer->GetHistogramList()->GetNthElement(1));
ghistogram->SetHistogramColor(green);
ghistogram->SetLabelColor(green);
m_CurveWidget->AddCurve(ghistogram);
}
{
typename HistogramCurveType::Pointer ghistogram = HistogramCurveType::New();
ghistogram->SetHistogram(m_ImageLayer->GetHistogramList()->GetNthElement(1));
ghistogram->SetHistogramColor(green);
ghistogram->SetLabelColor(green);
m_CurveWidget->AddCurve(ghistogram);
}
if(listSize>2)
{
typename HistogramCurveType::Pointer bhistogram = HistogramCurveType::New();
bhistogram->SetHistogram(m_ImageLayer->GetHistogramList()->GetNthElement(2));
bhistogram->SetHistogramColor(blue);
bhistogram->SetLabelColor(blue);
m_CurveWidget->AddCurve(bhistogram);
}
{
typename HistogramCurveType::Pointer bhistogram = HistogramCurveType::New();
bhistogram->SetHistogram(m_ImageLayer->GetHistogramList()->GetNthElement(2));
bhistogram->SetHistogramColor(blue);
bhistogram->SetLabelColor(blue);
m_CurveWidget->AddCurve(bhistogram);
}
}
m_CurveWidget->SetXAxisLabel("Pixels");
......
......@@ -266,8 +266,8 @@ int main (int argc, char* argv[])
ptContainer2 = ptSet2->GetPoints();
if ( ptSet1->GetNumberOfPoints() > ptSet2->GetNumberOfPoints() )
{
ptContainer1 = ptSet2->GetPoints();
ptContainer2 = ptSet1->GetPoints();
ptContainer1 = ptSet2->GetPoints();
ptContainer2 = ptSet1->GetPoints();
}
PointsContainer::Pointer ptContainerRes = PointsContainer::New();
......@@ -277,8 +277,8 @@ int main (int argc, char* argv[])
//Construct new point container (subset of input pointset)
for (unsigned int id=0;id < ptContainer1->Size();++id)
{
ptContainerRes->InsertElement(id, pointsIterator->Value());
++pointsIterator;
ptContainerRes->InsertElement(id, pointsIterator->Value());
++pointsIterator;
}
if ( ptSet1->GetNumberOfPoints() > ptSet2->GetNumberOfPoints() )
......@@ -287,7 +287,7 @@ int main (int argc, char* argv[])
}
else
{
ptSet2->SetPoints(ptContainerRes);
ptSet2->SetPoints(ptContainerRes);
}
std::cout << "SIFT points size" << std::endl;
......
......@@ -100,7 +100,7 @@ int main(int argc, char * argv[])
typedef otb::Polygon<double> PolygonType;
typedef otb::Functor::LabelObjectToPolygonFunctor<LabelObjectType,PolygonType> FunctorType;
// Software Guide : EndCodeSnippet
typedef VectorDataType::DataNodeType DataNodeType;
typedef VectorDataType::DataNodeType DataNodeType;
typedef otb::VectorDataProjectionFilter<VectorDataType,VectorDataType> VectorDataFilterType;
......
......@@ -135,7 +135,7 @@ int main(int argc, char * argv[])
//
// Software Guide : EndLatex
// Software Guide : BeginCodeSnippet
filter->SetInput(reader->GetOutput());
filter->SetInput(reader->GetOutput());
// Software Guide : EndCodeSnippet
// Software Guide : BeginLatex
......
......@@ -79,9 +79,9 @@ int otbTerraSarImageMetadataInterface (int argc, char* argv[])
file<<"Noise Polynom "<<i<<" ( degree: "<<deg[i]<<")"<<std::endl;
file<<"coefficients: ";
for( unsigned int j=0; j<coeffs[i].size(); j++ )
{
file<<coeffs[i][j]<<" ";
}
{
file<<coeffs[i][j]<<" ";
}
file<<std::endl;
file<<"Min validity range: "<<mins[i]<<std::endl;
file<<"Min validity range: "<<maxs[i]<<std::endl;
......
......@@ -57,27 +57,27 @@ int otbSensorModel( int argc, char* argv[] )
//** Truncate precision of meters_per_pixel */
ossimKeywordlist geom_kwl;
ossimString s;
double value;
double value;
reader->GetOutput()->GetImageKeywordlist().convertToOSSIMKeywordlist( geom_kwl);
file << std::setprecision(5);
s = geom_kwl.find("meters_per_pixel_x");
if (s != "")
{
value = s.toDouble();
file << "truncate_meter_per_pixel_x " << value << std::endl;
}
s = geom_kwl.find("meters_per_pixel_y");
if (s != "")
{
value = s.toDouble();
file << "truncate_meter_per_pixel_y " << value << std::endl;
}
file << std::setprecision(15);
s = geom_kwl.find("meters_per_pixel_x");
if (s != "")
{
value = s.toDouble();
file << "truncate_meter_per_pixel_x " << value << std::endl;
}
s = geom_kwl.find("meters_per_pixel_y");
if (s != "")
{
value = s.toDouble();
file << "truncate_meter_per_pixel_y " << value << std::endl;
}
file << std::setprecision(15);
file << "\n*** TRANSFORM ***\n";
typedef otb::ForwardSensorModel<double> ForwardSensorModelType;
......@@ -106,7 +106,7 @@ int otbSensorModel( int argc, char* argv[] )
file << "Geo to image: " << geoPoint << " -> " << reversedImagePoint << "\n";
file.close();
return EXIT_SUCCESS;
}
......
......@@ -31,8 +31,8 @@ int otbTerraSarBrightnessImageComplexFilterTest(int argc, char * argv[])
const bool useMetadata = atoi(argv[3]);
const bool resultsInDb = atoi(argv[4]);
typedef std::complex<double> ComplexType;
typedef otb::Image<ComplexType, 2> ImageType;
typedef std::complex<double> ComplexType;
typedef otb::Image<ComplexType, 2> ImageType;
typedef otb::ImageFileReader<ImageType> ReaderType;
typedef otb::ImageFileWriter<ImageType> WriterType;
typedef otb::TerraSarBrightnessImageFilter<ImageType, ImageType> FilterType;
......
......@@ -31,7 +31,7 @@ int otbTerraSarCalibrationImageComplexFilterTest(int argc, char * argv[])
const bool useFastCalibration = atoi(argv[3]);
const bool resultsInDbs = atoi(argv[4]);
typedef std::complex<double> ComplexType;
typedef std::complex<double> ComplexType;
typedef otb::Image<ComplexType, 2> ImageType;
typedef otb::ImageFileReader<ImageType> ReaderType;
typedef otb::ImageFileWriter<ImageType> WriterType;
......
......@@ -31,7 +31,7 @@ int otbTerraSarCalibrationImageFilterTest(int argc, char * argv[])
const bool useFastCalibration = atoi(argv[3]);
const bool resultsInDbs = atoi(argv[4]);
typedef double PixelType;
typedef double PixelType;
typedef otb::Image<PixelType, 2> ImageType;
typedef otb::ImageFileReader<ImageType> ReaderType;
typedef otb::ImageFileWriter<ImageType> WriterType;
......
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