Skip to content

Commit

Permalink
STYLE: Use auto for variable type matches the type of the initializer…
Browse files Browse the repository at this point in the history
… expression

This check is responsible for using the auto type specifier for variable
declarations to improve code readability and maintainability.

The auto type specifier will only be introduced in situations where the
variable type matches the type of the initializer expression. In other words
auto should deduce the same type that was originally spelled in the source
  • Loading branch information
hjmjohnson committed Feb 17, 2020
1 parent 7a2eea9 commit c809382
Show file tree
Hide file tree
Showing 35 changed files with 62 additions and 62 deletions.
2 changes: 1 addition & 1 deletion applications/rtki0estimation/rtki0estimation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ main(int argc, char * argv[])

int istep = 1;
unsigned int imin = 1;
unsigned int imax = (unsigned int)subsetRegion.GetSize()[2];
auto imax = (unsigned int)subsetRegion.GetSize()[2];
if (args_info.range_given)
{
if ((args_info.range_arg[0] <= args_info.range_arg[2]) &&
Expand Down
4 changes: 2 additions & 2 deletions applications/rtkprojectionmatrix/rtkMatlabSparseMatrix.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ rtk::MatlabSparseMatrix::MatlabSparseMatrix(const vnl_sparse_matrix<double>& spa
//Store elements in std::vector and sort them according 1\ index of column and 2\ index of row
unsigned int nonZeroElement(0);
using sparseMatrixColumn = std::vector<std::pair<unsigned int, double> >;
sparseMatrixColumn* columnsVector = new sparseMatrixColumn[nbColumn];
auto* columnsVector = new sparseMatrixColumn[nbColumn];
sparseMatrix.reset();
while(sparseMatrix.next()) {
typename TOutputImage::IndexType idx = output->ComputeIndex(sparseMatrix.getcolumn());
if(idx[1] != 1)
continue;
unsigned int indexColumn = idx[0] + idx[2]*output->GetLargestPossibleRegion().GetSize()[2];
sparseMatrixColumn::iterator it = columnsVector[indexColumn].begin();
auto it = columnsVector[indexColumn].begin();
while (it != columnsVector[indexColumn].end()) {
if ((unsigned int)sparseMatrix.getrow() < it->first)
break;
Expand Down
4 changes: 2 additions & 2 deletions include/rtkAdditiveGaussianNoiseImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ class NormalVariateNoiseFunctor
operator()(TPixel input)
{
// Get the minimum and maximum output values
static const float min = static_cast<float>(m_OutputMinimum);
static const float max = static_cast<float>(m_OutputMaximum);
static const auto min = static_cast<float>(m_OutputMinimum);
static const auto max = static_cast<float>(m_OutputMaximum);

// Compute the output
float output = static_cast<float>(input) + m_Mean + m_StandardDeviation * m_Generator->GetVariate();
Expand Down
2 changes: 1 addition & 1 deletion include/rtkBackwardDifferenceDivergenceImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ BackwardDifferenceDivergenceImageFilter<TInputImage, TOutputImage>::DynamicThrea
iit.GoToBegin();
iit.OverrideBoundaryCondition(m_BoundaryCondition);

const itk::SizeValueType c = (itk::SizeValueType)(iit.Size() / 2); // get offset of center pixel
const auto c = (itk::SizeValueType)(iit.Size() / 2); // get offset of center pixel
itk::SizeValueType strides[TOutputImage::ImageDimension]; // get offsets to access neighboring pixels
for (unsigned int dim = 0; dim < TOutputImage::ImageDimension; dim++)
{
Expand Down
4 changes: 2 additions & 2 deletions include/rtkDPExtractShroudSignalImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ DPExtractShroudSignalImageFilter<TInputPixel, TOutputPixel>::GenerateData()
from->Allocate();
int amplitudeInVoxel = m_Amplitude / input->GetSpacing()[0];

itk::Array<double> * prev = new itk::Array<double>(inputSize[0]);
itk::Array<double> * curr = new itk::Array<double>(inputSize[0]);
auto * prev = new itk::Array<double>(inputSize[0]);
auto * curr = new itk::Array<double>(inputSize[0]);

typename TInputImage::RegionType::IndexType idx = inputIdx;
for (unsigned i = 0; i < inputSize[0]; ++i)
Expand Down
2 changes: 1 addition & 1 deletion include/rtkDaubechiesWaveletsConvolutionImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ DaubechiesWaveletsConvolutionImageFilter<TImage>::GenerateData()
int dim = TImage::ImageDimension;

// Create a vector holding the coefficients along each direction
CoefficientVector * coeffs = new CoefficientVector[dim];
auto * coeffs = new CoefficientVector[dim];
for (int d = 0; d < dim; d++)
{
if (m_Type == Self::Deconstruct)
Expand Down
2 changes: 1 addition & 1 deletion include/rtkDeconstructImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ DeconstructImageFilter<TImage>::GenerateOutputInformation()

// Cascade pipeline
// Set all the filters and connect them together
unsigned int * downsamplingFactors = new unsigned int[dimension];
auto * downsamplingFactors = new unsigned int[dimension];
for (int d = 0; d < dimension; d++)
downsamplingFactors[d] = 2;

Expand Down
2 changes: 1 addition & 1 deletion include/rtkDrawEllipsoidImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ DrawEllipsoidImageFilter<TInputImage, TOutputImage>::BeforeThreadedGenerateData(
if (this->GetConvexShape() == nullptr)
this->SetConvexShape(QuadricShape::New().GetPointer());
Superclass::BeforeThreadedGenerateData();
QuadricShape * qo = dynamic_cast<QuadricShape *>(this->GetModifiableConvexShape());
auto * qo = dynamic_cast<QuadricShape *>(this->GetModifiableConvexShape());
if (qo == nullptr)
{
itkExceptionMacro("This is not a QuadricShape!");
Expand Down
2 changes: 1 addition & 1 deletion include/rtkFFTProjectionsConvolutionImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ FFTProjectionsConvolutionImageFilter<TInputImage, TOutputImage, TFFTPrecision>::
// call the superclass' implementation of this method
Superclass::GenerateInputRequestedRegion();

InputImageType * input = const_cast<InputImageType *>(this->GetInput());
auto * input = const_cast<InputImageType *>(this->GetInput());
if (!input)
return;

Expand Down
2 changes: 1 addition & 1 deletion include/rtkForwardDifferenceGradientImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ ForwardDifferenceGradientImageFilter<TInputImage, TOperatorValueType, TOuputValu
typename itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<InputImageType>::FaceListType faceList =
bC(inputImage, outputRegionForThread, radius);

typename itk::NeighborhoodAlgorithm::ImageBoundaryFacesCalculator<InputImageType>::FaceListType::iterator fit =
auto fit =
faceList.begin();

// Initialize the x_slice array
Expand Down
4 changes: 2 additions & 2 deletions include/rtkI0EstimationProjectionFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ I0EstimationProjectionFilter<TInputImage, TOutputImage, bitShift>::BeforeThreade
m_Imax = m_MaxPixelValue;
m_Histogram.resize(m_NBins, 0);

std::vector<unsigned int>::iterator it = m_Histogram.begin();
auto it = m_Histogram.begin();

for (; it != m_Histogram.end(); ++it)
{
Expand Down Expand Up @@ -187,7 +187,7 @@ I0EstimationProjectionFilter<TInputImage, TOutputImage, bitShift>::AfterThreaded
// If estimated I0 at the boundaries, either startIdx or Imax then we missed
// smth or no background mode

InputImagePixelType widthval = (InputImagePixelType)(float)(maxVal >> 1);
auto widthval = (InputImagePixelType)(float)(maxVal >> 1);
unsigned int lowBound = maxId;
while ((m_Histogram[lowBound] > widthval) && (lowBound > 0))
{
Expand Down
2 changes: 1 addition & 1 deletion include/rtkJosephBackProjectionImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ JosephBackProjectionImageFilter<TInputImage,
offsets[2] =
this->GetInput(0)->GetBufferedRegion().GetSize()[0] * this->GetInput(0)->GetBufferedRegion().GetSize()[1];

const GeometryType * geometry = dynamic_cast<const GeometryType *>(this->GetGeometry());
const auto * geometry = dynamic_cast<const GeometryType *>(this->GetGeometry());
if (!geometry)
{
itkGenericExceptionMacro(<< "Error, ThreeDCircularProjectionGeometry expected");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ void
LUTbasedVariableI0RawToAttenuationImageFilter<TInputImage, TOutputImage>::BeforeThreadedGenerateData()
{
using I0EstimationType = rtk::I0EstimationProjectionFilter<TInputImage>;
I0EstimationType * i0est = dynamic_cast<I0EstimationType *>(this->GetInput()->GetSource().GetPointer());
auto * i0est = dynamic_cast<I0EstimationType *>(this->GetInput()->GetSource().GetPointer());
if (i0est)
{
m_SubtractLUTFilter->SetConstant1((OutputImagePixelType)log(std::max((double)i0est->GetI0() - m_IDark, 1.)));
Expand Down
2 changes: 1 addition & 1 deletion include/rtkLagCorrectionImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ LagCorrectionImageFilter<TImage, ModelOrder>::ThreadedGenerateData(const ImageRe
unsigned idx_s = (jj + ii) * ModelOrder;

// Get measured pixel value y[k]
float yk = static_cast<float>(itIn.Get());
auto yk = static_cast<float>(itIn.Get());

// Computes correction
float xk = yk; // Initial corrected pixel
Expand Down
2 changes: 1 addition & 1 deletion include/rtkLastDimensionL0GradientDenoisingImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ LastDimensionL0GradientDenoisingImageFilter<TInputImage>::ThreadedGenerateData(

// Walk the input along last dimension for this voxel, filling an array with the values read
itk::ImageRegionConstIterator<TInputImage> inputIterator(this->GetInput(), SingleVoxelRegion);
InputPixelType * toBeRegularized =
auto * toBeRegularized =
new InputPixelType[outputRegionForThread.GetSize(TInputImage::ImageDimension - 1)];

unsigned int i = 0;
Expand Down
2 changes: 1 addition & 1 deletion include/rtkParkerShortScanImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ ParkerShortScanImageFilter<TInputImage, TOutputImage>::DynamicThreadedGenerateDa
// Compute delta between first and last angle where there is weighting required
std::map<double, unsigned int>::const_iterator itLastAngle;
itLastAngle = sortedAngles.find(rotationAngles[maxAngularGapPos]);
std::map<double, unsigned int>::const_iterator itFirstAngle = itLastAngle;
auto itFirstAngle = itLastAngle;
itFirstAngle = (++itFirstAngle == sortedAngles.end()) ? sortedAngles.begin() : itFirstAngle;
const double firstAngle = itFirstAngle->first;
double lastAngle = itLastAngle->first;
Expand Down
2 changes: 1 addition & 1 deletion include/rtkPolynomialGainCorrectionImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ PolynomialGainCorrectionImageFilter<TInputImage, TOutputImage>::GenerateOutputIn
int npixValues = 65536; // Input values are 16-bit unsigned
for (int pid = 0; pid < npixValues; ++pid)
{
float value = static_cast<float>(pid);
auto value = static_cast<float>(pid);
for (int order = 0; order < m_ModelOrder; ++order)
{
m_PowerLut.push_back(value);
Expand Down
34 changes: 17 additions & 17 deletions include/rtkProjectionsReader.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ ProjectionsReader<TOutputImage>::PropagateParametersToMiniPipeline()
{
// Raw
using RawType = typename itk::ImageSeriesReader<TInputImage>;
RawType * raw = dynamic_cast<RawType *>(m_RawDataReader.GetPointer());
auto * raw = dynamic_cast<RawType *>(m_RawDataReader.GetPointer());
assert(raw != nullptr);
raw->SetFileNames(this->GetFileNames());
raw->SetImageIO(m_ImageIO);
Expand All @@ -490,7 +490,7 @@ ProjectionsReader<TOutputImage>::PropagateParametersToMiniPipeline()
else
{
using ChangeInfoType = itk::ChangeInformationImageFilter<TInputImage>;
ChangeInfoType * cif = dynamic_cast<ChangeInfoType *>(m_ChangeInformationFilter.GetPointer());
auto * cif = dynamic_cast<ChangeInfoType *>(m_ChangeInformationFilter.GetPointer());
assert(cif != nullptr);
if (m_Spacing != defaultSpacing)
{
Expand Down Expand Up @@ -524,7 +524,7 @@ ProjectionsReader<TOutputImage>::PropagateParametersToMiniPipeline()
else
{
using CropType = itk::CropImageFilter<TInputImage, TInputImage>;
CropType * crop = dynamic_cast<CropType *>(m_CropFilter.GetPointer());
auto * crop = dynamic_cast<CropType *>(m_CropFilter.GetPointer());
assert(crop != nullptr);
crop->SetLowerBoundaryCropSize(m_LowerBoundaryCropSize);
crop->SetUpperBoundaryCropSize(m_UpperBoundaryCropSize);
Expand All @@ -534,7 +534,7 @@ ProjectionsReader<TOutputImage>::PropagateParametersToMiniPipeline()
}

// Elekta raw data converter
itk::ImageBase<OutputImageDimension> * nextInputBase =
auto * nextInputBase =
dynamic_cast<itk::ImageBase<OutputImageDimension> *>(nextInput);
assert(nextInputBase != nullptr);
ConnectElektaRawFilter(&nextInputBase);
Expand All @@ -553,7 +553,7 @@ ProjectionsReader<TOutputImage>::PropagateParametersToMiniPipeline()
else
{
using ConditionalMedianType = rtk::ConditionalMedianImageFilter<TInputImage>;
ConditionalMedianType * cond = dynamic_cast<ConditionalMedianType *>(m_ConditionalMedianFilter.GetPointer());
auto * cond = dynamic_cast<ConditionalMedianType *>(m_ConditionalMedianFilter.GetPointer());
assert(cond != nullptr);
cond->SetRadius(m_MedianRadius);
cond->SetInput(nextInput);
Expand All @@ -574,7 +574,7 @@ ProjectionsReader<TOutputImage>::PropagateParametersToMiniPipeline()
else
{
using BinType = itk::BinShrinkImageFilter<TInputImage, TInputImage>;
BinType * bin = dynamic_cast<BinType *>(m_BinningFilter.GetPointer());
auto * bin = dynamic_cast<BinType *>(m_BinningFilter.GetPointer());
assert(bin != nullptr);
bin->SetShrinkFactors(m_ShrinkFactors);
bin->SetInput(nextInput);
Expand All @@ -593,7 +593,7 @@ ProjectionsReader<TOutputImage>::PropagateParametersToMiniPipeline()
else
{
using ScatterFilterType = rtk::BoellaardScatterCorrectionImageFilter<TInputImage, TInputImage>;
ScatterFilterType * scatter = dynamic_cast<ScatterFilterType *>(m_ScatterFilter.GetPointer());
auto * scatter = dynamic_cast<ScatterFilterType *>(m_ScatterFilter.GetPointer());
assert(scatter != nullptr);
scatter->SetAirThreshold(m_AirThreshold);
scatter->SetScatterToPrimaryRatio(m_ScatterToPrimaryRatio);
Expand Down Expand Up @@ -627,7 +627,7 @@ ProjectionsReader<TOutputImage>::PropagateParametersToMiniPipeline()
{
// Check if Ora pointer
using OraRawType = rtk::OraLookupTableImageFilter<OutputImageType>;
OraRawType * oraraw = dynamic_cast<OraRawType *>(m_RawToAttenuationFilter.GetPointer());
auto * oraraw = dynamic_cast<OraRawType *>(m_RawToAttenuationFilter.GetPointer());
if (oraraw != nullptr)
{
oraraw->SetComputeLineIntegral(m_ComputeLineIntegral);
Expand Down Expand Up @@ -656,7 +656,7 @@ ProjectionsReader<TOutputImage>::PropagateParametersToMiniPipeline()

// ESRF raw to attenuation converter also needs the filenames
using EdfRawFilterType = rtk::EdfRawToAttenuationImageFilter<TInputImage, OutputImageType>;
EdfRawFilterType * edf = dynamic_cast<EdfRawFilterType *>(m_RawToAttenuationFilter.GetPointer());
auto * edf = dynamic_cast<EdfRawFilterType *>(m_RawToAttenuationFilter.GetPointer());
if (edf)
edf->SetFileNames(this->GetFileNames());

Expand All @@ -681,10 +681,10 @@ ProjectionsReader<TOutputImage>::ConnectElektaRawFilter(itk::ImageBase<OutputIma
{
using ElektaRawType = rtk::ElektaSynergyRawLookupTableImageFilter<itk::Image<unsigned short, OutputImageDimension>,
itk::Image<unsigned short, OutputImageDimension>>;
ElektaRawType * elektaRaw = dynamic_cast<ElektaRawType *>(m_ElektaRawFilter.GetPointer());
auto * elektaRaw = dynamic_cast<ElektaRawType *>(m_ElektaRawFilter.GetPointer());
assert(elektaRaw != nullptr);
using InputImageType = typename itk::Image<unsigned short, OutputImageDimension>;
InputImageType * nextInput = dynamic_cast<InputImageType *>(*nextInputBase);
auto * nextInput = dynamic_cast<InputImageType *>(*nextInputBase);
elektaRaw->SetInput(nextInput);
*nextInputBase = elektaRaw->GetOutput();
}
Expand All @@ -696,37 +696,37 @@ void
ProjectionsReader<TOutputImage>::PropagateI0(itk::ImageBase<OutputImageDimension> ** nextInputBase)
{
using UnsignedShortImageType = itk::Image<unsigned short, OutputImageDimension>;
UnsignedShortImageType * nextInputUShort = dynamic_cast<UnsignedShortImageType *>(*nextInputBase);
auto * nextInputUShort = dynamic_cast<UnsignedShortImageType *>(*nextInputBase);
if (nextInputUShort != nullptr)
{
if (m_I0 == 0)
{
using I0EstimationType = rtk::I0EstimationProjectionFilter<UnsignedShortImageType, UnsignedShortImageType>;
I0EstimationType * i0est = dynamic_cast<I0EstimationType *>(m_I0EstimationFilter.GetPointer());
auto * i0est = dynamic_cast<I0EstimationType *>(m_I0EstimationFilter.GetPointer());
assert(i0est != nullptr);
i0est->SetInput(nextInputUShort);
*nextInputBase = i0est->GetOutput();
}
using I0Type = rtk::LUTbasedVariableI0RawToAttenuationImageFilter<UnsignedShortImageType, OutputImageType>;
I0Type * i0 = dynamic_cast<I0Type *>(m_RawToAttenuationFilter.GetPointer());
auto * i0 = dynamic_cast<I0Type *>(m_RawToAttenuationFilter.GetPointer());
i0->SetI0(m_I0);
i0->SetIDark(m_IDark);
}

using UnsignedIntImageType = itk::Image<unsigned int, OutputImageDimension>;
UnsignedIntImageType * nextInputUInt = dynamic_cast<UnsignedIntImageType *>(*nextInputBase);
auto * nextInputUInt = dynamic_cast<UnsignedIntImageType *>(*nextInputBase);
if (nextInputUInt != nullptr)
{
if (m_I0 == 0)
{
using I0EstimationType = rtk::I0EstimationProjectionFilter<UnsignedIntImageType, UnsignedIntImageType>;
I0EstimationType * i0est = dynamic_cast<I0EstimationType *>(m_I0EstimationFilter.GetPointer());
auto * i0est = dynamic_cast<I0EstimationType *>(m_I0EstimationFilter.GetPointer());
assert(i0est != nullptr);
i0est->SetInput(nextInputUInt);
*nextInputBase = i0est->GetOutput();
}
using I0Type = rtk::VarianObiRawImageFilter<UnsignedIntImageType, OutputImageType>;
I0Type * i0 = dynamic_cast<I0Type *>(m_RawToAttenuationFilter.GetPointer());
auto * i0 = dynamic_cast<I0Type *>(m_RawToAttenuationFilter.GetPointer());
i0->SetI0(m_I0);
i0->SetIDark(m_IDark);
}
Expand Down
4 changes: 2 additions & 2 deletions include/rtkRayBoxIntersectionImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RayBoxIntersectionImageFilter<TInputImage, TOutputImage>::BeforeThreadedGenerate

Superclass::BeforeThreadedGenerateData();

BoxShape * qo = dynamic_cast<BoxShape *>(this->GetModifiableConvexShape());
auto * qo = dynamic_cast<BoxShape *>(this->GetModifiableConvexShape());
if (qo == nullptr)
{
itkExceptionMacro("This is not a BoxShape!");
Expand All @@ -71,7 +71,7 @@ RayBoxIntersectionImageFilter<TInputImage, TOutputImage>::SetBoxFromImage(const
{
if (this->GetConvexShape() == nullptr)
this->SetConvexShape(BoxShape::New().GetPointer());
BoxShape * qo = dynamic_cast<BoxShape *>(this->GetModifiableConvexShape());
auto * qo = dynamic_cast<BoxShape *>(this->GetModifiableConvexShape());
if (qo == nullptr)
{
itkExceptionMacro("This is not a BoxShape!");
Expand Down
2 changes: 1 addition & 1 deletion include/rtkRayEllipsoidIntersectionImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ RayEllipsoidIntersectionImageFilter<TInputImage, TOutputImage>::BeforeThreadedGe
if (this->GetConvexShape() == nullptr)
this->SetConvexShape(QuadricShape::New().GetPointer());
Superclass::BeforeThreadedGenerateData();
QuadricShape * qo = dynamic_cast<QuadricShape *>(this->GetModifiableConvexShape());
auto * qo = dynamic_cast<QuadricShape *>(this->GetModifiableConvexShape());
if (qo == nullptr)
{
itkExceptionMacro("This is not a QuadricShape!");
Expand Down
2 changes: 1 addition & 1 deletion include/rtkRayQuadricIntersectionImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ RayQuadricIntersectionImageFilter<TInputImage, TOutputImage>::BeforeThreadedGene

Superclass::BeforeThreadedGenerateData();

QuadricShape * qo = dynamic_cast<QuadricShape *>(this->GetModifiableConvexShape());
auto * qo = dynamic_cast<QuadricShape *>(this->GetModifiableConvexShape());
if (qo == nullptr)
{
itkExceptionMacro("This is not a QuadricShape!");
Expand Down
2 changes: 1 addition & 1 deletion include/rtkReconstructImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ ReconstructImageFilter<TImage>::GenerateOutputInformation()

// Cascade pipeline
// Set all the filters and connect them together
unsigned int * upsamplingFactors = new unsigned int[dimension];
auto * upsamplingFactors = new unsigned int[dimension];
for (int d = 0; d < dimension; d++)
upsamplingFactors[d] = 2;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ SeparableQuadraticSurrogateRegularizationImageFilter<TImage>::DynamicThreadedGen
itk::ConstNeighborhoodIterator<TImage> nIt(m_Radius, this->GetInput(), outputRegionForThread);

// Precompute the offset of center pixel
itk::SizeValueType c = (itk::SizeValueType)(nIt.Size() / 2);
auto c = (itk::SizeValueType)(nIt.Size() / 2);

// Declare intermediate variables
typename TImage::PixelType diff, out1, out2;
Expand Down
2 changes: 1 addition & 1 deletion include/rtkTotalVariationImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ TotalVariationImageFilter<TInputImage>::ThreadedGenerateData(const RegionType &
itk::ZeroFluxNeumannBoundaryCondition<TInputImage> boundaryCondition;
iit.OverrideBoundaryCondition(&boundaryCondition);

itk::SizeValueType c = (itk::SizeValueType)(iit.Size() / 2); // get offset of center pixel
auto c = (itk::SizeValueType)(iit.Size() / 2); // get offset of center pixel
itk::SizeValueType strides[ImageDimension]; // get offsets to access neighboring pixels
itk::Vector<RealType, ImageDimension> invSpacingCoeffs;
for (unsigned int dim = 0; dim < ImageDimension; dim++)
Expand Down
2 changes: 1 addition & 1 deletion include/rtkVarianObiRawImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void
VarianObiRawImageFilter<TInputImage, TOutputImage>::BeforeThreadedGenerateData()
{
using I0EstimationType = rtk::I0EstimationProjectionFilter<TInputImage>;
I0EstimationType * i0est = dynamic_cast<I0EstimationType *>(this->GetInput()->GetSource().GetPointer());
auto * i0est = dynamic_cast<I0EstimationType *>(this->GetInput()->GetSource().GetPointer());
if (i0est)
{
m_I0 = (double)i0est->GetI0();
Expand Down
Loading

0 comments on commit c809382

Please sign in to comment.