Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions applications/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,23 @@ find_package(Gengetopt REQUIRED)
if(NOT ITK_DIR)
set(ITK_DIR ${ITK_BINARY_DIR}/CMakeTmp)
endif()
find_package(
ITK
REQUIRED
COMPONENTS
${ITK_MODULE_PCT_DEPENDS}
${ITK_MODULE_PCT-Test_DEPENDS}
)
include(${ITK_USE_FILE})
find_package(ITK REQUIRED COMPONENTS ${ITK_MODULE_PCT_DEPENDS})
include(itkVersion)
if("${ITK_VERSION_MAJOR}" VERSION_LESS "6")
include(${ITK_USE_FILE})
set(PCT_APPLICATION_TARGETS ${PCT_LIBRARIES})
else()
itk_generate_factory_registration()
set(
PCT_APPLICATION_TARGETS
ITK::PCTModule
ITK::ITKImageIO
ITK::ITKFFTImageFilterInit
)
endif()

#-----------------------------------------------------------------------------
# Executables
add_subdirectory(pctbackprojectionbinning)
add_subdirectory(pctbinning)
add_subdirectory(pctfdk)
Expand Down
2 changes: 1 addition & 1 deletion applications/pctbackprojectionbinning/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ add_executable(
pctbackprojectionbinning.cxx
${pctbackprojectionbinning_GGO_C}
)
target_link_libraries(pctbackprojectionbinning PCT)
target_link_libraries(pctbackprojectionbinning ${PCT_APPLICATION_TARGETS})

# Ensure binary is placed in the central PCT binary dir
set_target_properties(
Expand Down
2 changes: 1 addition & 1 deletion applications/pctbinning/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ add_executable(
pctbinning.cxx
${pctbinning_GGO_C}
)
target_link_libraries(pctbinning PCT)
target_link_libraries(pctbinning ${PCT_APPLICATION_TARGETS})

# Ensure binary is placed in the central PCT binary dir
set_target_properties(
Expand Down
2 changes: 1 addition & 1 deletion applications/pctfdk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ add_executable(
pctfdk.cxx
${pctfdk_GGO_C}
)
target_link_libraries(pctfdk PCT)
target_link_libraries(pctfdk ${PCT_APPLICATION_TARGETS})

# Ensure binary is placed in the central PCT binary dir
set_target_properties(
Expand Down
2 changes: 1 addition & 1 deletion applications/pctpaircuts/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ add_executable(
pctpaircuts.cxx
${pctpaircuts_GGO_C}
)
target_link_libraries(pctpaircuts PCT)
target_link_libraries(pctpaircuts ${PCT_APPLICATION_TARGETS})

# Ensure binary is placed in the central PCT binary dir
set_target_properties(
Expand Down
2 changes: 1 addition & 1 deletion applications/pctpairgeometry/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ add_executable(
pctpairgeometry.cxx
${pctpairgeometry_GGO_C}
)
target_link_libraries(pctpairgeometry PCT)
target_link_libraries(pctpairgeometry ${PCT_APPLICATION_TARGETS})

# Ensure binary is placed in the central PCT binary dir
set_target_properties(
Expand Down
2 changes: 1 addition & 1 deletion applications/pctprojections/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ add_executable(
pctprojections.cxx
${pctprojections_GGO_C}
)
target_link_libraries(pctprojections PCT)
target_link_libraries(pctprojections ${PCT_APPLICATION_TARGETS})

# Ensure binary is placed in the central PCT binary dir
set_target_properties(
Expand Down
2 changes: 1 addition & 1 deletion applications/pctzengbackprojections/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ add_executable(
pctzengbackprojections.cxx
${pctzengbackprojections_GGO_C}
)
target_link_libraries(pctzengbackprojections PCT)
target_link_libraries(pctzengbackprojections ${PCT_APPLICATION_TARGETS})

# Ensure binary is placed in the central PCT binary dir
set_target_properties(
Expand Down
4 changes: 2 additions & 2 deletions include/pctDDParkerShortScanImageFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ DDParkerShortScanImageFilter<TInputImage, TOutputImage>::DynamicThreadedGenerate
maxAngularGapPos = iProj;

// Input / ouput iterators
itk::ImageRegionConstIterator<InputImageType> itIn(this->GetInput(), outputRegionForThread);
itk::ImageRegionIterator<OutputImageType> itOut(this->GetOutput(), outputRegionForThread);
itk::ImageRegionConstIteratorWithIndex<InputImageType> itIn(this->GetInput(), outputRegionForThread);
itk::ImageRegionIteratorWithIndex<OutputImageType> itOut(this->GetOutput(), outputRegionForThread);
itIn.GoToBegin();
itOut.GoToBegin();

Expand Down
5 changes: 3 additions & 2 deletions include/pctEnergyAdaptiveMLPFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,13 @@ class PCT_EXPORT EnergyAdaptiveMLPFunction : public MostLikelyPathFunction<doubl
itkNewMacro(Self);

/** Useful defines. */
using PointType = Superclass::PointType;
using VectorType = Superclass::VectorType;

/* Initialize the MLP estimator */
virtual void
Init(const VectorType posIn,
const VectorType posOut,
Init(const PointType posIn,
const PointType posOut,
const VectorType dirIn,
const VectorType dirOut,
double eIn,
Expand Down
2 changes: 1 addition & 1 deletion include/pctHoleFillingImageFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class HoleFillingImageFilter : public itk::ImageToImageFilter<TInputImage, TOutp
using ConstPointer = itk::SmartPointer<const Self>;

itkNewMacro(Self);
itkTypeMacro(HoleFillingImageFilter, ImageToImageFilter);
itkOverrideGetNameOfClassMacro(HoleFillingImageFilter);

using InputImageType = TInputImage;
using OutputImageType = TOutputImage;
Expand Down
14 changes: 9 additions & 5 deletions include/pctMostLikelyPathFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
# include <itkTimeProbe.h>
#endif

#include <rtkQuadricShape.h>

namespace pct
{

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

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

/** Init the mlp parameters from the input and output directions and positions. */
virtual void
Init(const VectorType posIn, const VectorType posOut, const VectorType dirIn, const VectorType dirOut)
Init(const PointType posIn, const PointType posOut, const VectorType dirIn, const VectorType dirOut)
{
itkGenericExceptionMacro("This version of the Init method not implemented for derived class.");
}

/** Init the mlp parameters from the input and output directions and positions, and energies. */
virtual void
Init(const VectorType posIn,
const VectorType posOut,
Init(const PointType posIn,
const PointType posOut,
const VectorType dirIn,
const VectorType dirOut,
double eIn,
Expand All @@ -52,8 +56,8 @@ class ITK_TEMPLATE_EXPORT MostLikelyPathFunction : public itk::LightObject

/** Init with additional parameters to consider tracker uncertainties */
virtual void
InitUncertain(const VectorType posIn,
const VectorType posOut,
InitUncertain(const PointType posIn,
const PointType posOut,
const VectorType dirIn,
const VectorType dirOut,
double dEntry,
Expand Down
3 changes: 2 additions & 1 deletion include/pctPolynomialMLPFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,12 @@ class PCT_EXPORT PolynomialMLPFunction : public MostLikelyPathFunction<double>
itkNewMacro(Self);

/** Useful defines. */
using PointType = Superclass::PointType;
using VectorType = Superclass::VectorType;

/** Init the mlp parameters from the input and output directions and positions. */
virtual void
Init(const VectorType posIn, const VectorType posOut, const VectorType dirIn, const VectorType dirOut) override;
Init(const PointType posIn, const PointType posOut, const VectorType dirIn, const VectorType dirOut) override;

/* Vectorised version of Evaluate function. */
virtual void
Expand Down
14 changes: 7 additions & 7 deletions include/pctProtonPairsToBackProjection.hxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <itkImageFileReader.h>
#include <itkImageRegionIterator.h>
#include <itkImageRegionIteratorWithIndex.h>

#include <rtkHomogeneousMatrix.h>

Expand Down Expand Up @@ -155,7 +155,7 @@ ProtonPairsToBackProjection<TInputImage, TOutputImage>::GenerateData()
zmm.push_back(zmm.back() + minSpacing);

// Process pairs
itk::ImageRegionIterator<ProtonPairsImageType> it(m_ProtonPairs, outputRegionForThread);
itk::ImageRegionIteratorWithIndex<ProtonPairsImageType> it(m_ProtonPairs, outputRegionForThread);
while (!it.IsAtEnd())
{
if (outputRegionForThread.GetIndex(1) == 0 && it.GetIndex()[1] % 1000 == 0)
Expand All @@ -165,9 +165,9 @@ ProtonPairsToBackProjection<TInputImage, TOutputImage>::GenerateData()
<< 100 * it.GetIndex()[1] / outputRegionForThread.GetSize(1) << "%) in thread 1" << std::flush;
}

VectorType pIn = it.Get();
RQIType::PointType pIn(it.Get());
++it;
VectorType pOut = it.Get();
RQIType::PointType pOut(it.Get());
++it;
VectorType dIn = it.Get();
++it;
Expand All @@ -185,9 +185,9 @@ ProtonPairsToBackProjection<TInputImage, TOutputImage>::GenerateData()
++it;

// Move straight to entrance and exit shapes
VectorType pSIn = pIn;
VectorType pSOut = pOut;
double nearDistIn, nearDistOut, farDistIn, farDistOut;
RQIType::PointType pSIn = pIn;
RQIType::PointType pSOut = pOut;
double nearDistIn, nearDistOut, farDistIn, farDistOut;
if (m_QuadricIn.GetPointer() != NULL)
{
if (m_QuadricIn->IsIntersectedByRay(pIn, dIn, nearDistIn, farDistIn) &&
Expand Down
22 changes: 11 additions & 11 deletions include/pctProtonPairsToDistanceDrivenProjection.hxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <itkImageFileReader.h>
#include <itkImageRegionIterator.h>
#include <itkImageRegionIteratorWithIndex.h>

#include "pctThirdOrderPolynomialMLPFunction.h"
#include "pctSchulteMLPFunction.h"
Expand Down Expand Up @@ -169,9 +169,9 @@ ProtonPairsToDistanceDrivenProjection<TInputImage, TOutputImage>::ThreadedGenera
using VectorType = itk::Vector<double, 3>;

// Create zmm and magnitude lut (look up table)
itk::ImageRegionIterator<ProtonPairsImageType> it(m_ProtonPairs, region);
std::vector<double> zmm(imgSize[2]);
std::vector<double> zmag(imgSize[2]);
itk::ImageRegionIteratorWithIndex<ProtonPairsImageType> it(m_ProtonPairs, region);
std::vector<double> zmm(imgSize[2]);
std::vector<double> zmag(imgSize[2]);
++it;
const double zPlaneOutInMM = it.Get()[2];
--it;
Expand All @@ -190,9 +190,9 @@ ProtonPairsToDistanceDrivenProjection<TInputImage, TOutputImage>::ThreadedGenera
<< 100 * it.GetIndex()[1] / region.GetSize(1) << "%) in thread 1" << std::flush;
}

VectorType pIn = it.Get();
RQIType::PointType pIn(it.Get());
++it;
VectorType pOut = it.Get();
RQIType::PointType pOut(it.Get());
++it;
VectorType dIn = it.Get();
++it;
Expand Down Expand Up @@ -257,11 +257,11 @@ ProtonPairsToDistanceDrivenProjection<TInputImage, TOutputImage>::ThreadedGenera
// Move straight to entrance and exit shapes


VectorType pSIn = pIn;
VectorType pSOut = pOut;
double nearDistIn, nearDistOut, farDistIn, farDistOut;
double distanceEntry, distanceExit;
bool QuadricIntersected = false;
RQIType::PointType pSIn = pIn;
RQIType::PointType pSOut = pOut;
double nearDistIn, nearDistOut, farDistIn, farDistOut;
double distanceEntry, distanceExit;
bool QuadricIntersected = false;
if (m_QuadricIn.GetPointer() != NULL)
{
if (m_QuadricIn->IsIntersectedByRay(pIn, dIn, nearDistIn, farDistIn) &&
Expand Down
7 changes: 4 additions & 3 deletions include/pctSchulteMLPFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,17 @@ class PCT_EXPORT SchulteMLPFunction : public MostLikelyPathFunction<double>
itkNewMacro(Self);

/** Useful defines. */
using PointType = Superclass::PointType;
using VectorType = Superclass::VectorType;

/** Init the mlp parameters from the input and output directions and positions. */
virtual void
Init(const VectorType posIn, const VectorType posOut, const VectorType dirIn, const VectorType dirOut) override;
Init(const PointType posIn, const PointType posOut, const VectorType dirIn, const VectorType dirOut) override;

/** Init with additional parameters to consider tracker uncertainties */
virtual void
InitUncertain(const VectorType posIn,
const VectorType posOut,
InitUncertain(const PointType posIn,
const PointType posOut,
const VectorType dirIn,
const VectorType dirOut,
double dEntry,
Expand Down
3 changes: 2 additions & 1 deletion include/pctThirdOrderPolynomialMLPFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ class ITK_TEMPLATE_EXPORT ThirdOrderPolynomialMLPFunction : public MostLikelyPat
itkNewMacro(Self);

/** Useful defines. */
using PointType = typename Superclass::PointType;
using VectorType = typename Superclass::VectorType;

/** Init the mlp parameters from the input and output directions and positions. */
virtual void
Init(const VectorType posIn, const VectorType posOut, const VectorType dirIn, const VectorType dirOut) override;
Init(const PointType posIn, const PointType posOut, const VectorType dirIn, const VectorType dirOut) override;

/** Evaluate the coordinates (x,y) at depth z. */
virtual void
Expand Down
4 changes: 2 additions & 2 deletions include/pctThirdOrderPolynomialMLPFunction.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ namespace pct

template <class TCoordRep>
void
ThirdOrderPolynomialMLPFunction<TCoordRep>::Init(const VectorType posIn,
const VectorType posOut,
ThirdOrderPolynomialMLPFunction<TCoordRep>::Init(const PointType posIn,
const PointType posOut,
const VectorType dirIn,
const VectorType dirOut)
{
Expand Down
4 changes: 2 additions & 2 deletions src/pctEnergyAdaptiveMLPFunction.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ EnergyAdaptiveMLPFunction ::EnergyAdaptiveMLPFunction()
}

void
EnergyAdaptiveMLPFunction ::Init(const VectorType posIn,
const VectorType posOut,
EnergyAdaptiveMLPFunction ::Init(const PointType posIn,
const PointType posOut,
const VectorType dirIn,
const VectorType dirOut,
double eIn,
Expand Down
4 changes: 2 additions & 2 deletions src/pctPolynomialMLPFunction.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ PolynomialMLPFunction ::SetPolynomialDegree(const int polydeg)
}

void
PolynomialMLPFunction ::Init(const VectorType posIn,
const VectorType posOut,
PolynomialMLPFunction ::Init(const PointType posIn,
const PointType posOut,
const VectorType dirIn,
const VectorType dirOut)
{
Expand Down
8 changes: 4 additions & 4 deletions src/pctSchulteMLPFunction.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ SchulteMLPFunction ::SchulteMLPFunction()

// Initialize terms needed to include tracker uncertainties
void
SchulteMLPFunction ::InitUncertain(const VectorType posIn,
const VectorType posOut,
SchulteMLPFunction ::InitUncertain(const PointType posIn,
const PointType posOut,
const VectorType dirIn,
const VectorType dirOut,
double dEntry,
Expand Down Expand Up @@ -97,8 +97,8 @@ SchulteMLPFunction ::InitUncertain(const VectorType posIn,

// standard part of the Initialization
void
SchulteMLPFunction ::Init(const VectorType posIn,
const VectorType posOut,
SchulteMLPFunction ::Init(const PointType posIn,
const PointType posOut,
const VectorType dirIn,
const VectorType dirOut)
{
Expand Down
4 changes: 2 additions & 2 deletions test/pctHoleFillingImageFilterTest.cxx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "pctHoleFillingImageFilter.h"

#include "itkImage.h"
#include "itkImageRegionIterator.h"
#include "itkImageRegionIteratorWithIndex.h"
#include "itkTestingMacros.h"

int
Expand All @@ -19,7 +19,7 @@ pctHoleFillingImageFilterTest(int argc, char * argv[])
img->FillBuffer(42);

// Insert some holes (use 0 as hole value)
itk::ImageRegionIterator<ImageType> it(img, region);
itk::ImageRegionIteratorWithIndex<ImageType> it(img, region);
for (it.GoToBegin(); !it.IsAtEnd(); ++it)
{
ImageType::IndexType idx = it.GetIndex();
Expand Down
Loading