@@ -1543,44 +1543,58 @@ \section{The auto Keyword}
1543
1543
\section {Initialization and Assignment }
1544
1544
\label {sec:IniitalizationAndAssignment }
1545
1545
1546
- All member variables must be initialized in the class constructor. For such
1547
- purpose, initialization lists are preferred
1546
+ All member variables must be initialized when they are declared. For such
1547
+ purpose, brace initializers, e.g.
1548
+
1549
+ \small
1550
+ \begin {minted }[baselinestretch=1,fontsize=\footnotesize ,linenos=false,bgcolor=ltgray]{cpp}
1551
+ private:
1552
+ double m_InnerRadius{ 1.0 };
1553
+ double m_Thickness{ 1.0 };
1554
+ bool m_Normalize{ false };
1555
+ bool m_BrightCenter{ false };
1556
+ PixelType m_InteriorValue{ NumericTraits<PixelType>::ZeroValue() };
1557
+ PixelType m_AnnulusValue{ NumericTraits<PixelType>::OneValue() };
1558
+ PixelType m_ExteriorValue{ NumericTraits<PixelType>::ZeroValue() };
1559
+ SpacingType m_Spacing{ 1.0 };
1560
+ \end {minted }
1561
+ \normalsize
1562
+
1563
+ and brace list initialization, e.g.
1564
+
1565
+ \small
1566
+ \begin {minted }[baselinestretch=1,fontsize=\footnotesize ,linenos=false,bgcolor=ltgray]{cpp}
1567
+ private:
1568
+ IndexType m_Index = { { 0 } };
1569
+ SizeType m_Size = { { 0 } };
1570
+ \end {minted }
1571
+ \normalsize
1572
+
1573
+ are preferred over initialization lists in the method constructor, e.g.
1548
1574
1549
1575
\small
1550
1576
\begin {minted }[baselinestretch=1,fontsize=\footnotesize ,linenos=false,bgcolor=ltgray]{cpp}
1551
1577
template <typename TInputImage, typename TOutputImage>
1552
- SpecializedFilter<TInputImage, TOutputImage>
1553
- ::SpecializedFilter() :
1554
- m_ForegroundValue(NumericTraits<InputImagePixelType>::max()),
1555
- m_BackgroundValue(NumericTraits<InputImagePixelType>::ZeroValue()),
1556
- m_NumPixelComponents(0),
1557
- m_NoiseSigmaIsSet(false),
1558
- m_SearchSpaceList(ListAdaptorType::New())
1578
+ SpecializedFilter<TInputImage, TOutputImage>::SpecializedFilter()
1579
+ : m_BackgroundValue(NumericTraits<OutputImagePixelType>::ZeroValue())
1580
+ , m_ForegroundValue(NumericTraits<OutputImagePixelType>::OneValue())
1559
1581
{
1560
- // By default, turn off automatic kernel bandwidth sigma estimation
1561
- this->KernelBandwidthEstimationOff();
1582
+ ...
1562
1583
}
1563
1584
\end {minted }
1564
1585
\normalsize
1565
1586
1566
- over assignment:
1587
+ or assignment:
1567
1588
1568
1589
\small
1569
1590
\begin {minted }[baselinestretch=1,fontsize=\footnotesize ,linenos=false,bgcolor=ltgray]{cpp}
1570
1591
template <typename TInputImage, typename TOutputImage>
1571
- SpecializedFilter<TInputImage, TOutputImage>
1572
- ::SpecializedFilter()
1592
+ SpecializedFilter<TInputImage, TOutputImage>::SpecializedFilter()
1573
1593
{
1574
- m_ForegroundValue = NumericTraits<InputImagePixelType>::max();
1575
- m_BackgroundValue = NumericTraits<InputImagePixelType>::ZeroValue();
1576
-
1577
- m_NumPixelComponents = 0;
1578
- m_UseSmoothDiscPatchWeights = false;
1579
-
1580
- m_SearchSpaceList = ListAdaptorType::New();
1594
+ m_BackgroundValue = NumericTraits<OutputImagePixelType>::ZeroValue();
1595
+ m_ForegroundValue = NumericTraits<OutputImagePixelType>::OneValue();
1581
1596
1582
- // By default, turn off automatic kernel bandwidth sigma estimation
1583
- this->KernelBandwidthEstimationOff();
1597
+ ...
1584
1598
}
1585
1599
\end {minted }
1586
1600
\normalsize
@@ -2464,13 +2478,12 @@ \subsection{Alignment}
2464
2478
2465
2479
\small
2466
2480
\begin {minted }[baselinestretch=1,fontsize=\footnotesize ,linenos=false,bgcolor=ltgray]{cpp}
2467
- InputPixelType m_ForegroundValue;
2468
- OutputPixelType m_BackgroundValue;
2481
+ std::string m_FileName;
2482
+ ConstTransformListType m_TransformList;
2483
+ bool m_AppendMode{ false };
2469
2484
2470
- unsigned int m_MaximumIterations;
2471
-
2472
- std::vector<double> m_Sensitivity;
2473
- std::vector<float> m_Overlaps;
2485
+ bool m_UseCompression{ false };
2486
+ typename TransformIOType::Pointer m_TransformIO;
2474
2487
\end {minted }
2475
2488
\normalsize
2476
2489
@@ -2773,26 +2786,26 @@ \subsection{Empty Lines}
2773
2786
*
2774
2787
*=========================================================================*/
2775
2788
2776
- #ifndef itkBoxImageFilter_hxx
2777
- #define itkBoxImageFilter_hxx
2789
+ #ifndef itkSpecializedImageFilter_hxx
2790
+ #define itkSpecializedImageFilter_hxx
2778
2791
2779
- #include "itkBoxImageFilter .h"
2792
+ #include "itkSpecializedImageFilter .h"
2780
2793
#include "itkProgressAccumulator.h"
2781
2794
2782
2795
namespace itk
2783
2796
{
2784
2797
2785
2798
template <typename TInputImage, typename TOutputImage>
2786
- BoxImageFilter <TInputImage, TOutputImage>
2787
- ::BoxImageFilter ()
2799
+ SpecializedImageFilter <TInputImage, TOutputImage>
2800
+ ::SpecializedImageFilter ()
2788
2801
{
2789
- m_Radius.Fill(1); // A good arbitrary starting point.
2802
+ this->DynamicMultiThreadingOn();
2790
2803
}
2791
2804
2792
2805
2793
2806
template <typename TInputImage, typename TOutputImage>
2794
2807
void
2795
- BoxImageFilter <TInputImage, TOutputImage>
2808
+ SpecializedImageFilter <TInputImage, TOutputImage>
2796
2809
::SetRadius(const RadiusType & radius)
2797
2810
{
2798
2811
if (m_Radius != radius)
@@ -2805,7 +2818,7 @@ \subsection{Empty Lines}
2805
2818
2806
2819
template <typename TInputImage, typename TOutputImage>
2807
2820
void
2808
- BoxImageFilter <TInputImage, TOutputImage>
2821
+ SpecializedImageFilter <TInputImage, TOutputImage>
2809
2822
::PrintSelf(std::ostream & os, Indent indent) const
2810
2823
{
2811
2824
Superclass::PrintSelf(os, indent);
@@ -2815,7 +2828,7 @@ \subsection{Empty Lines}
2815
2828
2816
2829
} // end namespace itk
2817
2830
2818
- #endif // itkBoxImageFilter_hxx
2831
+ #endif // itkSpecializedImageFilter_hxx
2819
2832
\end {minted }
2820
2833
\normalsize
2821
2834
@@ -3948,10 +3961,18 @@ \subsection{General Principles}
3948
3961
\small
3949
3962
\begin {minted }[baselinestretch=1,fontsize=\footnotesize ,linenos=false,bgcolor=ltgray]{cpp}
3950
3963
template <typename TInputImage, typename TOutputImage>
3951
- BoxImageFilter<TInputImage, TOutputImage>
3952
- ::BoxImageFilter()
3964
+ void
3965
+ SpecializedImageFilter<TInputImage, TOutputImage>
3966
+ ::SpecializedMethod()
3953
3967
{
3954
- m_Radius.Fill(1); // A good arbitrary starting point.
3968
+ ...
3969
+
3970
+ OutputVectorRealType lambda11 = -(x1 * v1) / ((x - x1) * v1); // upper left
3971
+ OutputVectorRealType lambda12 = -(x1 * v2) / ((x - x1) * v2); // upper right
3972
+ OutputVectorRealType lambda21 = -(x2 * v1) / ((x - x2) * v1); // lower left
3973
+ OutputVectorRealType lambda22 = -(x2 * v2) / ((x - x2) * v2); // lower right
3974
+
3975
+ ...
3955
3976
}
3956
3977
\end {minted }
3957
3978
\normalsize
0 commit comments