Skip to content

Commit f777886

Browse files
committed
STYLE: Improve readability, fit conventions
1 parent 791e6b8 commit f777886

File tree

6 files changed

+103
-107
lines changed

6 files changed

+103
-107
lines changed

include/itkSpeedFunctionPathInformation.h

Lines changed: 33 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,36 @@
11
/*=========================================================================
22
3-
Program: Insight Segmentation & Registration Toolkit
4-
Module: $RCSfile: itkSpeedFunctionPathInformation.h,v $
5-
Language: C++
6-
Date: $Date$
7-
Version: $Revision$
8-
9-
Copyright (c) Insight Software Consortium. All rights reserved.
10-
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11-
12-
This software is distributed WITHOUT ANY WARRANTY; without even
13-
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14-
PURPOSE. See the above copyright notices for more information.
3+
* Copyright Insight Software Consortium
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0.txt
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
17+
18+
* Program: Insight Segmentation & Registration Toolkit
19+
* Module: $RCSfile: itkSpeedFunctionPathInformation.h,v $
20+
* Language: C++
21+
* Date: $Date$
22+
* Version: $Revision$
23+
24+
* Copyright (c) Insight Software Consortium. All rights reserved.
25+
* See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
26+
27+
* This software is distributed WITHOUT ANY WARRANTY; without even
28+
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
29+
* PURPOSE. See the above copyright notices for more information.
1530
1631
=========================================================================*/
17-
#ifndef __itkSpeedFunctionPathInformation_h
18-
#define __itkSpeedFunctionPathInformation_h
32+
#ifndef itkSpeedFunctionPathInformation_h
33+
#define itkSpeedFunctionPathInformation_h
1934

2035
#include "itkLightObject.h"
2136

@@ -37,12 +52,12 @@ namespace itk
3752
* \author Dan Mueller,
3853
* Queensland University of Technology, dan.muel[at]gmail.com
3954
*
40-
* \sa itkLightObject
55+
* \sa LightObject
4156
*
4257
* \ingroup MinimalPathExtraction
4358
*/
4459

45-
template <class TPoint>
60+
template <typename TPoint>
4661
class SpeedFunctionPathInformation :
4762
public LightObject
4863
{
@@ -76,7 +91,7 @@ class SpeedFunctionPathInformation :
7691

7792
const PointType & GetEndPoint( ) const;
7893

79-
const PointType & GetWayPoint( unsigned int i ) const;
94+
const PointType & GetWayPoint( SizeValueType i ) const;
8095

8196
bool HasNextFront( ) const;
8297

@@ -95,7 +110,7 @@ class SpeedFunctionPathInformation :
95110
virtual void PrintSelf( std::ostream& os, Indent indent ) const;
96111

97112
std::vector< PointType > m_Info;
98-
unsigned int m_Front;
113+
SizeValueType m_Front;
99114

100115

101116
private:

include/itkSpeedFunctionPathInformation.hxx

Lines changed: 61 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,59 @@
11
/*=========================================================================
22
3-
Program: Insight Segmentation & Registration Toolkit
4-
Module: $RCSfile: itkSpeedFunctionPathInformation.hxx,v $
5-
Language: C++
6-
Date: $Date$
7-
Version: $Revision$
8-
9-
Copyright (c) Insight Software Consortium. All rights reserved.
10-
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11-
12-
This software is distributed WITHOUT ANY WARRANTY; without even
13-
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14-
PURPOSE. See the above copyright notices for more information.
3+
* Copyright Insight Software Consortium
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0.txt
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
17+
18+
* Program: Insight Segmentation & Registration Toolkit
19+
* Module: $RCSfile: itkSpeedFunctionPathInformation.hxx,v $
20+
* Language: C++
21+
* Date: $Date$
22+
* Version: $Revision$
23+
24+
* Copyright (c) Insight Software Consortium. All rights reserved.
25+
* See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
26+
27+
* This software is distributed WITHOUT ANY WARRANTY; without even
28+
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
29+
* PURPOSE. See the above copyright notices for more information.
1530
1631
=========================================================================*/
1732

18-
#ifndef __itkSpeedFunctionPathInformation_hxx
19-
#define __itkSpeedFunctionPathInformation_hxx
33+
#ifndef itkSpeedFunctionPathInformation_hxx
34+
#define itkSpeedFunctionPathInformation_hxx
2035

2136
#include "itkSpeedFunctionPathInformation.h"
2237

2338
namespace itk
2439
{
2540

26-
template <class TPoint>
41+
template <typename TPoint>
2742
SpeedFunctionPathInformation<TPoint>
2843
::SpeedFunctionPathInformation()
2944
{
3045
this->ClearInfo();
3146
}
3247

33-
template <class TPoint>
48+
49+
template <typename TPoint>
3450
SpeedFunctionPathInformation<TPoint>
3551
::~SpeedFunctionPathInformation()
3652
{
3753
}
3854

39-
template <class TPoint>
55+
56+
template <typename TPoint>
4057
void SpeedFunctionPathInformation<TPoint>
4158
::ClearInfo()
4259
{
@@ -45,84 +62,95 @@ void SpeedFunctionPathInformation<TPoint>
4562
m_Front = 1;
4663
}
4764

48-
template <class TPoint>
65+
66+
template <typename TPoint>
4967
void SpeedFunctionPathInformation<TPoint>
5068
::SetStartPoint( const PointType & start )
5169
{
5270
m_Info[1] = start;
5371
}
5472

55-
template <class TPoint>
73+
74+
template <typename TPoint>
5675
void SpeedFunctionPathInformation<TPoint>
5776
::SetEndPoint( const PointType & end )
5877
{
5978
m_Info[0] = end;
6079
}
6180

62-
template <class TPoint>
81+
82+
template <typename TPoint>
6383
void SpeedFunctionPathInformation<TPoint>
6484
::AddWayPoint( const PointType & way )
6585
{
6686
m_Info.push_back( way );
6787
m_Front++;
6888
}
6989

70-
template <class TPoint>
90+
91+
template <typename TPoint>
7192
unsigned int SpeedFunctionPathInformation<TPoint>
7293
::GetNumberOfPoints( ) const
7394
{
7495
return m_Info.size();
7596
}
7697

77-
template <class TPoint>
98+
99+
template <typename TPoint>
78100
const typename SpeedFunctionPathInformation<TPoint>::PointType &
79101
SpeedFunctionPathInformation<TPoint>
80102
::GetStartPoint( ) const
81103
{
82104
return m_Info[1];
83105
}
84106

85-
template <class TPoint>
107+
108+
template <typename TPoint>
86109
const typename SpeedFunctionPathInformation<TPoint>::PointType &
87110
SpeedFunctionPathInformation<TPoint>
88111
::GetEndPoint( ) const
89112
{
90113
return m_Info[0];
91114
}
92115

93-
template <class TPoint>
116+
117+
template <typename TPoint>
94118
const typename SpeedFunctionPathInformation<TPoint>::PointType &
95119
SpeedFunctionPathInformation<TPoint>
96-
::GetWayPoint( unsigned int i ) const
120+
::GetWayPoint( SizeValueType i ) const
97121
{
98122
return m_Info[2+i];
99123
}
100124

101-
template <class TPoint>
125+
126+
template <typename TPoint>
102127
bool SpeedFunctionPathInformation<TPoint>
103128
::HasNextFront( ) const
104129
{
105130
return m_Front >= 1;
106131

107132
}
108133

109-
template <class TPoint>
134+
135+
template <typename TPoint>
110136
const typename SpeedFunctionPathInformation<TPoint>::PointType &
111137
SpeedFunctionPathInformation<TPoint>
112138
::GetCurrentFrontAndAdvance( )
113139
{
114140
return m_Info[m_Front--];
115141
}
116142

117-
template <class TPoint>
143+
144+
template <typename TPoint>
118145
const typename SpeedFunctionPathInformation<TPoint>::PointType &
119146
SpeedFunctionPathInformation<TPoint>
120147
::PeekCurrentFront( ) const
121148
{
122149
return m_Info[m_Front];
123150
}
124151

125-
template <class TPoint>
152+
153+
template <typename TPoint>
126154
const typename SpeedFunctionPathInformation<TPoint>::PointType &
127155
SpeedFunctionPathInformation<TPoint>
128156
::PeekNextFront( ) const
@@ -137,7 +165,8 @@ SpeedFunctionPathInformation<TPoint>
137165
}
138166
}
139167

140-
template <class TPoint>
168+
169+
template <typename TPoint>
141170
const typename SpeedFunctionPathInformation<TPoint>::PointType &
142171
SpeedFunctionPathInformation<TPoint>
143172
::PeekPreviousFront( ) const
@@ -152,10 +181,8 @@ SpeedFunctionPathInformation<TPoint>
152181
}
153182
}
154183

155-
/**
156-
*
157-
*/
158-
template<class TPoint>
184+
185+
template<typename TPoint>
159186
void SpeedFunctionPathInformation<TPoint>
160187
::PrintSelf(std::ostream& os, Indent indent) const
161188
{

include/itkSpeedFunctionToPathFilter.h

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class ITK_EXPORT SpeedFunctionToPathFilter :
103103
typedef typename Superclass::OptimizerType OptimizerType;
104104

105105
/** Path information typedef. */
106-
typedef SpeedFunctionPathInformation<PointType> PathInfo;
106+
typedef SpeedFunctionPathInformation<PointType> PathInformation;
107107

108108
/** Override superclass behaviour.
109109
* Warning: SetPathEndPoint() is not valid for this filter.
@@ -132,55 +132,9 @@ class ITK_EXPORT SpeedFunctionToPathFilter :
132132
itkWarningMacro("ClearPathEndPoints() is not valid for this filter. Use ClearPathInfo() instead.");
133133
}
134134

135-
// /** PathInfo class for encapsulating information about a path.
136-
// * The points are stored as follows: end, start, way0, way1, way2, ..., wayN.
137-
// * Fronts are propagated in reverse order: wayN, ..., way2, way1, way0, start.
138-
// * (NOTE: a front is never propagated from end). */
139-
// class PathInfo
140-
// {
141-
// public:
142-
// PathInfo()
143-
// { this->ClearInfo(); }
144-
// void ClearInfo()
145-
// { m_Info.clear(); m_Info.resize(2); m_Front = 1; }
146-
// void SetStartPoint( const PointType & start )
147-
// { m_Info[1] = start; }
148-
// void SetEndPoint( const PointType & end )
149-
// { m_Info[0] = end; }
150-
// void AddWayPoint( const PointType & way )
151-
// { m_Info.push_back( way ); m_Front++; }
152-
// unsigned int GetNumberOfPoints( ) const
153-
// { return m_Info.size(); }
154-
// const PointType & GetStartPoint( ) const
155-
// { return m_Info[1]; }
156-
// const PointType & GetEndPoint( ) const
157-
// { return m_Info[0]; }
158-
// const PointType & GetWayPoint( unsigned int i ) const
159-
// { return m_Info[2+i]; }
160-
// bool HasNextFront( ) const
161-
// { return m_Front >= 1; }
162-
// const PointType & GetCurrentFrontAndAdvance( )
163-
// { return m_Info[m_Front--]; }
164-
// const PointType & PeekCurrentFront( )
165-
// { return m_Info[m_Front]; }
166-
// const PointType & PeekNextFront( )
167-
// {
168-
// if ( m_Front <= 1 ) return m_Info[1];
169-
// else return m_Info[m_Front-1];
170-
// }
171-
// const PointType & PeekPreviousFront( )
172-
// {
173-
// if ( m_Front == m_Info.size()-1 ) return m_Info[0];
174-
// else return m_Info[m_Front+1];
175-
// }
176-
// private:
177-
// std::vector< PointType > m_Info;
178-
// unsigned int m_Front;
179-
// };
180-
181135
/** Add a path information object to process.
182136
* At least one PathInfo object must be added before processing. */
183-
void AddPathInfo(PathInfo * info )
137+
void AddPathInfo(PathInformation * info )
184138
{
185139
m_Info.push_back( info );
186140
}
@@ -211,7 +165,7 @@ class ITK_EXPORT SpeedFunctionToPathFilter :
211165
/** Override handling of optimizer iteration events to accomodate way points. */
212166
virtual const PointType & GetNextEndPoint( );
213167

214-
std::vector< typename PathInfo::Pointer > m_Info;
168+
std::vector< typename PathInformation::Pointer > m_Info;
215169
InputImagePointer m_CurrentArrivalFunction;
216170

217171
private:

include/itkSpeedFunctionToPathFilter.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "vnl/vnl_math.h"
2222
#include "itkSpeedFunctionToPathFilter.h"
2323
#include "itkFastMarchingUpwindGradientImageFilter.h"
24-
#include "itkImageFileWriter.h"
24+
2525

2626

2727
namespace itk

0 commit comments

Comments
 (0)