Skip to content

Commit

Permalink
STYLE: Use default member initialization
Browse files Browse the repository at this point in the history
Converts a default constructor’s member initializers into the new
default member initializers in C++11. Other member initializers that match the
default member initializer are removed. This can reduce repeated code or allow
use of ‘= default’.
  • Loading branch information
hjmjohnson authored and dzenanz committed Feb 5, 2022
1 parent 48cc9e5 commit ac4c234
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ class ITK_TEMPLATE_EXPORT ComplexToComplex1DFFTImageFilter : public ImageToImage

/** Direction in which the filter is to be applied
* this should be in the range [0,ImageDimension-1]. */
unsigned int m_Direction;
unsigned int m_Direction{ 0 };

/** Direction to apply the transform (forward/inverse). */
TransformDirectionType m_TransformDirection;
TransformDirectionType m_TransformDirection{ DIRECT };

private:
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ namespace itk
{
template <typename TInputImage, typename TOutputImage>
ComplexToComplex1DFFTImageFilter<TInputImage, TOutputImage>::ComplexToComplex1DFFTImageFilter()
: m_Direction(0)
, m_TransformDirection(DIRECT)
{}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ class ITK_TEMPLATE_EXPORT FFTWComplexToComplex1DFFTImageFilter
void
DestroyPlans();

bool m_PlanComputed;
bool m_PlanComputed{ false };
PlanArrayType m_PlanArray;
unsigned int m_LastImageSize;
unsigned int m_LastImageSize{ 0 };
PlanBufferPointerType m_InputBufferArray;
PlanBufferPointerType m_OutputBufferArray;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ namespace itk

template <typename TInputImage, typename TOutputImage>
FFTWComplexToComplex1DFFTImageFilter<TInputImage, TOutputImage>::FFTWComplexToComplex1DFFTImageFilter()
: m_PlanComputed(false)
, m_LastImageSize(0)

{
// We cannot split over the FFT direction
this->m_ImageRegionSplitter = ImageRegionSplitterDirection::New();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ class ITK_TEMPLATE_EXPORT FFTWForward1DFFTImageFilter : public Forward1DFFTImage
void
DestroyPlans();

bool m_PlanComputed;
bool m_PlanComputed{ false };
PlanArrayType m_PlanArray;
unsigned int m_LastImageSize;
unsigned int m_LastImageSize{ 0 };
PlanBufferPointerType m_InputBufferArray;
PlanBufferPointerType m_OutputBufferArray;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ namespace itk

template <typename TInputImage, typename TOutputImage>
FFTWForward1DFFTImageFilter<TInputImage, TOutputImage>::FFTWForward1DFFTImageFilter()
: m_PlanComputed(false)
, m_LastImageSize(0)

{
// We cannot split over the FFT direction
this->m_ImageRegionSplitter = ImageRegionSplitterDirection::New();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ class ITK_TEMPLATE_EXPORT FFTWInverse1DFFTImageFilter : public Inverse1DFFTImage
void
DestroyPlans();

bool m_PlanComputed;
bool m_PlanComputed{ false };
PlanArrayType m_PlanArray;
unsigned int m_LastImageSize;
unsigned int m_LastImageSize{ 0 };
PlanBufferPointerType m_InputBufferArray;
PlanBufferPointerType m_OutputBufferArray;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ namespace itk

template <typename TInputImage, typename TOutputImage>
FFTWInverse1DFFTImageFilter<TInputImage, TOutputImage>::FFTWInverse1DFFTImageFilter()
: m_PlanComputed(false)
, m_LastImageSize(0)

{
// We cannot split over the FFT direction
this->m_ImageRegionSplitter = ImageRegionSplitterDirection::New();
Expand Down
2 changes: 1 addition & 1 deletion Modules/Filtering/FFT/include/itkForward1DFFTImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class ITK_TEMPLATE_EXPORT Forward1DFFTImageFilter : public ImageToImageFilter<TI
private:
/** Direction in which the filter is to be applied
* this should be in the range [0,ImageDimension-1]. */
unsigned int m_Direction;
unsigned int m_Direction{ 0 };
};
} // namespace itk

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace itk
{
template <typename TInputImage, typename TOutputImage>
Forward1DFFTImageFilter<TInputImage, TOutputImage>::Forward1DFFTImageFilter()
: m_Direction(0)

{}


Expand Down
2 changes: 1 addition & 1 deletion Modules/Filtering/FFT/include/itkInverse1DFFTImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class ITK_TEMPLATE_EXPORT Inverse1DFFTImageFilter : public ImageToImageFilter<TI

/** Direction in which the filter is to be applied
* this should be in the range [0,ImageDimension-1]. */
unsigned int m_Direction;
unsigned int m_Direction{ 0 };

private:
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace itk
{
template <typename TInputImage, typename TOutputImage>
Inverse1DFFTImageFilter<TInputImage, TOutputImage>::Inverse1DFFTImageFilter()
: m_Direction(0)

{}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,14 @@ class ITK_TEMPLATE_EXPORT MatchCardinalityImageToImageMetric : public ImageToIma
};

private:
bool m_MeasureMatches;
// default to measure percentage of pixel matches
bool m_MeasureMatches{ true };
std::vector<MeasureType> m_ThreadMatches;
std::vector<SizeValueType> m_ThreadCounts;

/** Support processing data in multiple threads. Used by subclasses
* (e.g., ImageSource). */
MultiThreaderBase::Pointer m_Threader;
MultiThreaderBase::Pointer m_Threader{ MultiThreaderBase::New() };
};
} // end namespace itk

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ template <typename TFixedImage, typename TMovingImage>
MatchCardinalityImageToImageMetric<TFixedImage, TMovingImage>::MatchCardinalityImageToImageMetric()
{
this->SetComputeGradient(false); // don't use the default gradients
m_MeasureMatches = true; // default to measure percentage of pixel
// matches

m_Threader = MultiThreaderBase::New();
}

/*
Expand Down

0 comments on commit ac4c234

Please sign in to comment.