Skip to content

Commit 0f0c94c

Browse files
committed
STYLE: SpeedFunctionToPathFilter improvements
1 parent da5002a commit 0f0c94c

File tree

4 files changed

+14
-44
lines changed

4 files changed

+14
-44
lines changed

include/itkSingleImageCostFunction.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ class ITK_EXPORT SingleImageCostFunction :
115115
itkGetConstReferenceMacro( DerivativeThreshold, DerivativeType::ValueType );
116116

117117
/** Initialize the cost function */
118-
virtual void Initialize(void);
118+
virtual void Initialize();
119119

120120
/** Return the number of parameters required by the Transform */
121-
unsigned int GetNumberOfParameters(void) const override
121+
unsigned int GetNumberOfParameters() const override
122122
{ return ImageDimension; }
123123

124124
/** This method returns the value of the cost function corresponding
@@ -141,7 +141,7 @@ class ITK_EXPORT SingleImageCostFunction :
141141
m_OutsideValue = itk::NumericTraits< ImagePixelType >::NonpositiveMin();
142142
}
143143

144-
144+
145145
protected:
146146
SingleImageCostFunction();
147147
~SingleImageCostFunction() override {}
@@ -155,7 +155,7 @@ class ITK_EXPORT SingleImageCostFunction :
155155
* path points are on the edge of an image */
156156
ImagePixelType m_OutsideValue;
157157
typename DerivativeType::ValueType m_DerivativeThreshold;
158-
158+
159159
};
160160

161161
} // end namespace itk

include/itkSingleImageCostFunction.hxx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@
2323
namespace itk
2424
{
2525

26-
/*
27-
* Constructor
28-
*/
2926
template <class TImage>
3027
SingleImageCostFunction<TImage>
3128
::SingleImageCostFunction()
@@ -37,13 +34,10 @@ SingleImageCostFunction<TImage>
3734
}
3835

3936

40-
/*
41-
* Initialize
42-
*/
4337
template <class TImage>
4438
void
4539
SingleImageCostFunction<TImage>
46-
::Initialize(void)
40+
::Initialize()
4741
{
4842
// Ensure image is provided
4943
if( !m_Image )

include/itkSpeedFunctionToPathFilter.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace itk
3232
* For each end- and way-point, a Fast Marching arrival function is
3333
* computed. The minimal path is extracted for each segment and
3434
* concatenated to obtain the total path between the start- and
35-
* end-points, while passing near the given way-points
35+
* end-points, while passing near the given way-points
3636
* (according to the TerminationValue of ArrivalFunctionToPathFilter).
3737
*
3838
* The user must provide the following:
@@ -47,7 +47,7 @@ namespace itk
4747
* with default settings. Other suitable optimizers include
4848
* GradientDescentOptimizer and IterateNeighborhoodOptimizer.
4949
* See itkArrivalFunctionToPathFilter.h for more details.
50-
* Note, that the path finding terminates early if the optimizer
50+
* Note, that the path finding terminates early if the optimizer
5151
* runs out of the image bounds, possibly depending on the speed function.
5252
*
5353
* This filter is based on the methods described in:
@@ -162,7 +162,7 @@ class ITK_EXPORT SpeedFunctionToPathFilter :
162162
void PrintSelf( std::ostream& os, Indent indent ) const override;
163163

164164
/** Implemention of algorithm. */
165-
void GenerateData( void ) override;
165+
void GenerateData( ) override;
166166

167167
/** Get the number of paths which the user has instructed to extracted. */
168168
unsigned int GetNumberOfPathsToExtract( ) const override;

include/itkSpeedFunctionToPathFilter.hxx

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -26,30 +26,21 @@
2626
namespace itk
2727
{
2828

29-
/**
30-
*
31-
*/
3229
template <typename TInputImage, typename TOutputPath>
3330
SpeedFunctionToPathFilter<TInputImage,TOutputPath>
34-
::SpeedFunctionToPathFilter()
31+
::SpeedFunctionToPathFilter():
32+
m_CurrentArrivalFunction( nullptr )
3533
{
36-
m_CurrentArrivalFunction = nullptr;
3734
}
3835

3936

40-
/**
41-
*
42-
*/
4337
template <typename TInputImage, typename TOutputPath>
4438
SpeedFunctionToPathFilter<TInputImage,TOutputPath>
4539
::~SpeedFunctionToPathFilter()
4640
{
4741
}
4842

4943

50-
/**
51-
*
52-
*/
5344
template<typename TInputImage, typename TOutputPath>
5445
unsigned int
5546
SpeedFunctionToPathFilter<TInputImage,TOutputPath>
@@ -59,9 +50,6 @@ SpeedFunctionToPathFilter<TInputImage,TOutputPath>
5950
}
6051

6152

62-
/**
63-
*
64-
*/
6553
template<typename TInputImage, typename TOutputPath>
6654
const typename SpeedFunctionToPathFilter<TInputImage,TOutputPath>::PointsContainerType &
6755
SpeedFunctionToPathFilter<TInputImage,TOutputPath>
@@ -71,9 +59,6 @@ SpeedFunctionToPathFilter<TInputImage,TOutputPath>
7159
}
7260

7361

74-
/**
75-
*
76-
*/
7762
template<typename TInputImage, typename TOutputPath>
7863
typename SpeedFunctionToPathFilter<TInputImage,TOutputPath>::InputImageType *
7964
SpeedFunctionToPathFilter<TInputImage,TOutputPath>
@@ -101,7 +86,7 @@ SpeedFunctionToPathFilter<TInputImage,TOutputPath>
10186
using IndexTypeVec = std::vector < IndexType >;
10287
IndexTypeVec PrevIndexVec(0);
10388

104-
89+
10590
typename NodeContainer::Pointer targets = NodeContainer::New();
10691
targets->Initialize();
10792

@@ -115,7 +100,7 @@ SpeedFunctionToPathFilter<TInputImage,TOutputPath>
115100
targets->InsertElement( 0, nodeTargetPrevious );
116101
PrevIndexVec.push_back(indexTargetPrevious);
117102
}
118-
103+
119104
for (auto it = NextFront.begin(); it != NextFront.end(); it++)
120105
{
121106
IndexType indexTargetNext;
@@ -176,19 +161,16 @@ SpeedFunctionToPathFilter<TInputImage,TOutputPath>
176161
m_CurrentArrivalFunction->SetPixel(*vi, 0);
177162
}
178163
}
179-
164+
180165
m_Information[Superclass::m_CurrentOutput]->Advance();
181166
return m_CurrentArrivalFunction;
182167
}
183168

184169

185-
/**
186-
*
187-
*/
188170
template <typename TInputImage, typename TOutputPath>
189171
void
190172
SpeedFunctionToPathFilter<TInputImage,TOutputPath>
191-
::GenerateData( void )
173+
::GenerateData( )
192174
{
193175
// Get the speed function
194176
InputImagePointer speed =
@@ -209,9 +191,6 @@ SpeedFunctionToPathFilter<TInputImage,TOutputPath>
209191
}
210192

211193

212-
/**
213-
*
214-
*/
215194
template <typename TInputImage, typename TOutputPath>
216195
void
217196
SpeedFunctionToPathFilter<TInputImage,TOutputPath>
@@ -275,9 +254,6 @@ SpeedFunctionToPathFilter<TInputImage,TOutputPath>
275254
}
276255

277256

278-
/**
279-
*
280-
*/
281257
template<typename TInputImage, typename TOutputPath>
282258
void
283259
SpeedFunctionToPathFilter<TInputImage,TOutputPath>

0 commit comments

Comments
 (0)