From: Vivien Delmon Date: Wed, 30 Nov 2011 09:45:50 +0000 (+0100) Subject: Remove warnings X-Git-Tag: v1.3.0~159 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=7f7c290c75d4917446f8751856ae7d450f58a6f0;p=clitk.git Remove warnings - Remove warnings with -Wall It remains some warning about gengetopt generated files - Use ImageDimension instead of 3 in some filters --- diff --git a/common/clitkFilterBase.txx b/common/clitkFilterBase.txx index d6c028e..fe175e1 100644 --- a/common/clitkFilterBase.txx +++ b/common/clitkFilterBase.txx @@ -70,7 +70,7 @@ void clitk::FilterBase::StopCurrentStep(typename TInternalImageType::Pointer p, clitk::PrintMemory(GetVerboseMemoryFlag(), "End of step"); if (GetVerboseImageSizeFlag()) { std::ostream & os = std::cout; - int dim = p->GetImageDimension(); + unsigned int dim = p->GetImageDimension(); int nb = 1; os << txt << " size = "; for(unsigned int i=0; i(m_FileName.c_str()); int offset=0; - AVSType field=UNIFORM; + // AVSType field=UNIFORM; for (i=0; i ::CalculateProjectionMatrix( void ) { - InputSpacingType inputSpacing=this->GetInput()->GetSpacing(); + //InputSpacingType inputSpacing=this->GetInput()->GetSpacing(); // Projection on YZ plane+pixelTrans itk::Matrix temp; @@ -325,7 +325,6 @@ namespace clitk iPoint.Fill(itk::NumericTraits::Zero); OutputIndexType oIndex; ContinuousInputIndexType iIndex; - InputSizeType inputSize=inputPtr->GetLargestPossibleRegion().GetSize(); //Get the first output coordinate oIndex=iterator.GetIndex();//costly but only once a thread diff --git a/itk/clitkComposeVFFilter.txx b/itk/clitkComposeVFFilter.txx index f0bf5a9..5cc5db1 100644 --- a/itk/clitkComposeVFFilter.txx +++ b/itk/clitkComposeVFFilter.txx @@ -116,6 +116,7 @@ namespace clitk // get neighbor index and overlap fraction + bool neighbIndexSupZero = 1; for( dim = 0; dim < ImageDimension; dim++ ) { if ( upper & 1 ) @@ -128,12 +129,14 @@ namespace clitk neighIndex[dim] = baseIndex[dim]; overlap *= 1.0 - distance[dim]; } + if (neighIndex[dim] < 0) + neighbIndexSupZero = 0; upper >>= 1; } //JV shouldn't we verify that the index is not over the upper border instead of zero? // Set neighbor value only if overlap is not zero and index is still in image - if( overlap>0.0 && neighIndex[0]>=0 && neighIndex[1]>=0 && neighIndex[2]>=0 ) + if ( overlap>0.0 && neighbIndexSupZero ) { //what to store? the weighted displacement vector of Input2? totalDisplacement+=m_Input2->GetPixel(neighIndex)*overlap; diff --git a/itk/clitkForwardWarpImageFilter.txx b/itk/clitkForwardWarpImageFilter.txx index 37a76d6..283abe6 100644 --- a/itk/clitkForwardWarpImageFilter.txx +++ b/itk/clitkForwardWarpImageFilter.txx @@ -132,7 +132,7 @@ void HelperClass1::Thread //Get pointer to the output typename OutputImageType::Pointer outputPtr = this->GetOutput(); - typename OutputImageType::SizeType size=outputPtr->GetLargestPossibleRegion().GetSize(); + //typename OutputImageType::SizeType size=outputPtr->GetLargestPossibleRegion().GetSize(); //Iterators over input and deformation field typedef itk::ImageRegionConstIteratorWithIndex InputImageIteratorType; diff --git a/itk/clitkInvertVFFilter.txx b/itk/clitkInvertVFFilter.txx index 6bda75e..600775c 100644 --- a/itk/clitkInvertVFFilter.txx +++ b/itk/clitkInvertVFFilter.txx @@ -119,7 +119,7 @@ void HelperClass1::ThreadedGenerateData(const O //Get pointer to the output typename OutputImageType::Pointer outputPtr = this->GetOutput(); - typename OutputImageType::SizeType size=outputPtr->GetLargestPossibleRegion().GetSize(); + //typename OutputImageType::SizeType size=outputPtr->GetLargestPossibleRegion().GetSize(); //Iterator over input typedef itk::ImageRegionConstIteratorWithIndex InputImageIteratorType; @@ -178,7 +178,7 @@ void HelperClass1::ThreadedGenerateData(const O upper = counter; // each bit indicates upper/lower neighbour // get neighbor index and overlap fraction - for( dim = 0; dim < 3; dim++ ) { + for( dim = 0; dim < ImageDimension; dim++ ) { if ( upper & 1 ) { neighIndex[dim] = baseIndex[dim] + 1; overlap *= distance[dim]; @@ -398,7 +398,6 @@ template void InvertVFFilter::Zero; //Allocate the weights diff --git a/itk/clitkRelativePositionAnalyzerFilter.txx b/itk/clitkRelativePositionAnalyzerFilter.txx index 8313766..df12ea3 100644 --- a/itk/clitkRelativePositionAnalyzerFilter.txx +++ b/itk/clitkRelativePositionAnalyzerFilter.txx @@ -101,8 +101,6 @@ void clitk::RelativePositionAnalyzerFilter:: GenerateData() { - static const unsigned int dim = ImageType::ImageDimension; - ImagePointer temp = dynamic_cast(itk::ProcessObject::GetInput(0)); m_Object = dynamic_cast(itk::ProcessObject::GetInput(1)); m_Target = dynamic_cast(itk::ProcessObject::GetInput(2)); diff --git a/itk/clitkRelativePositionDataBase.cxx b/itk/clitkRelativePositionDataBase.cxx index 1512e4c..9ae6dd9 100644 --- a/itk/clitkRelativePositionDataBase.cxx +++ b/itk/clitkRelativePositionDataBase.cxx @@ -167,7 +167,6 @@ namespace clitk { std::vector & RelativePositionDataBase::GetListOfPatients(const IndexType & index) const { const MapByPatientType & o = GetMapByPatient(index); - MapByPatientType::const_iterator iter = o.begin(); std::vector * v = new std::vector; MapToVecFirst(o, *v); return *v; @@ -223,7 +222,7 @@ namespace clitk { bool RelativePositionDataBase::CheckIndex(const IndexType & index) const { try { - const RelativePositionInformationType & m = GetInformation(index); + /*const RelativePositionInformationType & m = */ GetInformation(index); } catch (clitk::ExceptionObject e) { // std::cout << e.what() << std::endl; return false; diff --git a/itk/clitkRelativePositionDataBaseAnalyzerFilter.txx b/itk/clitkRelativePositionDataBaseAnalyzerFilter.txx index 28f3bd0..68d2a2b 100644 --- a/itk/clitkRelativePositionDataBaseAnalyzerFilter.txx +++ b/itk/clitkRelativePositionDataBaseAnalyzerFilter.txx @@ -56,7 +56,7 @@ Update() // Loop over objects std::vector m_ListOfThresholds; - for(int i=0; i:: GenerateData() { // Load database of anatomical elements - static const unsigned int dim = ImageType::ImageDimension; this->LoadAFDB(); // Get some information @@ -97,7 +96,7 @@ GenerateData() // Build the list of tested directions m_ListOfAngles.clear(); - for(uint i=0; i180) a = 180-a; m_ListOfAngles.push_back(clitk::deg2rad(a)); @@ -114,7 +113,7 @@ GenerateData() for (int i=0; iGetAFDB()->template GetImage (GetObjectName(i)); - for (int j=0; jGetLargestPossibleRegion(); - typename FixedImageType::RegionType::SizeType metricRegionSize=metricRegion.GetSize(); typename FixedImageType::RegionType::IndexType metricRegionIndex=metricRegion.GetIndex(); typename FixedImageType::PointType metricRegionOrigin=fixedImage->GetOrigin(); diff --git a/registration/clitkShapedBLUTSpatioTemporalDeformableTransform.txx b/registration/clitkShapedBLUTSpatioTemporalDeformableTransform.txx index ea10c73..a5db85a 100644 --- a/registration/clitkShapedBLUTSpatioTemporalDeformableTransform.txx +++ b/registration/clitkShapedBLUTSpatioTemporalDeformableTransform.txx @@ -1058,7 +1058,6 @@ namespace clitk typename CoefficientImageType::RegionType sourceRegion=m_PaddedCoefficientImage->GetLargestPossibleRegion(); typename CoefficientImageType::RegionType destinationRegion=m_PaddedCoefficientImage->GetLargestPossibleRegion(); typename CoefficientImageType::RegionType::SizeType sourceSize=sourceRegion.GetSize(); - typename CoefficientImageType::RegionType::SizeType destinationSize=destinationRegion.GetSize(); typename CoefficientImageType::IndexType sourceIndex=sourceRegion.GetIndex(); typename CoefficientImageType::IndexType destinationIndex=destinationRegion.GetIndex(); diff --git a/segmentation/clitkExtractLymphStation_Supports.txx b/segmentation/clitkExtractLymphStation_Supports.txx index fa640a2..430d6a9 100644 --- a/segmentation/clitkExtractLymphStation_Supports.txx +++ b/segmentation/clitkExtractLymphStation_Supports.txx @@ -33,7 +33,7 @@ ExtractStationSupports() // Read all support limits in a file and apply them ReadSupportLimits(GetSupportLimitsFilename()); - for(int i=0; iGetSpacing()[2]); diff --git a/segmentation/clitkExtractLymphStationsFilter.txx b/segmentation/clitkExtractLymphStationsFilter.txx index 68b81ee..98768b2 100644 --- a/segmentation/clitkExtractLymphStationsFilter.txx +++ b/segmentation/clitkExtractLymphStationsFilter.txx @@ -205,10 +205,10 @@ CheckForStation(std::string station) // Check if station already exist in DB // FIXME -> do nothing if not on the command line. Is it what I want ? - bool found = false; + //bool found = false; if (this->GetAFDB()->TagExist(s)) { m_ListOfStations[station] = this->GetAFDB()->template GetImage(s); - found = true; + //found = true; } } diff --git a/segmentation/clitkMorphoMathFilter.txx b/segmentation/clitkMorphoMathFilter.txx index 2eb3a02..8b380c8 100644 --- a/segmentation/clitkMorphoMathFilter.txx +++ b/segmentation/clitkMorphoMathFilter.txx @@ -117,6 +117,7 @@ GenerateOutputInformation() // Define the images //--------------------------------- ImagePointer m_input = dynamic_cast(itk::ProcessObject::GetInput(0)); + const unsigned int dim = ImageType::ImageDimension; //--------------------------------- // Cast into internalimagetype @@ -131,7 +132,7 @@ GenerateOutputInformation() // Compute the radius in pixel //--------------------------------- if (m_RadiusInMMIsSet) { - for(uint i=0; iGetSpacing()[i]); } } @@ -145,7 +146,7 @@ GenerateOutputInformation() padFilter->SetInput(input); typename ImageType::SizeType lower; typename ImageType::SizeType upper; - for(uint i=0; i<3; i++) { + for(uint i=0; iSetPadLowerBound(lower); diff --git a/segmentation/clitkStructuresExtractionFilter.txx b/segmentation/clitkStructuresExtractionFilter.txx index 1562bea..3a3e0ab 100644 --- a/segmentation/clitkStructuresExtractionFilter.txx +++ b/segmentation/clitkStructuresExtractionFilter.txx @@ -50,7 +50,7 @@ clitk::StructuresExtractionFilter:: ApplyRelativePositionList(std::string name, MaskImageType * input) { // Create all RelativePositionList - for(int i=0; iSetAFDB(GetAFDB()); rpl->Read(mListOfRelativePositionListFilename[i]); diff --git a/tools/clitkMedianImageGenericFilter.txx b/tools/clitkMedianImageGenericFilter.txx index fac4b9c..d168869 100644 --- a/tools/clitkMedianImageGenericFilter.txx +++ b/tools/clitkMedianImageGenericFilter.txx @@ -98,9 +98,8 @@ MedianImageGenericFilter::UpdateWithInputImageType() typename MedianImageFilterType::Pointer thresholdFilter=MedianImageFilterType::New(); thresholdFilter->SetInput(input); - indexRadius[0]=mArgsInfo.radius_arg[0]; - indexRadius[1]=mArgsInfo.radius_arg[1]; - indexRadius[2]=mArgsInfo.radius_arg[2]; + for (unsigned i = 0; i < InputImageType::ImageDimension; ++i) + indexRadius[i]=mArgsInfo.radius_arg[i]; // indexRadius[0] = 1; // indexRadius[1] = 1; diff --git a/tools/clitkRelativePositionDataBaseBuilderGenericFilter.txx b/tools/clitkRelativePositionDataBaseBuilderGenericFilter.txx index 6ce6a2a..a6bba29 100644 --- a/tools/clitkRelativePositionDataBaseBuilderGenericFilter.txx +++ b/tools/clitkRelativePositionDataBaseBuilderGenericFilter.txx @@ -67,7 +67,7 @@ SetOptionsFromArgsInfoToFilter(FilterType * f) f->SetAreaLossTolerance(mArgsInfo.tol_arg); f->SetSupportName(mArgsInfo.supportName_arg); f->SetTargetName(mArgsInfo.targetName_arg); - for(int i=0; iAddObjectName(mArgsInfo.objectName_arg[i]); } //--------------------------------------------------------------------