Skip to content

Commit fcddc74

Browse files
author
Simon Rit
committed
COMP: Define PointType according to rtk::QuadricShape definition
The definition changed with RTKConsortium/RTK#841
1 parent 8040eb4 commit fcddc74

11 files changed

Lines changed: 42 additions & 34 deletions

include/pctEnergyAdaptiveMLPFunction.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,13 @@ class PCT_EXPORT EnergyAdaptiveMLPFunction : public MostLikelyPathFunction<doubl
113113
itkNewMacro(Self);
114114

115115
/** Useful defines. */
116+
using PointType = Superclass::PointType;
116117
using VectorType = Superclass::VectorType;
117118

118119
/* Initialize the MLP estimator */
119120
virtual void
120-
Init(const VectorType posIn,
121-
const VectorType posOut,
121+
Init(const PointType posIn,
122+
const PointType posOut,
122123
const VectorType dirIn,
123124
const VectorType dirOut,
124125
double eIn,

include/pctMostLikelyPathFunction.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
# include <itkTimeProbe.h>
1111
#endif
1212

13+
#include <rtkQuadricShape.h>
14+
1315
namespace pct
1416
{
1517

@@ -29,19 +31,21 @@ class ITK_TEMPLATE_EXPORT MostLikelyPathFunction : public itk::LightObject
2931
using ConstPointer = itk::SmartPointer<const Self>;
3032

3133
/** Useful defines. */
34+
// PointType definition based on rtk::QuadricShape to be compatible with RTK 2 and 3
35+
using PointType = rtk::QuadricShape::PointType;
3236
using VectorType = itk::Vector<TCoordRep, 3>;
3337

3438
/** Init the mlp parameters from the input and output directions and positions. */
3539
virtual void
36-
Init(const VectorType posIn, const VectorType posOut, const VectorType dirIn, const VectorType dirOut)
40+
Init(const PointType posIn, const PointType posOut, const VectorType dirIn, const VectorType dirOut)
3741
{
3842
itkGenericExceptionMacro("This version of the Init method not implemented for derived class.");
3943
}
4044

4145
/** Init the mlp parameters from the input and output directions and positions, and energies. */
4246
virtual void
43-
Init(const VectorType posIn,
44-
const VectorType posOut,
47+
Init(const PointType posIn,
48+
const PointType posOut,
4549
const VectorType dirIn,
4650
const VectorType dirOut,
4751
double eIn,
@@ -52,8 +56,8 @@ class ITK_TEMPLATE_EXPORT MostLikelyPathFunction : public itk::LightObject
5256

5357
/** Init with additional parameters to consider tracker uncertainties */
5458
virtual void
55-
InitUncertain(const VectorType posIn,
56-
const VectorType posOut,
59+
InitUncertain(const PointType posIn,
60+
const PointType posOut,
5761
const VectorType dirIn,
5862
const VectorType dirOut,
5963
double dEntry,

include/pctPolynomialMLPFunction.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,12 @@ class PCT_EXPORT PolynomialMLPFunction : public MostLikelyPathFunction<double>
149149
itkNewMacro(Self);
150150

151151
/** Useful defines. */
152+
using PointType = Superclass::PointType;
152153
using VectorType = Superclass::VectorType;
153154

154155
/** Init the mlp parameters from the input and output directions and positions. */
155156
virtual void
156-
Init(const VectorType posIn, const VectorType posOut, const VectorType dirIn, const VectorType dirOut) override;
157+
Init(const PointType posIn, const PointType posOut, const VectorType dirIn, const VectorType dirOut) override;
157158

158159
/* Vectorised version of Evaluate function. */
159160
virtual void

include/pctProtonPairsToBackProjection.hxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ ProtonPairsToBackProjection<TInputImage, TOutputImage>::GenerateData()
165165
<< 100 * it.GetIndex()[1] / outputRegionForThread.GetSize(1) << "%) in thread 1" << std::flush;
166166
}
167167

168-
VectorType pIn = it.Get();
168+
RQIType::PointType pIn(it.Get());
169169
++it;
170-
VectorType pOut = it.Get();
170+
RQIType::PointType pOut(it.Get());
171171
++it;
172172
VectorType dIn = it.Get();
173173
++it;
@@ -185,9 +185,9 @@ ProtonPairsToBackProjection<TInputImage, TOutputImage>::GenerateData()
185185
++it;
186186

187187
// Move straight to entrance and exit shapes
188-
VectorType pSIn = pIn;
189-
VectorType pSOut = pOut;
190-
double nearDistIn, nearDistOut, farDistIn, farDistOut;
188+
RQIType::PointType pSIn = pIn;
189+
RQIType::PointType pSOut = pOut;
190+
double nearDistIn, nearDistOut, farDistIn, farDistOut;
191191
if (m_QuadricIn.GetPointer() != NULL)
192192
{
193193
if (m_QuadricIn->IsIntersectedByRay(pIn, dIn, nearDistIn, farDistIn) &&

include/pctProtonPairsToDistanceDrivenProjection.hxx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,9 @@ ProtonPairsToDistanceDrivenProjection<TInputImage, TOutputImage>::ThreadedGenera
190190
<< 100 * it.GetIndex()[1] / region.GetSize(1) << "%) in thread 1" << std::flush;
191191
}
192192

193-
VectorType pIn = it.Get();
193+
RQIType::PointType pIn(it.Get());
194194
++it;
195-
VectorType pOut = it.Get();
195+
RQIType::PointType pOut(it.Get());
196196
++it;
197197
VectorType dIn = it.Get();
198198
++it;
@@ -257,11 +257,11 @@ ProtonPairsToDistanceDrivenProjection<TInputImage, TOutputImage>::ThreadedGenera
257257
// Move straight to entrance and exit shapes
258258

259259

260-
VectorType pSIn = pIn;
261-
VectorType pSOut = pOut;
262-
double nearDistIn, nearDistOut, farDistIn, farDistOut;
263-
double distanceEntry, distanceExit;
264-
bool QuadricIntersected = false;
260+
RQIType::PointType pSIn = pIn;
261+
RQIType::PointType pSOut = pOut;
262+
double nearDistIn, nearDistOut, farDistIn, farDistOut;
263+
double distanceEntry, distanceExit;
264+
bool QuadricIntersected = false;
265265
if (m_QuadricIn.GetPointer() != NULL)
266266
{
267267
if (m_QuadricIn->IsIntersectedByRay(pIn, dIn, nearDistIn, farDistIn) &&

include/pctSchulteMLPFunction.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,17 @@ class PCT_EXPORT SchulteMLPFunction : public MostLikelyPathFunction<double>
150150
itkNewMacro(Self);
151151

152152
/** Useful defines. */
153+
using PointType = Superclass::PointType;
153154
using VectorType = Superclass::VectorType;
154155

155156
/** Init the mlp parameters from the input and output directions and positions. */
156157
virtual void
157-
Init(const VectorType posIn, const VectorType posOut, const VectorType dirIn, const VectorType dirOut) override;
158+
Init(const PointType posIn, const PointType posOut, const VectorType dirIn, const VectorType dirOut) override;
158159

159160
/** Init with additional parameters to consider tracker uncertainties */
160161
virtual void
161-
InitUncertain(const VectorType posIn,
162-
const VectorType posOut,
162+
InitUncertain(const PointType posIn,
163+
const PointType posOut,
163164
const VectorType dirIn,
164165
const VectorType dirOut,
165166
double dEntry,

include/pctThirdOrderPolynomialMLPFunction.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ class ITK_TEMPLATE_EXPORT ThirdOrderPolynomialMLPFunction : public MostLikelyPat
2525
itkNewMacro(Self);
2626

2727
/** Useful defines. */
28+
using PointType = typename Superclass::PointType;
2829
using VectorType = typename Superclass::VectorType;
2930

3031
/** Init the mlp parameters from the input and output directions and positions. */
3132
virtual void
32-
Init(const VectorType posIn, const VectorType posOut, const VectorType dirIn, const VectorType dirOut) override;
33+
Init(const PointType posIn, const PointType posOut, const VectorType dirIn, const VectorType dirOut) override;
3334

3435
/** Evaluate the coordinates (x,y) at depth z. */
3536
virtual void

include/pctThirdOrderPolynomialMLPFunction.hxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ namespace pct
33

44
template <class TCoordRep>
55
void
6-
ThirdOrderPolynomialMLPFunction<TCoordRep>::Init(const VectorType posIn,
7-
const VectorType posOut,
6+
ThirdOrderPolynomialMLPFunction<TCoordRep>::Init(const PointType posIn,
7+
const PointType posOut,
88
const VectorType dirIn,
99
const VectorType dirOut)
1010
{

src/pctEnergyAdaptiveMLPFunction.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ EnergyAdaptiveMLPFunction ::EnergyAdaptiveMLPFunction()
2929
}
3030

3131
void
32-
EnergyAdaptiveMLPFunction ::Init(const VectorType posIn,
33-
const VectorType posOut,
32+
EnergyAdaptiveMLPFunction ::Init(const PointType posIn,
33+
const PointType posOut,
3434
const VectorType dirIn,
3535
const VectorType dirOut,
3636
double eIn,

src/pctPolynomialMLPFunction.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ PolynomialMLPFunction ::SetPolynomialDegree(const int polydeg)
7676
}
7777

7878
void
79-
PolynomialMLPFunction ::Init(const VectorType posIn,
80-
const VectorType posOut,
79+
PolynomialMLPFunction ::Init(const PointType posIn,
80+
const PointType posOut,
8181
const VectorType dirIn,
8282
const VectorType dirOut)
8383
{

0 commit comments

Comments
 (0)