From fa2559325ed35ade41776d065117d46daa769baa Mon Sep 17 00:00:00 2001 From: OTB Bot <otbbot@orfeo-toolbox.org> Date: Mon, 15 Mar 2010 17:41:53 +0800 Subject: [PATCH] STYLE --- Code/BasicFilters/otbChangeLabelImageFilter.h | 1 - Code/Common/otbImageList.txx | 18 +++---- Code/Common/otbLabelObjectToPolygonFunctor.h | 22 ++++----- ...otbRadiometricAttributesLabelMapFilter.txx | 8 +-- .../Common/otbShapeAttributesLabelMapFilter.h | 4 +- .../otbShapeAttributesLabelMapFilter.txx | 10 ++-- .../otbStatisticsAttributesLabelMapFilter.h | 4 +- .../otbStatisticsAttributesLabelMapFilter.txx | 8 +-- Code/IO/otbImageFileReader.txx | 46 +++++++++--------- .../otbLabelObjectToPolygonFunctorNew.cxx | 2 +- Testing/Code/IO/otbDEMHandlerTest.cxx | 2 +- Testing/Fa/0000041-mean_shift.cxx | 2 +- Testing/Fa/MapActivation.cxx | 22 ++++----- .../zlib-1.2.3.win32/bin/minizip.dll | Bin .../zlib-1.2.3.win32/bin/zlib1.dll | Bin 15 files changed, 73 insertions(+), 76 deletions(-) mode change 100755 => 100644 Utilities/otbkml/third_party/zlib-1.2.3.win32/bin/minizip.dll mode change 100755 => 100644 Utilities/otbkml/third_party/zlib-1.2.3.win32/bin/zlib1.dll diff --git a/Code/BasicFilters/otbChangeLabelImageFilter.h b/Code/BasicFilters/otbChangeLabelImageFilter.h index 0f688876b4..d68482c246 100644 --- a/Code/BasicFilters/otbChangeLabelImageFilter.h +++ b/Code/BasicFilters/otbChangeLabelImageFilter.h @@ -187,7 +187,6 @@ private: #endif - #ifndef __otbChangeLabelImageFilter_h #define __otbChangeLabelImageFilter_h diff --git a/Code/Common/otbImageList.txx b/Code/Common/otbImageList.txx index ae031df8b7..0b8db4e023 100644 --- a/Code/Common/otbImageList.txx +++ b/Code/Common/otbImageList.txx @@ -41,15 +41,15 @@ ImageList<TImage> // Check that the requested region lies within the largest possible region if ( ! it.Get()->VerifyRequestedRegion() ) - { - // invalid requested region, throw an exception - itk::InvalidRequestedRegionError e(__FILE__, __LINE__); - e.SetLocation(ITK_LOCATION); - e.SetDataObject(it.Get()); - e.SetDescription("Requested region is (at least partially) outside the largest possible region."); - - throw e; - } + { + // invalid requested region, throw an exception + itk::InvalidRequestedRegionError e(__FILE__, __LINE__); + e.SetLocation(ITK_LOCATION); + e.SetDataObject(it.Get()); + e.SetDescription("Requested region is (at least partially) outside the largest possible region."); + + throw e; + } it.Get()->GetSource()->UpdateOutputData(it.Get()); } diff --git a/Code/Common/otbLabelObjectToPolygonFunctor.h b/Code/Common/otbLabelObjectToPolygonFunctor.h index 7fa982eb9f..5751ceb09f 100644 --- a/Code/Common/otbLabelObjectToPolygonFunctor.h +++ b/Code/Common/otbLabelObjectToPolygonFunctor.h @@ -109,17 +109,17 @@ public: /** Constructor */ LabelObjectToPolygonFunctor() : m_Polygon(NULL), - m_CurrentState(UP_LEFT), - m_PositionFlag(LEFT_END), - m_StartingPoint(), - m_CurrentPoint(), - m_CurrentRun(), - m_CurrentLine(0), - m_Solution(), - m_LineOffset(0), - m_StartIndex(), - m_Origin(), - m_Spacing(1.) + m_CurrentState(UP_LEFT), + m_PositionFlag(LEFT_END), + m_StartingPoint(), + m_CurrentPoint(), + m_CurrentRun(), + m_CurrentLine(0), + m_Solution(), + m_LineOffset(0), + m_StartIndex(), + m_Origin(), + m_Spacing(1.) {} /** Destructor */ diff --git a/Code/Common/otbRadiometricAttributesLabelMapFilter.txx b/Code/Common/otbRadiometricAttributesLabelMapFilter.txx index 3306816cae..e33375f9c9 100644 --- a/Code/Common/otbRadiometricAttributesLabelMapFilter.txx +++ b/Code/Common/otbRadiometricAttributesLabelMapFilter.txx @@ -29,7 +29,7 @@ namespace Functor template <class TLabelObject, class TFeatureImage> MultiStatsAttributesLabelObjectFunctor<TLabelObject,TFeatureImage> ::MultiStatsAttributesLabelObjectFunctor() : m_ReducedAttributeSet(true), - m_StatsFunctorsMap() + m_StatsFunctorsMap() {} /** Destructor */ @@ -165,9 +165,9 @@ MultiStatsAttributesLabelObjectFunctor<TLabelObject,TFeatureImage> template <class TImage, class TFeatureImage> RadiometricAttributesLabelMapFilter<TImage, TFeatureImage> ::RadiometricAttributesLabelMapFilter() : m_RedChannelIndex(2), - m_GreenChannelIndex(1), - m_BlueChannelIndex(0), - m_NIRChannelIndex(3) + m_GreenChannelIndex(1), + m_BlueChannelIndex(0), + m_NIRChannelIndex(3) { this->SetNumberOfRequiredInputs(2); } diff --git a/Code/Common/otbShapeAttributesLabelMapFilter.h b/Code/Common/otbShapeAttributesLabelMapFilter.h index cc9cb7f7ff..c586cc8f01 100644 --- a/Code/Common/otbShapeAttributesLabelMapFilter.h +++ b/Code/Common/otbShapeAttributesLabelMapFilter.h @@ -165,8 +165,8 @@ class ShapeAttributesLabelObjectFunctor * \ingroup ImageEnhancement MathematicalMorphologyImageFilters */ template<class TImage, - class TLabelImage = Image< typename TImage::PixelType, - TImage::ImageDimension > > + class TLabelImage = Image< typename TImage::PixelType, + TImage::ImageDimension > > class ITK_EXPORT ShapeAttributesLabelMapFilter : public otb::LabelMapFeaturesFunctorImageFilter <TImage, diff --git a/Code/Common/otbShapeAttributesLabelMapFilter.txx b/Code/Common/otbShapeAttributesLabelMapFilter.txx index eb189945d1..1cd19cdc0a 100644 --- a/Code/Common/otbShapeAttributesLabelMapFilter.txx +++ b/Code/Common/otbShapeAttributesLabelMapFilter.txx @@ -39,10 +39,10 @@ namespace Functor { template <class TLabelObject, class TLabelImage> ShapeAttributesLabelObjectFunctor<TLabelObject,TLabelImage> ::ShapeAttributesLabelObjectFunctor() : m_ComputeFeretDiameter(false), - m_ComputePerimeter(false), - m_ReducedAttributeSet(true), - m_PerimeterCalculator(NULL), - m_LabelImage(NULL) + m_ComputePerimeter(false), + m_ReducedAttributeSet(true), + m_PerimeterCalculator(NULL), + m_LabelImage(NULL) {} /** The comparator (!=) */ @@ -391,7 +391,6 @@ ShapeAttributesLabelObjectFunctor<TLabelObject,TLabelImage> } - // Compute principal moments and axes itk::Vector<double,LabelObjectType::ImageDimension> principalMoments; vnl_symmetric_eigensystem<double> eigen( centralMoments.GetVnlMatrix() ); @@ -501,7 +500,6 @@ ShapeAttributesLabelObjectFunctor<TLabelObject,TLabelImage> - // Set the attributes PolygonFunctorType polygonFunctor; polygonFunctor.SetStartIndex(m_LabelImage->GetLargestPossibleRegion().GetIndex()); diff --git a/Code/Common/otbStatisticsAttributesLabelMapFilter.h b/Code/Common/otbStatisticsAttributesLabelMapFilter.h index 9461339315..0a870895ee 100644 --- a/Code/Common/otbStatisticsAttributesLabelMapFilter.h +++ b/Code/Common/otbStatisticsAttributesLabelMapFilter.h @@ -44,10 +44,10 @@ public: // Matrix typedef typedef typename itk::Matrix<double, TFeatureImage::ImageDimension, - TFeatureImage::ImageDimension> MatrixType; + TFeatureImage::ImageDimension> MatrixType; // Vector typedef typedef typename itk::Vector<double, - TFeatureImage::ImageDimension> VectorType; + TFeatureImage::ImageDimension> VectorType; /// Typedef of the feature image type typedef typename TFeatureImage::PixelType FeatureType; diff --git a/Code/Common/otbStatisticsAttributesLabelMapFilter.txx b/Code/Common/otbStatisticsAttributesLabelMapFilter.txx index 27a22da069..a27e32e820 100644 --- a/Code/Common/otbStatisticsAttributesLabelMapFilter.txx +++ b/Code/Common/otbStatisticsAttributesLabelMapFilter.txx @@ -34,8 +34,8 @@ namespace Functor template <class TLabelObject, class TFeatureImage> StatisticsAttributesLabelObjectFunctor<TLabelObject,TFeatureImage> ::StatisticsAttributesLabelObjectFunctor() : m_FeatureName("Default"), - m_FeatureImage(), - m_ReducedAttributeSet(true) + m_FeatureImage(), + m_ReducedAttributeSet(true) {} /** Destructor */ @@ -158,8 +158,8 @@ StatisticsAttributesLabelObjectFunctor<TLabelObject,TFeatureImage> const double epsilon = 1E-10; if ( vcl_abs(variance) > epsilon ) - { - skewness = ( ( sum3 - 3.0 * mean * sum2) / totalFreq + 2.0 * mean * mean2 ) / ( variance * sigma ); + { + skewness = ( ( sum3 - 3.0 * mean * sum2) / totalFreq + 2.0 * mean * mean2 ) / ( variance * sigma ); kurtosis = ( ( sum4 - 4.0 * mean * sum3 + 6.0 * mean2 * sum2) / totalFreq - 3.0 * mean2 * mean2 ) / ( variance * variance ) - 3.0; } diff --git a/Code/IO/otbImageFileReader.txx b/Code/IO/otbImageFileReader.txx index e8a0301ee8..4b860459db 100644 --- a/Code/IO/otbImageFileReader.txx +++ b/Code/IO/otbImageFileReader.txx @@ -464,29 +464,29 @@ ImageFileReader<TOutputImage> std::string browser = "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11"; if (curl) - { - curl_easy_setopt(curl, CURLOPT_USERAGENT, browser.data()); - curl_easy_setopt(curl, CURLOPT_URL,this->m_FileName.data()); - // Set the dummy write function - curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,&Self::curlDummyWriteFunction); - curl_easy_setopt(curl, CURLOPT_MAXFILESIZE,1); - - // Perform requet - res = curl_easy_perform(curl); - - if(res != 0 && res != 63) // 63 stands for filesize exceed - { - itk::ImageFileReaderException e(__FILE__, __LINE__); - itk::OStringStream msg; - msg <<"File name is an http address, but curl fails to connect to it " - << std::endl << "Filename = " << this->m_FileName - << std::endl << "Curl error code = "<<res - << std::endl; - e.SetDescription(msg.str().c_str()); - throw e; - } - return; - } + { + curl_easy_setopt(curl, CURLOPT_USERAGENT, browser.data()); + curl_easy_setopt(curl, CURLOPT_URL,this->m_FileName.data()); + // Set the dummy write function + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION,&Self::curlDummyWriteFunction); + curl_easy_setopt(curl, CURLOPT_MAXFILESIZE,1); + + // Perform requet + res = curl_easy_perform(curl); + + if(res != 0 && res != 63) // 63 stands for filesize exceed + { + itk::ImageFileReaderException e(__FILE__, __LINE__); + itk::OStringStream msg; + msg <<"File name is an http address, but curl fails to connect to it " + << std::endl << "Filename = " << this->m_FileName + << std::endl << "Curl error code = "<<res + << std::endl; + e.SetDescription(msg.str().c_str()); + throw e; + } + return; + } } #endif diff --git a/Testing/Code/Common/otbLabelObjectToPolygonFunctorNew.cxx b/Testing/Code/Common/otbLabelObjectToPolygonFunctorNew.cxx index da68e21b5d..476fd7c49d 100644 --- a/Testing/Code/Common/otbLabelObjectToPolygonFunctorNew.cxx +++ b/Testing/Code/Common/otbLabelObjectToPolygonFunctorNew.cxx @@ -32,7 +32,7 @@ int otbLabelObjectToPolygonFunctorNew(int argc, char * argv[]) // Instantiation //FunctorPointerType myFunctor = FunctorType::New(); - FunctorType myFunctor ; + FunctorType myFunctor; return EXIT_SUCCESS; } diff --git a/Testing/Code/IO/otbDEMHandlerTest.cxx b/Testing/Code/IO/otbDEMHandlerTest.cxx index 155df6e18d..bf0f71316a 100644 --- a/Testing/Code/IO/otbDEMHandlerTest.cxx +++ b/Testing/Code/IO/otbDEMHandlerTest.cxx @@ -52,7 +52,7 @@ int otbDEMHandlerTest(int argc, char * argv[]) std::ofstream file; file.open(outputfilename); file << "--- HEIGHT ABOVE MSL TEST ---" << std::endl; - file << " geoPoint: " << geoPoint[1] << " ; " << geoPoint[0] << std::endl; + file << " geoPoint: " << geoPoint[1] << "; " << geoPoint[0] << std::endl; file << " -> Height above MSL: " << height << std::endl; std::cout << "Height above MSL: " << height << std::endl; diff --git a/Testing/Fa/0000041-mean_shift.cxx b/Testing/Fa/0000041-mean_shift.cxx index 44db5e962e..a85bfae3a7 100644 --- a/Testing/Fa/0000041-mean_shift.cxx +++ b/Testing/Fa/0000041-mean_shift.cxx @@ -12,7 +12,7 @@ int main( int argc, char *argv[] ) if (argc < 9) { - std::cout << "Usage : inputImage rangeRadius spatialRadius minRegionSize outfilenamefiltered outfilenamesegmented outfilenamelabeled outfilenameboundary" << std::endl ; + std::cout << "Usage : inputImage rangeRadius spatialRadius minRegionSize outfilenamefiltered outfilenamesegmented outfilenamelabeled outfilenameboundary" << std::endl; return EXIT_FAILURE; } diff --git a/Testing/Fa/MapActivation.cxx b/Testing/Fa/MapActivation.cxx index 1969e1b436..82d772ee88 100644 --- a/Testing/Fa/MapActivation.cxx +++ b/Testing/Fa/MapActivation.cxx @@ -49,7 +49,7 @@ int main(int argc, char* argv[] ) if (argc < 12) { - std::cout << "Usage : " << argv[0] << " inputTabImage size radius NumberOfIterations BetaInit BetaEnd MaxWeight MinWeight som actMap som" << std::endl ; + std::cout << "Usage : " << argv[0] << " inputTabImage size radius NumberOfIterations BetaInit BetaEnd MaxWeight MinWeight som actMap som" << std::endl; return EXIT_FAILURE; } @@ -64,20 +64,20 @@ int main(int argc, char* argv[] ) typedef itk::ImageRegionIterator< ListImageType > IteratorType; IteratorType It1( tabreadImage, tabreadImage->GetLargestPossibleRegion() ); - const int nblines= 591 ; //const int)(tabreadImage->GetLargestPossibleRegion().GetSize()[1]); + const int nblines= 591; //const int)(tabreadImage->GetLargestPossibleRegion().GetSize()[1]); const int nbcolonnes= 9; //(const int)tabreadImage->GetLargestPossibleRegion().GetSize()[0]; double vectTab[nblines][nbcolonnes]; std::cout<<"lignes = "<<nblines<<" colonnes = "<<nbcolonnes<<std::endl; - for ( It1.GoToBegin(); !It1.IsAtEnd() ;++It1) + for ( It1.GoToBegin(); !It1.IsAtEnd();++It1) { vectTab[It1.GetIndex()[1]][It1.GetIndex()[0]]=It1.Get(); } - typedef itk::VariableLengthVector< double > MeasurementVectorType ; - typedef itk::Statistics::ListSample< MeasurementVectorType > SampleType ; - SampleType::Pointer liste = SampleType::New() ; + typedef itk::VariableLengthVector< double > MeasurementVectorType; + typedef itk::Statistics::ListSample< MeasurementVectorType > SampleType; + SampleType::Pointer liste = SampleType::New(); for(int j=0;j<nblines;j++) { @@ -145,11 +145,11 @@ int main(int argc, char* argv[] ) somreader->SetFileName(argv[11]/*"som.mhd"*/); somreader->Update(); - ClassifierType::Pointer classifier = ClassifierType::New() ; + ClassifierType::Pointer classifier = ClassifierType::New(); classifier->SetSample(liste); classifier->SetMap(somreader->GetOutput()); - classifier->Update() ; + classifier->Update(); ClassifierType::OutputType* membershipSample = classifier->GetOutput(); // std::cout<<"liste: "<<membershipSample->GetMeasurementVectorSize()<< " " << membershipSample->GetMeasurementVector(1)<<std::endl; @@ -173,7 +173,7 @@ int main(int argc, char* argv[] ) // " class sample: "<< membershipSample->GetClassSample(m_iter.GetClassLabel())<< // std::endl; //count[m_iter.GetClassLabel()]++; - ++m_iter ; + ++m_iter; } /*for(int i=0;i<16;i++) @@ -181,10 +181,10 @@ int main(int argc, char* argv[] ) std::cout<<" classe: "<< i <<" nb elements= "<<count[i]<<std::endl; }*/ - int nbclass = membershipSample->GetNumberOfClasses() ; + int nbclass = membershipSample->GetNumberOfClasses(); std::cout<< " nb of classes= "<< nbclass << std::endl; - for (int i=0 ; i< nbclass ; i++) + for (int i=0; i< nbclass; i++) { if(membershipSample->GetInternalClassLabel(i)!=-1) { diff --git a/Utilities/otbkml/third_party/zlib-1.2.3.win32/bin/minizip.dll b/Utilities/otbkml/third_party/zlib-1.2.3.win32/bin/minizip.dll old mode 100755 new mode 100644 diff --git a/Utilities/otbkml/third_party/zlib-1.2.3.win32/bin/zlib1.dll b/Utilities/otbkml/third_party/zlib-1.2.3.win32/bin/zlib1.dll old mode 100755 new mode 100644 -- GitLab