Skip to content

Commit

Permalink
STYLE: Replace T var; var = x with T var = x
Browse files Browse the repository at this point in the history
- Following ITK pull request InsightSoftwareConsortium/ITK#4973
  • Loading branch information
N-Dekker committed Nov 22, 2024
1 parent f67d1f8 commit 5fe285e
Show file tree
Hide file tree
Showing 15 changed files with 24 additions and 46 deletions.
4 changes: 1 addition & 3 deletions Common/OpenCL/ITKimprovements/itkGPUInPlaceImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ GPUInPlaceImageFilter<TInputImage, TOutputImage, TParentImageFilter>::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();
}
Expand Down
3 changes: 1 addition & 2 deletions Common/OpenCL/ITKimprovements/itkOpenCLContext.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,7 @@ OpenCLContext::Create(const OpenCLContext::CreateMethod method)
}
else if (method == OpenCLContext::MultipleMaximumFlopsDevices)
{
std::list<OpenCLDevice> devices;
devices = OpenCLDevice::GetMaximumFlopsDevices(OpenCLDevice::GPU);
std::list<OpenCLDevice> devices = OpenCLDevice::GetMaximumFlopsDevices(OpenCLDevice::GPU);
if (!devices.empty())
{
this->CreateContext(devices, d);
Expand Down
3 changes: 1 addition & 2 deletions Common/OpenCL/ITKimprovements/itkOpenCLEvent.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions Common/itkMultiOrderBSplineDecompositionImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,7 @@ MultiOrderBSplineDecompositionImageFilter<TInputImage, TOutputImage>::EnlargeOut

// this filter requires the all of the output image to be in
// the buffer
TOutputImage * imgData;
imgData = dynamic_cast<TOutputImage *>(output);
TOutputImage * imgData = dynamic_cast<TOutputImage *>(output);
if (imgData)
{
imgData->SetRequestedRegionToLargestPossibleRegion();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,7 @@ void
GradientDifferenceImageToImageMetric<TFixedImage, TMovingImage>::GetDerivative(const ParametersType & parameters,
DerivativeType & derivative) const
{
ParametersType testPoint;
testPoint = parameters;
ParametersType testPoint = parameters;
const unsigned int numberOfParameters = this->GetNumberOfParameters();
derivative.set_size(numberOfParameters);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,9 @@ ANNFixedRadiusTreeSearch<TBinaryTree>::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);
Expand Down Expand Up @@ -101,11 +99,9 @@ ANNFixedRadiusTreeSearch<TBinaryTree>::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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,9 @@ ANNPriorityTreeSearch<TBinaryTree>::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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,9 @@ ANNStandardTreeSearch<TBinaryTree>::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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,7 @@ NormalizedGradientCorrelationImageToImageMetric<TFixedImage, TMovingImage>::GetD
const ParametersType & parameters,
DerivativeType & derivative) const
{
ParametersType testPoint;
testPoint = parameters;
ParametersType testPoint = parameters;
const unsigned int numberOfParameters = this->GetNumberOfParameters();
derivative.set_size(numberOfParameters);

Expand Down
3 changes: 1 addition & 2 deletions Components/Metrics/PCAMetric2/itkPCAMetric2.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,7 @@ PCAMetric2<TFixedImage, TMovingImage>::GetValueAndDerivative(const ParametersTyp
/** Sub components of metric derivative */
vnl_diag_matrix<DerivativeValueType> dSdmu_part1(lastDimSize);

unsigned int startSamplesOK;
startSamplesOK = 0;
unsigned int startSamplesOK = 0;

for (unsigned int d = 0; d < lastDimSize; ++d)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,7 @@ void
PatternIntensityImageToImageMetric<TFixedImage, TMovingImage>::GetDerivative(const ParametersType & parameters,
DerivativeType & derivative) const
{
ParametersType testPoint;
testPoint = parameters;
ParametersType testPoint = parameters;
const unsigned int numberOfParameters = this->GetNumberOfParameters();
derivative.set_size(numberOfParameters);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,7 @@ void
SimultaneousPerturbation<TElastix>::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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,8 @@ BSplineTransformWithDiffusion<TElastix>::SetInitialGrid(bool upsampleGridOption)
OriginType gridorigin;

/** Get the fixed image. */
typename FixedImageType::Pointer fixedimage;
fixedimage = const_cast<FixedImageType *>(this->m_Registration->GetAsITKBaseType()->GetFixedImage());
typename FixedImageType::Pointer fixedimage =
const_cast<FixedImageType *>(this->m_Registration->GetAsITKBaseType()->GetFixedImage());

/** Get the size etc. of this image. */

Expand Down Expand Up @@ -693,8 +693,8 @@ BSplineTransformWithDiffusion<TElastix>::IncreaseScale()
// OriginType gridoriginLow = this->m_BSplineTransform->GetGridOrigin();

/** Get the fixed image. */
typename FixedImageType::Pointer fixedimage;
fixedimage = const_cast<FixedImageType *>(this->m_Registration->GetAsITKBaseType()->GetFixedImage());
typename FixedImageType::Pointer fixedimage =
const_cast<FixedImageType *>(this->m_Registration->GetAsITKBaseType()->GetFixedImage());

/** Set start values for computing the new grid size. */
RegionType gridregionHigh = fixedimage->GetLargestPossibleRegion();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ VectorMeanDiffusionImageFilter<TInputImage, TGrayValueImage>::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);
Expand Down
6 changes: 2 additions & 4 deletions Testing/elxImageCompare.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 5fe285e

Please sign in to comment.