diff --git a/Common/OpenCL/ITKimprovements/itkGPUInPlaceImageFilter.hxx b/Common/OpenCL/ITKimprovements/itkGPUInPlaceImageFilter.hxx index 8068c194d..4437a5448 100644 --- a/Common/OpenCL/ITKimprovements/itkGPUInPlaceImageFilter.hxx +++ b/Common/OpenCL/ITKimprovements/itkGPUInPlaceImageFilter.hxx @@ -78,9 +78,7 @@ GPUInPlaceImageFilter::AllocateOu { // if we cannot cast the input to an output type, then allocate // an output usual. - OutputImagePointer outputPtr; - - outputPtr = this->GetOutput(0); + OutputImagePointer outputPtr = this->GetOutput(0); outputPtr->SetBufferedRegion(outputPtr->GetRequestedRegion()); outputPtr->Allocate(); } diff --git a/Common/OpenCL/ITKimprovements/itkOpenCLContext.cxx b/Common/OpenCL/ITKimprovements/itkOpenCLContext.cxx index 2d47063bd..86a21ecb3 100644 --- a/Common/OpenCL/ITKimprovements/itkOpenCLContext.cxx +++ b/Common/OpenCL/ITKimprovements/itkOpenCLContext.cxx @@ -352,8 +352,7 @@ OpenCLContext::Create(const OpenCLContext::CreateMethod method) } else if (method == OpenCLContext::MultipleMaximumFlopsDevices) { - std::list devices; - devices = OpenCLDevice::GetMaximumFlopsDevices(OpenCLDevice::GPU); + std::list devices = OpenCLDevice::GetMaximumFlopsDevices(OpenCLDevice::GPU); if (!devices.empty()) { this->CreateContext(devices, d); diff --git a/Common/OpenCL/ITKimprovements/itkOpenCLEvent.cxx b/Common/OpenCL/ITKimprovements/itkOpenCLEvent.cxx index ce3a57db1..52f59442d 100644 --- a/Common/OpenCL/ITKimprovements/itkOpenCLEvent.cxx +++ b/Common/OpenCL/ITKimprovements/itkOpenCLEvent.cxx @@ -77,8 +77,7 @@ OpenCLEvent::GetStatus() const return CL_INVALID_EVENT; } - cl_int st, error; - error = clGetEventInfo(m_Id, CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(st), &st, 0); + cl_int st, error = clGetEventInfo(m_Id, CL_EVENT_COMMAND_EXECUTION_STATUS, sizeof(st), &st, 0); if (error != CL_SUCCESS) { return error; diff --git a/Common/itkMultiOrderBSplineDecompositionImageFilter.hxx b/Common/itkMultiOrderBSplineDecompositionImageFilter.hxx index e4d635c3a..bdfccc77c 100644 --- a/Common/itkMultiOrderBSplineDecompositionImageFilter.hxx +++ b/Common/itkMultiOrderBSplineDecompositionImageFilter.hxx @@ -403,8 +403,7 @@ MultiOrderBSplineDecompositionImageFilter::EnlargeOut // this filter requires the all of the output image to be in // the buffer - TOutputImage * imgData; - imgData = dynamic_cast(output); + TOutputImage * imgData = dynamic_cast(output); if (imgData) { imgData->SetRequestedRegionToLargestPossibleRegion(); diff --git a/Components/Metrics/GradientDifference/itkGradientDifferenceImageToImageMetric2.hxx b/Components/Metrics/GradientDifference/itkGradientDifferenceImageToImageMetric2.hxx index 781910695..fe9781880 100644 --- a/Components/Metrics/GradientDifference/itkGradientDifferenceImageToImageMetric2.hxx +++ b/Components/Metrics/GradientDifference/itkGradientDifferenceImageToImageMetric2.hxx @@ -453,8 +453,7 @@ void GradientDifferenceImageToImageMetric::GetDerivative(const ParametersType & parameters, DerivativeType & derivative) const { - ParametersType testPoint; - testPoint = parameters; + ParametersType testPoint = parameters; const unsigned int numberOfParameters = this->GetNumberOfParameters(); derivative.set_size(numberOfParameters); diff --git a/Components/Metrics/KNNGraphAlphaMutualInformation/KNN/itkANNFixedRadiusTreeSearch.hxx b/Components/Metrics/KNNGraphAlphaMutualInformation/KNN/itkANNFixedRadiusTreeSearch.hxx index 3a3ff915e..05fbdcff9 100644 --- a/Components/Metrics/KNNGraphAlphaMutualInformation/KNN/itkANNFixedRadiusTreeSearch.hxx +++ b/Components/Metrics/KNNGraphAlphaMutualInformation/KNN/itkANNFixedRadiusTreeSearch.hxx @@ -52,11 +52,9 @@ ANNFixedRadiusTreeSearch::Search(const MeasurementVectorType & qp, double sqRad = this->m_SquaredRadius; /** Allocate memory for ANN indices and distances arrays. */ - ANNIndexArrayType ANNIndices; - ANNIndices = new ANNIndexType[k]; + ANNIndexArrayType ANNIndices = new ANNIndexType[k]; - ANNDistanceArrayType ANNDistances; - ANNDistances = new ANNDistanceType[k]; + ANNDistanceArrayType ANNDistances = new ANNDistanceType[k]; /** Alocate memory for ANN query point and copy qp to it. */ ANNPointType ANNQueryPoint = annAllocPt(dim); @@ -101,11 +99,9 @@ ANNFixedRadiusTreeSearch::Search(const MeasurementVectorType & qp, double eps = this->m_ErrorBound; /** Allocate memory for ANN indices and distances arrays. */ - ANNIndexArrayType ANNIndices; - ANNIndices = new ANNIndexType[k]; + ANNIndexArrayType ANNIndices = new ANNIndexType[k]; - ANNDistanceArrayType ANNDistances; - ANNDistances = new ANNDistanceType[k]; + ANNDistanceArrayType ANNDistances = new ANNDistanceType[k]; /** Alocate memory for ANN query point and copy qp to it. */ ANNPointType ANNQueryPoint = annAllocPt(dim); diff --git a/Components/Metrics/KNNGraphAlphaMutualInformation/KNN/itkANNPriorityTreeSearch.hxx b/Components/Metrics/KNNGraphAlphaMutualInformation/KNN/itkANNPriorityTreeSearch.hxx index 66dda545c..79e737531 100644 --- a/Components/Metrics/KNNGraphAlphaMutualInformation/KNN/itkANNPriorityTreeSearch.hxx +++ b/Components/Metrics/KNNGraphAlphaMutualInformation/KNN/itkANNPriorityTreeSearch.hxx @@ -96,11 +96,9 @@ ANNPriorityTreeSearch::Search(const MeasurementVectorType & qp, double eps = this->m_ErrorBound; /** Allocate memory for ANN indices and distances arrays. */ - ANNIndexArrayType ANNIndices; - ANNIndices = new ANNIndexType[k]; + ANNIndexArrayType ANNIndices = new ANNIndexType[k]; - ANNDistanceArrayType ANNDistances; - ANNDistances = new ANNDistanceType[k]; + ANNDistanceArrayType ANNDistances = new ANNDistanceType[k]; /** Alocate memory for ANN query point and copy qp to it. */ ANNPointType ANNQueryPoint = annAllocPt(dim); diff --git a/Components/Metrics/KNNGraphAlphaMutualInformation/KNN/itkANNStandardTreeSearch.hxx b/Components/Metrics/KNNGraphAlphaMutualInformation/KNN/itkANNStandardTreeSearch.hxx index 2beea5bf3..bd7087a6b 100644 --- a/Components/Metrics/KNNGraphAlphaMutualInformation/KNN/itkANNStandardTreeSearch.hxx +++ b/Components/Metrics/KNNGraphAlphaMutualInformation/KNN/itkANNStandardTreeSearch.hxx @@ -50,11 +50,9 @@ ANNStandardTreeSearch::Search(const MeasurementVectorType & qp, double eps = this->m_ErrorBound; /** Allocate memory for ANN indices and distances arrays. */ - ANNIndexArrayType ANNIndices; - ANNIndices = new ANNIndexType[k]; + ANNIndexArrayType ANNIndices = new ANNIndexType[k]; - ANNDistanceArrayType ANNDistances; - ANNDistances = new ANNDistanceType[k]; + ANNDistanceArrayType ANNDistances = new ANNDistanceType[k]; /** Alocate memory for ANN query point and copy qp to it. */ ANNPointType ANNQueryPoint = annAllocPt(dim); diff --git a/Components/Metrics/NormalizedGradientCorrelation/itkNormalizedGradientCorrelationImageToImageMetric.hxx b/Components/Metrics/NormalizedGradientCorrelation/itkNormalizedGradientCorrelationImageToImageMetric.hxx index 0be7cace4..36f6ed9af 100644 --- a/Components/Metrics/NormalizedGradientCorrelation/itkNormalizedGradientCorrelationImageToImageMetric.hxx +++ b/Components/Metrics/NormalizedGradientCorrelation/itkNormalizedGradientCorrelationImageToImageMetric.hxx @@ -417,8 +417,7 @@ NormalizedGradientCorrelationImageToImageMetric::GetD const ParametersType & parameters, DerivativeType & derivative) const { - ParametersType testPoint; - testPoint = parameters; + ParametersType testPoint = parameters; const unsigned int numberOfParameters = this->GetNumberOfParameters(); derivative.set_size(numberOfParameters); diff --git a/Components/Metrics/PCAMetric2/itkPCAMetric2.hxx b/Components/Metrics/PCAMetric2/itkPCAMetric2.hxx index 451327cb1..eb11aec96 100644 --- a/Components/Metrics/PCAMetric2/itkPCAMetric2.hxx +++ b/Components/Metrics/PCAMetric2/itkPCAMetric2.hxx @@ -470,8 +470,7 @@ PCAMetric2::GetValueAndDerivative(const ParametersTyp /** Sub components of metric derivative */ vnl_diag_matrix dSdmu_part1(lastDimSize); - unsigned int startSamplesOK; - startSamplesOK = 0; + unsigned int startSamplesOK = 0; for (unsigned int d = 0; d < lastDimSize; ++d) { diff --git a/Components/Metrics/PatternIntensity/itkPatternIntensityImageToImageMetric.hxx b/Components/Metrics/PatternIntensity/itkPatternIntensityImageToImageMetric.hxx index 2df6dfadf..a4b410918 100644 --- a/Components/Metrics/PatternIntensity/itkPatternIntensityImageToImageMetric.hxx +++ b/Components/Metrics/PatternIntensity/itkPatternIntensityImageToImageMetric.hxx @@ -369,8 +369,7 @@ void PatternIntensityImageToImageMetric::GetDerivative(const ParametersType & parameters, DerivativeType & derivative) const { - ParametersType testPoint; - testPoint = parameters; + ParametersType testPoint = parameters; const unsigned int numberOfParameters = this->GetNumberOfParameters(); derivative.set_size(numberOfParameters); diff --git a/Components/Optimizers/SimultaneousPerturbation/elxSimultaneousPerturbation.hxx b/Components/Optimizers/SimultaneousPerturbation/elxSimultaneousPerturbation.hxx index 0c4c8a4d7..14a4697bb 100644 --- a/Components/Optimizers/SimultaneousPerturbation/elxSimultaneousPerturbation.hxx +++ b/Components/Optimizers/SimultaneousPerturbation/elxSimultaneousPerturbation.hxx @@ -202,9 +202,7 @@ void SimultaneousPerturbation::AfterRegistration() { /** Print the best metric value */ - double bestValue; - - bestValue = this->GetValue(); + double bestValue = this->GetValue(); log::info(std::ostringstream{} << '\n' << "Final metric value = " << bestValue); } // end AfterRegistration diff --git a/Components/Transforms/BSplineDeformableTransformWithDiffusion/elxBSplineTransformWithDiffusion.hxx b/Components/Transforms/BSplineDeformableTransformWithDiffusion/elxBSplineTransformWithDiffusion.hxx index dd970d01a..452cf83d1 100644 --- a/Components/Transforms/BSplineDeformableTransformWithDiffusion/elxBSplineTransformWithDiffusion.hxx +++ b/Components/Transforms/BSplineDeformableTransformWithDiffusion/elxBSplineTransformWithDiffusion.hxx @@ -610,8 +610,8 @@ BSplineTransformWithDiffusion::SetInitialGrid(bool upsampleGridOption) OriginType gridorigin; /** Get the fixed image. */ - typename FixedImageType::Pointer fixedimage; - fixedimage = const_cast(this->m_Registration->GetAsITKBaseType()->GetFixedImage()); + typename FixedImageType::Pointer fixedimage = + const_cast(this->m_Registration->GetAsITKBaseType()->GetFixedImage()); /** Get the size etc. of this image. */ @@ -693,8 +693,8 @@ BSplineTransformWithDiffusion::IncreaseScale() // OriginType gridoriginLow = this->m_BSplineTransform->GetGridOrigin(); /** Get the fixed image. */ - typename FixedImageType::Pointer fixedimage; - fixedimage = const_cast(this->m_Registration->GetAsITKBaseType()->GetFixedImage()); + typename FixedImageType::Pointer fixedimage = + const_cast(this->m_Registration->GetAsITKBaseType()->GetFixedImage()); /** Set start values for computing the new grid size. */ RegionType gridregionHigh = fixedimage->GetLargestPossibleRegion(); diff --git a/Components/Transforms/BSplineDeformableTransformWithDiffusion/itkVectorMeanDiffusionImageFilter.hxx b/Components/Transforms/BSplineDeformableTransformWithDiffusion/itkVectorMeanDiffusionImageFilter.hxx index dc9b03e53..41bc11857 100644 --- a/Components/Transforms/BSplineDeformableTransformWithDiffusion/itkVectorMeanDiffusionImageFilter.hxx +++ b/Components/Transforms/BSplineDeformableTransformWithDiffusion/itkVectorMeanDiffusionImageFilter.hxx @@ -69,8 +69,7 @@ VectorMeanDiffusionImageFilter::GenerateInputReque // get a copy of the input requested region (should equal the output // requested region) - typename TInputImage::RegionType inputRequestedRegion; - inputRequestedRegion = inputPtr->GetRequestedRegion(); + typename TInputImage::RegionType inputRequestedRegion = inputPtr->GetRequestedRegion(); // pad the input requested region by the operator radius inputRequestedRegion.PadByRadius(this->m_Radius); diff --git a/Testing/elxImageCompare.cxx b/Testing/elxImageCompare.cxx index b0b4eb2b1..98cb5e9f8 100644 --- a/Testing/elxImageCompare.cxx +++ b/Testing/elxImageCompare.cxx @@ -118,10 +118,8 @@ main(int argc, char ** argv) } // The sizes of the baseline and test image must match - ImageType::SizeType baselineSize; - baselineSize = baselineReader->GetOutput()->GetLargestPossibleRegion().GetSize(); - ImageType::SizeType testSize; - testSize = testReader->GetOutput()->GetLargestPossibleRegion().GetSize(); + ImageType::SizeType baselineSize = baselineReader->GetOutput()->GetLargestPossibleRegion().GetSize(); + ImageType::SizeType testSize = testReader->GetOutput()->GetLargestPossibleRegion().GetSize(); if (baselineSize != testSize) {