diff --git a/documentation/docs/rtk_3_migration_guide.md b/documentation/docs/rtk_3_migration_guide.md index 3c9d27b5c..63e6dde5c 100644 --- a/documentation/docs/rtk_3_migration_guide.md +++ b/documentation/docs/rtk_3_migration_guide.md @@ -43,3 +43,8 @@ Most users intuitively expect this for the backprojector matched to `rtk::CudaFo ## CUDA forward / ray-cast step size default The CUDA forward projector and the CUDA ray-cast backprojector now use the minimum voxel spacing of the input volume as the ray step when StepSize is not set. The previous default value was 1. + +## Positions now use `itk::Point` instead of `itk::Vector` + +APIs that represent physical *positions* were changed from `itk::Vector` to `itk::Point`. This makes a clear distinction between points (locations) and vectors (directions or offsets). +Projection iterators (`rtkProjectionsRegionConstIteratorRayBased*`), Joseph forward/back projectors, ray-box filters, convex/quadric shapes, Ora geometry readers, Forbild phantom readers, and test/phantom helpers now expect `PointType` for positions (source, pixel, box corners, shape centers). diff --git a/examples/FirstReconstruction/FirstCudaReconstruction.cxx b/examples/FirstReconstruction/FirstCudaReconstruction.cxx index 675a6b05b..026080422 100644 --- a/examples/FirstReconstruction/FirstCudaReconstruction.cxx +++ b/examples/FirstReconstruction/FirstCudaReconstruction.cxx @@ -54,7 +54,7 @@ main(int argc, char ** argv) REIType::Pointer rei = REIType::New(); rei->SetDensity(2.); rei->SetAngle(0.); - rei->SetCenter(itk::MakeVector(0., 0., 10.)); + rei->SetCenter(itk::MakePoint(0., 0., 10.)); rei->SetAxis(itk::MakeVector(50., 50., 50.)); rei->SetGeometry(geometry); rei->SetInput(constantImageSource->GetOutput()); diff --git a/examples/FirstReconstruction/FirstReconstruction.cxx b/examples/FirstReconstruction/FirstReconstruction.cxx index a1ad002e4..444c14e9b 100644 --- a/examples/FirstReconstruction/FirstReconstruction.cxx +++ b/examples/FirstReconstruction/FirstReconstruction.cxx @@ -53,7 +53,7 @@ main(int argc, char ** argv) REIType::Pointer rei = REIType::New(); rei->SetDensity(2.); rei->SetAngle(0.); - rei->SetCenter(itk::MakeVector(0., 0., 10.)); + rei->SetCenter(itk::MakePoint(0., 0., 10.)); rei->SetAxis(itk::MakeVector(50., 50., 50.)); rei->SetGeometry(geometry); rei->SetInput(constantImageSource->GetOutput()); diff --git a/include/rtkConvexShape.h b/include/rtkConvexShape.h index 4aa58bbf9..6fcac51f3 100644 --- a/include/rtkConvexShape.h +++ b/include/rtkConvexShape.h @@ -57,7 +57,7 @@ class RTK_EXPORT ConvexShape : public itk::DataObject /** Convenient type alias. */ static constexpr unsigned int Dimension = 3; using ScalarType = double; - using PointType = itk::Vector; + using PointType = itk::Point; using VectorType = itk::Vector; using RotationMatrixType = itk::Matrix; diff --git a/include/rtkDrawBoxImageFilter.h b/include/rtkDrawBoxImageFilter.h index de1dce2ec..a78f7ce04 100644 --- a/include/rtkDrawBoxImageFilter.h +++ b/include/rtkDrawBoxImageFilter.h @@ -77,10 +77,10 @@ class ITK_TEMPLATE_EXPORT DrawBoxImageFilter : public DrawConvexImageFilter m_PlaneDirections; std::vector m_PlanePositions; - VectorType m_BoxMin{ 0. }; - VectorType m_BoxMax{ 0. }; + PointType m_BoxMin{ 0. }; + PointType m_BoxMax{ 0. }; RotationMatrixType m_Direction; }; diff --git a/include/rtkFourDSARTConeBeamReconstructionFilter.hxx b/include/rtkFourDSARTConeBeamReconstructionFilter.hxx index 65fcd755f..d20762d6f 100644 --- a/include/rtkFourDSARTConeBeamReconstructionFilter.hxx +++ b/include/rtkFourDSARTConeBeamReconstructionFilter.hxx @@ -236,20 +236,16 @@ FourDSARTConeBeamReconstructionFilter::Ge // Create the m_RayBoxFiltersectionImageFilter m_RayBoxFilter->SetGeometry(this->GetGeometry()); - itk::Vector Corner1, Corner2; - - Corner1[0] = this->GetInput(0)->GetOrigin()[0]; - Corner1[1] = this->GetInput(0)->GetOrigin()[1]; - Corner1[2] = this->GetInput(0)->GetOrigin()[2]; - Corner2[0] = this->GetInput(0)->GetOrigin()[0] + - this->GetInput(0)->GetLargestPossibleRegion().GetSize()[0] * this->GetInput(0)->GetSpacing()[0]; - Corner2[1] = this->GetInput(0)->GetOrigin()[1] + - this->GetInput(0)->GetLargestPossibleRegion().GetSize()[1] * this->GetInput(0)->GetSpacing()[1]; - Corner2[2] = this->GetInput(0)->GetOrigin()[2] + - this->GetInput(0)->GetLargestPossibleRegion().GetSize()[2] * this->GetInput(0)->GetSpacing()[2]; - - m_RayBoxFilter->SetBoxMin(Corner1); - m_RayBoxFilter->SetBoxMax(Corner2); + itk::Point corner1, corner2; + for (unsigned int i = 0; i < 3; ++i) + { + corner1[i] = this->GetInput(0)->GetOrigin()[i]; + corner2[i] = this->GetInput(0)->GetOrigin()[i] + + this->GetInput(0)->GetLargestPossibleRegion().GetSize()[i] * this->GetInput(0)->GetSpacing()[i]; + } + + m_RayBoxFilter->SetBoxMin(corner1); + m_RayBoxFilter->SetBoxMax(corner2); m_RayBoxFilter->UpdateOutputInformation(); m_ExtractFilter->UpdateOutputInformation(); diff --git a/include/rtkIterativeFDKConeBeamReconstructionFilter.hxx b/include/rtkIterativeFDKConeBeamReconstructionFilter.hxx index e869c74d7..10193f20e 100644 --- a/include/rtkIterativeFDKConeBeamReconstructionFilter.hxx +++ b/include/rtkIterativeFDKConeBeamReconstructionFilter.hxx @@ -97,18 +97,16 @@ IterativeFDKConeBeamReconstructionFilterSetConstant(0); // Set box for the m_RayBoxFiltersectionImageFilter - itk::Vector Corner1, Corner2; - Corner1[0] = this->GetInput(0)->GetOrigin()[0]; - Corner1[1] = this->GetInput(0)->GetOrigin()[1]; - Corner1[2] = this->GetInput(0)->GetOrigin()[2]; - Corner2[0] = this->GetInput(0)->GetOrigin()[0] + - this->GetInput(0)->GetLargestPossibleRegion().GetSize()[0] * this->GetInput(0)->GetSpacing()[0]; - Corner2[1] = this->GetInput(0)->GetOrigin()[1] + - this->GetInput(0)->GetLargestPossibleRegion().GetSize()[1] * this->GetInput(0)->GetSpacing()[1]; - Corner2[2] = this->GetInput(0)->GetOrigin()[2] + - this->GetInput(0)->GetLargestPossibleRegion().GetSize()[2] * this->GetInput(0)->GetSpacing()[2]; - m_RayBoxFilter->SetBoxMin(Corner1); - m_RayBoxFilter->SetBoxMax(Corner2); + itk::Point corner1, corner2; + for (unsigned int i = 0; i < 3; ++i) + { + corner1[i] = this->GetInput(0)->GetOrigin()[i]; + corner2[i] = this->GetInput(0)->GetOrigin()[i] + + this->GetInput(0)->GetLargestPossibleRegion().GetSize()[i] * this->GetInput(0)->GetSpacing()[i]; + } + + m_RayBoxFilter->SetBoxMin(corner1); + m_RayBoxFilter->SetBoxMax(corner2); // Initial internal connections m_DisplacedDetectorFilter->SetInput(this->GetInput(1)); diff --git a/include/rtkJosephBackProjectionImageFilter.hxx b/include/rtkJosephBackProjectionImageFilter.hxx index 8321e55a5..89c5dfb34 100644 --- a/include/rtkJosephBackProjectionImageFilter.hxx +++ b/include/rtkJosephBackProjectionImageFilter.hxx @@ -109,8 +109,8 @@ JosephBackProjectionImageFilterGetInput(1), buffReg, geometry, volPPToIndex); // Create intersection functions, one for each possible main direction - auto box = BoxShape::New(); - typename BoxShape::VectorType boxMin, boxMax; + auto box = BoxShape::New(); + typename BoxShape::PointType boxMin, boxMax; for (unsigned int i = 0; i < Dimension; i++) { boxMin[i] = this->GetOutput()->GetRequestedRegion().GetIndex()[i]; @@ -127,11 +127,12 @@ JosephBackProjectionImageFilterNext()) { - typename InputRegionIterator::PointType pixelPosition = itIn->GetPixelPosition(); - typename InputRegionIterator::PointType dirVox = -itIn->GetSourceToPixel(); + typename InputRegionIterator::PointType pixelPosition = itIn->GetPixelPosition(); + typename InputRegionIterator::VectorType dirVox = -itIn->GetSourceToPixel(); // Select main direction unsigned int mainDir = 0; diff --git a/include/rtkJosephForwardAttenuatedProjectionImageFilter.h b/include/rtkJosephForwardAttenuatedProjectionImageFilter.h index 38a4676e4..a981f1714 100644 --- a/include/rtkJosephForwardAttenuatedProjectionImageFilter.h +++ b/include/rtkJosephForwardAttenuatedProjectionImageFilter.h @@ -189,6 +189,7 @@ class ITK_TEMPLATE_EXPORT ProjectedValueAccumulationAttenuated { public: using VectorType = itk::Vector; + using PointType = itk::Point; ProjectedValueAccumulationAttenuated() = default; ~ProjectedValueAccumulationAttenuated() = default; @@ -210,10 +211,10 @@ class ITK_TEMPLATE_EXPORT ProjectedValueAccumulationAttenuated TOutput & output, const TOutput & rayCastValue, const VectorType & /*stepInMM*/, - const VectorType & itkNotUsed(source), + const PointType & itkNotUsed(source), const VectorType & itkNotUsed(sourceToPixel), - const VectorType & itkNotUsed(nearestPoint), - const VectorType & itkNotUsed(farthestPoint)) + const PointType & itkNotUsed(nearestPoint), + const PointType & itkNotUsed(farthestPoint)) { output = input + rayCastValue; m_Attenuation[threadId] = 0; diff --git a/include/rtkJosephForwardProjectionImageFilter.h b/include/rtkJosephForwardProjectionImageFilter.h index 172e2c81f..96c0ad4b5 100644 --- a/include/rtkJosephForwardProjectionImageFilter.h +++ b/include/rtkJosephForwardProjectionImageFilter.h @@ -115,6 +115,7 @@ class ITK_TEMPLATE_EXPORT ProjectedValueAccumulation { public: using VectorType = itk::Vector; + using PointType = itk::Point; ProjectedValueAccumulation() = default; ~ProjectedValueAccumulation() = default; @@ -135,10 +136,10 @@ class ITK_TEMPLATE_EXPORT ProjectedValueAccumulation TOutput & output, const TOutput & rayCastValue, const VectorType & stepInMM, - const VectorType & itkNotUsed(source), + const PointType & itkNotUsed(source), const VectorType & itkNotUsed(sourceToPixel), - const VectorType & itkNotUsed(nearestPoint), - const VectorType & itkNotUsed(farthestPoint)) const + const PointType & itkNotUsed(nearestPoint), + const PointType & itkNotUsed(farthestPoint)) const { output = input + rayCastValue * stepInMM.GetNorm(); } diff --git a/include/rtkJosephForwardProjectionImageFilter.hxx b/include/rtkJosephForwardProjectionImageFilter.hxx index b7d73ce30..9e6aa8230 100644 --- a/include/rtkJosephForwardProjectionImageFilter.hxx +++ b/include/rtkJosephForwardProjectionImageFilter.hxx @@ -221,8 +221,8 @@ JosephForwardProjectionImageFilterGetInput(1)->GetBufferedRegion().GetIndex()[i]; @@ -239,11 +239,13 @@ JosephForwardProjectionImageFilterNext(), ++itOut) { - typename InputRegionIterator::PointType pixelPosition = itIn->GetPixelPosition(); - typename InputRegionIterator::PointType dirVox = -itIn->GetSourceToPixel(); + stepMM.Fill(0.); + typename InputRegionIterator::PointType pixelPosition = itIn->GetPixelPosition(); + typename InputRegionIterator::VectorType dirVox = -itIn->GetSourceToPixel(); // Select main direction unsigned int mainDir = 0; @@ -417,7 +419,7 @@ JosephForwardProjectionImageFilterGet(), itOut.Value(), {}, pixelPosition, pixelPosition, dirVox, pixelPosition, pixelPosition); + threadId, itIn->Get(), itOut.Value(), {}, stepMM, pixelPosition, dirVox, pixelPosition, pixelPosition); } delete itIn; } diff --git a/include/rtkMaskCollimationImageFilter.hxx b/include/rtkMaskCollimationImageFilter.hxx index a4603be40..4994e83b6 100644 --- a/include/rtkMaskCollimationImageFilter.hxx +++ b/include/rtkMaskCollimationImageFilter.hxx @@ -73,26 +73,28 @@ MaskCollimationImageFilter::DynamicThreadedGenerateDa for (unsigned int pix = 0; pix < npixperslice; pix++, itIn->Next(), ++itOut) { using PointType = typename InputRegionIterator::PointType; - PointType source = itIn->GetSourcePosition(); - double sourceNorm = source.GetNorm(); - PointType pixel = itIn->GetPixelPosition(); + using VectorType = typename InputRegionIterator::VectorType; - PointType pixelToSource(source - pixel); - PointType sourceDir = source / sourceNorm; + VectorType source = itIn->GetSourcePosition().GetVectorFromOrigin(); + double sourceNorm = source.GetNorm(); + VectorType pixel = itIn->GetPixelPosition().GetVectorFromOrigin(); + + VectorType pixelToSource(source - pixel); + VectorType sourceDir = source / sourceNorm; // Get the 3D position of the ray and the main plane // (at 0,0,0 and orthogonal to source to center) const double mag = sourceNorm / (pixelToSource * sourceDir); - PointType intersection = source - mag * pixelToSource; + VectorType intersection = source - mag * pixelToSource; // The first coordinate on the plane is measured along the detector // orthogonal to the plane defined by the detector source direction // and the secon detector vector - PointType v; + VectorType v; v[0] = this->GetGeometry()->GetRotationMatrix(iProj)[m_RotationAxisIndex][0]; v[1] = this->GetGeometry()->GetRotationMatrix(iProj)[m_RotationAxisIndex][1]; v[2] = this->GetGeometry()->GetRotationMatrix(iProj)[m_RotationAxisIndex][2]; - PointType u = CrossProduct(v, sourceDir); + VectorType u = CrossProduct(v, sourceDir); u /= u.GetNorm(); double ucoord = u * intersection; diff --git a/include/rtkMaximumIntensityProjectionImageFilter.h b/include/rtkMaximumIntensityProjectionImageFilter.h index 96d3a6830..7ea59df8c 100644 --- a/include/rtkMaximumIntensityProjectionImageFilter.h +++ b/include/rtkMaximumIntensityProjectionImageFilter.h @@ -78,6 +78,7 @@ class ITK_TEMPLATE_EXPORT MaximumIntensityProjectedValueAccumulation { public: using VectorType = itk::Vector; + using PointType = itk::Point; bool operator!=(const MaximumIntensityProjectedValueAccumulation &) const @@ -96,10 +97,10 @@ class ITK_TEMPLATE_EXPORT MaximumIntensityProjectedValueAccumulation TOutput & output, const TOutput & rayCastValue, const VectorType & stepInMM, - const VectorType & itkNotUsed(source), + const PointType & itkNotUsed(source), const VectorType & itkNotUsed(sourceToPixel), - const VectorType & itkNotUsed(nearestPoint), - const VectorType & itkNotUsed(farthestPoint)) const + const PointType & itkNotUsed(nearestPoint), + const PointType & itkNotUsed(farthestPoint)) const { TOutput tmp = static_cast(input); if (tmp < rayCastValue) diff --git a/include/rtkProjectionsRegionConstIteratorRayBased.h b/include/rtkProjectionsRegionConstIteratorRayBased.h index 56f1c6ad8..93f4ed6ba 100644 --- a/include/rtkProjectionsRegionConstIteratorRayBased.h +++ b/include/rtkProjectionsRegionConstIteratorRayBased.h @@ -65,7 +65,8 @@ class ITK_TEMPLATE_EXPORT ProjectionsRegionConstIteratorRayBased : public itk::I /** Types inherited from the Superclass */ using OffsetValueType = typename Superclass::OffsetValueType; using RegionType = typename Superclass::RegionType; - using PointType = typename itk::Vector; + using VectorType = typename itk::Vector; + using PointType = typename itk::Point; using IndexValueType = typename Superclass::IndexValueType; using MatrixType = itk::Matrix; @@ -130,7 +131,7 @@ class ITK_TEMPLATE_EXPORT ProjectionsRegionConstIteratorRayBased : public itk::I { return this->m_PixelPosition; } - const PointType & + const VectorType & GetSourceToPixel() { return this->m_SourceToPixel; @@ -138,7 +139,7 @@ class ITK_TEMPLATE_EXPORT ProjectionsRegionConstIteratorRayBased : public itk::I /** Computes and returns a unit vector pointing from the source to the * current pixel, i.e., GetSourceToPixel()/||GetSourceToPixel()||. */ - const PointType + const VectorType GetDirection() { return m_SourceToPixel / m_SourceToPixel.GetNorm(); @@ -158,7 +159,7 @@ class ITK_TEMPLATE_EXPORT ProjectionsRegionConstIteratorRayBased : public itk::I MatrixType m_PostMultiplyMatrix; PointType m_SourcePosition; PointType m_PixelPosition; - PointType m_SourceToPixel; + VectorType m_SourceToPixel; }; } // namespace rtk diff --git a/include/rtkProjectionsRegionConstIteratorRayBasedWithCylindricalPanel.h b/include/rtkProjectionsRegionConstIteratorRayBasedWithCylindricalPanel.h index 1eeb29fff..eced4b6b5 100644 --- a/include/rtkProjectionsRegionConstIteratorRayBasedWithCylindricalPanel.h +++ b/include/rtkProjectionsRegionConstIteratorRayBasedWithCylindricalPanel.h @@ -50,7 +50,8 @@ class ITK_TEMPLATE_EXPORT ProjectionsRegionConstIteratorRayBasedWithCylindricalP using MatrixType = typename Superclass::MatrixType; using IndexValueType = typename Superclass::IndexValueType; - using PointType = typename itk::Vector; + using PointType = typename itk::Point; + using VectorType = typename itk::Vector; using HomogeneousMatrixType = itk::Matrix; /** Constructor establishes an iterator to walk a particular image and a diff --git a/include/rtkProjectionsRegionConstIteratorRayBasedWithCylindricalPanel.hxx b/include/rtkProjectionsRegionConstIteratorRayBasedWithCylindricalPanel.hxx index 4341fe9d7..d900df03a 100644 --- a/include/rtkProjectionsRegionConstIteratorRayBasedWithCylindricalPanel.hxx +++ b/include/rtkProjectionsRegionConstIteratorRayBasedWithCylindricalPanel.hxx @@ -49,7 +49,9 @@ ProjectionsRegionConstIteratorRayBasedWithCylindricalPanel::NewProjectio // Set source position in volume indices // GetSourcePosition() returns coordinates in mm. Multiplying by // volPPToIndex gives the corresponding volume index - this->m_SourcePosition = this->m_PostMultiplyMatrix * this->m_Geometry->GetSourcePosition(iProj); + VectorType sourcePos = this->m_PostMultiplyMatrix * this->m_Geometry->GetSourcePosition(iProj); + for (unsigned int i = 0; i < this->GetImageDimension(); ++i) + this->m_SourcePosition[i] = sourcePos[i]; // Compute matrix to transform projection index to position on a flat panel // if the panel were flat, before accounting for the curvature diff --git a/include/rtkProjectionsRegionConstIteratorRayBasedWithFlatPanel.h b/include/rtkProjectionsRegionConstIteratorRayBasedWithFlatPanel.h index d477c285b..965566907 100644 --- a/include/rtkProjectionsRegionConstIteratorRayBasedWithFlatPanel.h +++ b/include/rtkProjectionsRegionConstIteratorRayBasedWithFlatPanel.h @@ -47,7 +47,8 @@ class ITK_TEMPLATE_EXPORT ProjectionsRegionConstIteratorRayBasedWithFlatPanel /** Types inherited from the Superclass */ using OffsetValueType = typename Superclass::OffsetValueType; using RegionType = typename Superclass::RegionType; - using PointType = typename itk::Vector; + using PointType = typename itk::Point; + using VectorType = typename itk::Vector; using MatrixType = typename Superclass::MatrixType; using HomogeneousMatrixType = itk::Matrix; diff --git a/include/rtkProjectionsRegionConstIteratorRayBasedWithFlatPanel.hxx b/include/rtkProjectionsRegionConstIteratorRayBasedWithFlatPanel.hxx index a0eb2e74e..0075e2066 100644 --- a/include/rtkProjectionsRegionConstIteratorRayBasedWithFlatPanel.hxx +++ b/include/rtkProjectionsRegionConstIteratorRayBasedWithFlatPanel.hxx @@ -42,7 +42,9 @@ ProjectionsRegionConstIteratorRayBasedWithFlatPanel::NewProjection() // Set source position in volume indices // GetSourcePosition() returns coordinates in mm. Multiplying by // volPPToIndex gives the corresponding volume index - this->m_SourcePosition = this->m_PostMultiplyMatrix * this->m_Geometry->GetSourcePosition(this->m_PositionIndex[2]); + VectorType transformed = this->m_PostMultiplyMatrix * this->m_Geometry->GetSourcePosition(this->m_PositionIndex[2]); + for (unsigned int i = 0; i < this->GetImageDimension(); ++i) + this->m_SourcePosition[i] = transformed[i]; // Compute matrix to transform projection index to volume index // IndexToPhysicalPointMatrix maps the 2D index of a projection's pixel to its 2D position on the detector (in mm) diff --git a/src/rtkBoxShape.cxx b/src/rtkBoxShape.cxx index 38b314681..153c4bde7 100644 --- a/src/rtkBoxShape.cxx +++ b/src/rtkBoxShape.cxx @@ -145,17 +145,19 @@ BoxShape ::SetBoxFromImage(const ImageBaseType * img, bool bWithExternalHalfPixe itkGenericExceptionMacro(<< "BoxShape and image dimensions must agree"); // BoxShape corner 1 - m_BoxMin = img->GetOrigin().GetVectorFromOrigin(); + m_BoxMin = img->GetOrigin(); if (bWithExternalHalfPixelBorder) m_BoxMin -= img->GetDirection() * img->GetSpacing() * 0.5; // BoxShape corner 2 + VectorType max; for (unsigned int i = 0; i < Dimension; i++) if (bWithExternalHalfPixelBorder) - m_BoxMax[i] = img->GetSpacing()[i] * img->GetLargestPossibleRegion().GetSize()[i]; + max[i] = img->GetSpacing()[i] * img->GetLargestPossibleRegion().GetSize()[i]; else - m_BoxMax[i] = img->GetSpacing()[i] * (img->GetLargestPossibleRegion().GetSize()[i] - 1); - m_BoxMax = m_BoxMin + img->GetDirection() * m_BoxMax; + max[i] = img->GetSpacing()[i] * (img->GetLargestPossibleRegion().GetSize()[i] - 1); + max = img->GetDirection() * max; + m_BoxMax = m_BoxMin + max; SetDirection(img->GetDirection()); } diff --git a/src/rtkConvexShape.cxx b/src/rtkConvexShape.cxx index 7cfa0ad2c..bbd1954bf 100644 --- a/src/rtkConvexShape.cxx +++ b/src/rtkConvexShape.cxx @@ -114,14 +114,15 @@ ConvexShape ::ApplyClipPlanes(const PointType & rayOrigin, // Ray parallel to plane if (rayDirPlaneDir == itk::NumericTraits::ZeroValue()) { - if (rayOrigin * m_PlaneDirections[i] < m_PlanePositions[i]) + if (rayOrigin.GetVectorFromOrigin() * m_PlaneDirections[i] < m_PlanePositions[i]) continue; else return false; } // Compute plane distance in ray direction - ScalarType planeDist = (m_PlanePositions[i] - rayOrigin * m_PlaneDirections[i]) / rayDirPlaneDir; + ScalarType planeDist = + (m_PlanePositions[i] - rayOrigin.GetVectorFromOrigin() * m_PlaneDirections[i]) / rayDirPlaneDir; // If plane is pointing in the same direction as the ray if (rayDirPlaneDir >= itk::NumericTraits::ZeroValue()) @@ -145,7 +146,7 @@ ConvexShape ::ApplyClipPlanes(const PointType & point) const { for (size_t i = 0; i < m_PlaneDirections.size(); i++) { - if (point * m_PlaneDirections[i] >= m_PlanePositions[i]) + if (point.GetVectorFromOrigin() * m_PlaneDirections[i] >= m_PlanePositions[i]) return false; } return true; diff --git a/src/rtkForbildPhantomFileReader.cxx b/src/rtkForbildPhantomFileReader.cxx index 81a4dff3e..07eeda642 100644 --- a/src/rtkForbildPhantomFileReader.cxx +++ b/src/rtkForbildPhantomFileReader.cxx @@ -180,11 +180,11 @@ ForbildPhantomFileReader::CreateForbildCylinder(const std::string & s, const std rot = ComputeRotationMatrixBetweenVectors(planeDir, dir); } auto q = QuadricShape::New(); - q->SetEllipsoid(VectorType(0.), axes); + q->SetEllipsoid(itk::MakePoint(0., 0., 0.), axes); q->AddClipPlane(planeDir, 0.5 * l); q->AddClipPlane(-1. * planeDir, 0.5 * l); q->Rotate(rot); - q->Translate(m_Center); + q->Translate(m_Center.GetVectorFromOrigin()); m_ConvexShape = q.GetPointer(); } @@ -210,7 +210,7 @@ ForbildPhantomFileReader::CreateForbildElliptCyl(const std::string & s, const st planeDir[i] = (axes[i] == 0.) ? 1. : 0.; auto q = QuadricShape::New(); - q->SetEllipsoid(VectorType(0.), axes); + q->SetEllipsoid(itk::MakePoint(0., 0., 0.), axes); q->AddClipPlane(planeDir, 0.5 * l); q->AddClipPlane(-1. * planeDir, 0.5 * l); if (fig == "Ellipt_Cyl") @@ -252,7 +252,7 @@ ForbildPhantomFileReader::CreateForbildElliptCyl(const std::string & s, const st } q->Rotate(rot); } - q->Translate(m_Center); + q->Translate(m_Center.GetVectorFromOrigin()); m_ConvexShape = q.GetPointer(); } @@ -267,7 +267,7 @@ ForbildPhantomFileReader::CreateForbildEllipsoid(const std::string & s, const st if (!FindParameterInString("dz", s, axes[2])) itkExceptionMacro(<< "Could not find dz in " << s); auto q = QuadricShape::New(); - q->SetEllipsoid(VectorType(0.), axes); + q->SetEllipsoid(itk::MakePoint(0., 0., 0.), axes); if (fig == "Ellipsoid_free") { @@ -296,7 +296,7 @@ ForbildPhantomFileReader::CreateForbildEllipsoid(const std::string & s, const st } q->Rotate(rot); } - q->Translate(m_Center); + q->Translate(m_Center.GetVectorFromOrigin()); m_ConvexShape = q.GetPointer(); } @@ -343,7 +343,7 @@ ForbildPhantomFileReader::CreateForbildCone(const std::string & s, const std::st q->AddClipPlane(planeDir, l + axes[2]); spatialOffset[2] = -axes[2] - 0.5 * l; } - q->SetEllipsoid(VectorType(0.), axes); + q->SetEllipsoid(itk::MakePoint(0., 0., 0.), axes); q->SetJ(0.); RotationMatrixType rot; @@ -376,7 +376,8 @@ ForbildPhantomFileReader::CreateForbildCone(const std::string & s, const std::st itkExceptionMacro(<< "Unknown figure: " << fig); } q->Rotate(rot); - q->Translate(m_Center + rot * spatialOffset); + VectorType translation = m_Center.GetVectorFromOrigin() + rot * spatialOffset.GetVectorFromOrigin(); + q->Translate(translation); m_ConvexShape = q.GetPointer(); } diff --git a/src/rtkOraGeometryReader.cxx b/src/rtkOraGeometryReader.cxx index 41604071f..c404faf51 100644 --- a/src/rtkOraGeometryReader.cxx +++ b/src/rtkOraGeometryReader.cxx @@ -54,14 +54,14 @@ OraGeometryReader::GenerateData() reader->ReadImageInformation(); itk::MetaDataDictionary & dic = reader->GetMetaDataDictionary(); - using MetaDataVectorType = itk::MetaDataObject; + using MetaDataPointType = itk::MetaDataObject; using MetaDataMatrixType = itk::MetaDataObject; using MetaDataDoubleType = itk::MetaDataObject; using MetaDataVectorDoubleType = itk::MetaDataObject>; using MetaDataVectorIntType = itk::MetaDataObject>; // Source position - MetaDataVectorType * spMeta = dynamic_cast(dic["SourcePosition"].GetPointer()); + MetaDataPointType * spMeta = dynamic_cast(dic["SourcePosition"].GetPointer()); if (spMeta == nullptr) { itkExceptionMacro(<< "No SourcePosition in " << projectionsFileName); @@ -69,7 +69,7 @@ OraGeometryReader::GenerateData() PointType sp(&(spMeta->GetMetaDataObjectValue()[0])); // Origin (detector position) - MetaDataVectorType * dpMeta = dynamic_cast(dic["Origin"].GetPointer()); + MetaDataPointType * dpMeta = dynamic_cast(dic["Origin"].GetPointer()); if (dpMeta == nullptr) { itkExceptionMacro(<< "No Origin in " << projectionsFileName); diff --git a/src/rtkOraXMLFileReader.cxx b/src/rtkOraXMLFileReader.cxx index 388932361..de2fa901c 100644 --- a/src/rtkOraXMLFileReader.cxx +++ b/src/rtkOraXMLFileReader.cxx @@ -77,7 +77,7 @@ OraXMLFileReader::EncapsulatePoint(const char * metaName, const char * name) { if (itksys::SystemTools::Strucmp(name, metaName) == 0) { - using PointType = itk::Vector; + using PointType = itk::Point; PointType p; std::istringstream iss(m_CurCharacterData); for (int i = 0; i < 3; i++) diff --git a/src/rtkQuadricShape.cxx b/src/rtkQuadricShape.cxx index 4708eccd5..ea2a94a0d 100644 --- a/src/rtkQuadricShape.cxx +++ b/src/rtkQuadricShape.cxx @@ -316,7 +316,7 @@ QuadricShape ::SetEllipsoid(const PointType & center, const VectorType & axis, c m_I = TempG * sin(yangle * (itk::Math::pi / 180)) + TempI * cos(yangle * (itk::Math::pi / 180)); m_J = TempJ; - Translate(center); + Translate(center.GetVectorFromOrigin()); } itk::LightObject::Pointer diff --git a/src/rtkSheppLoganPhantom.cxx b/src/rtkSheppLoganPhantom.cxx index 6c6cf5df0..5814371a0 100644 --- a/src/rtkSheppLoganPhantom.cxx +++ b/src/rtkSheppLoganPhantom.cxx @@ -45,7 +45,7 @@ SheppLoganPhantom ::SetEllipsoid(ScalarType spax, ScalarType density) { auto semiprincipalaxis = itk::MakeVector(spax, spay, spaz); - auto center = itk::MakeVector(centerx, centery, centerz); + auto center = itk::MakePoint(centerx, centery, centerz); auto q = QuadricShape::New(); q->SetEllipsoid(center, semiprincipalaxis, angle); q->SetDensity(density); diff --git a/test/rtkadmmtotalvariationtest.cxx b/test/rtkadmmtotalvariationtest.cxx index 1ebc279cc..1ba7fffd4 100644 --- a/test/rtkadmmtotalvariationtest.cxx +++ b/test/rtkadmmtotalvariationtest.cxx @@ -89,7 +89,8 @@ main(int argc, char * argv[]) REIType::Pointer rei; rei = REIType::New(); - REIType::VectorType semiprincipalaxis, center; + REIType::VectorType semiprincipalaxis; + REIType::PointType center; semiprincipalaxis.Fill(90.); center.Fill(0.); rei->SetAngle(0.); diff --git a/test/rtkadmmwaveletstest.cxx b/test/rtkadmmwaveletstest.cxx index 4b34e8f9a..e8411968d 100644 --- a/test/rtkadmmwaveletstest.cxx +++ b/test/rtkadmmwaveletstest.cxx @@ -141,7 +141,7 @@ main(int, char **) rei = REIType::New(); rei->SetAngle(0.); rei->SetDensity(1.); - rei->SetCenter(itk::MakeVector(0., 0., 0.)); + rei->SetCenter(itk::MakePoint(0., 0., 0.)); rei->SetAxis(itk::MakeVector(90., 90., 90.)); rei->SetInput(projectionsSource->GetOutput()); diff --git a/test/rtkamsterdamshroudtest.cxx b/test/rtkamsterdamshroudtest.cxx index 6aad12f24..0d86af14c 100644 --- a/test/rtkamsterdamshroudtest.cxx +++ b/test/rtkamsterdamshroudtest.cxx @@ -105,7 +105,7 @@ main(int argc, char * argv[]) e1->SetGeometry(geometry); e1->SetDensity(2.); e1->SetAxis(itk::MakeVector(88.32, 115.2, 117.76)); - e1->SetCenter(itk::MakeVector(0., 0., 0.)); + e1->SetCenter(itk::MakePoint(0., 0., 0.)); e1->SetAngle(0.); e1->InPlaceOff(); e1->Update(); @@ -116,7 +116,7 @@ main(int argc, char * argv[]) e2->SetGeometry(geometry); e2->SetDensity(-1.98); e2->SetAxis(itk::MakeVector(35., reiSize - sinus, reiSize - sinus)); - e2->SetCenter(itk::MakeVector(-37., 0., 0.)); + e2->SetCenter(itk::MakePoint(-37., 0., 0.)); e2->SetAngle(0.); e2->Update(); @@ -126,7 +126,7 @@ main(int argc, char * argv[]) e3->SetGeometry(geometry); e3->SetDensity(-1.98); e3->SetAxis(itk::MakeVector(35., reiSize - sinus, reiSize - sinus)); - e3->SetCenter(itk::MakeVector(37., 0., 0.)); + e3->SetCenter(itk::MakePoint(37., 0., 0.)); e3->SetAngle(0.); e3->Update(); @@ -136,7 +136,7 @@ main(int argc, char * argv[]) e4->SetGeometry(geometry); e4->SetDensity(1.42); e4->SetAxis(itk::MakeVector(8., 8., 8.)); - e4->SetCenter(itk::MakeVector(-40., 0., 0.)); + e4->SetCenter(itk::MakePoint(-40., 0., 0.)); e4->SetAngle(0.); // Creating movement diff --git a/test/rtkconjugategradientreconstructiontest.cxx b/test/rtkconjugategradientreconstructiontest.cxx index e20c9419f..73b60ab78 100644 --- a/test/rtkconjugategradientreconstructiontest.cxx +++ b/test/rtkconjugategradientreconstructiontest.cxx @@ -82,7 +82,7 @@ main(int, char **) rei = REIType::New(); rei->SetAngle(0.); rei->SetDensity(1.); - rei->SetCenter(itk::MakeVector(0., 0., 0.)); + rei->SetCenter(itk::MakePoint(0., 0., 0.)); rei->SetAxis(itk::MakeVector(90., 90., 90.)); rei->SetInput(projectionsSource->GetOutput()); rei->SetGeometry(geometry); diff --git a/test/rtkcylindricaldetectorreconstructiontest.cxx b/test/rtkcylindricaldetectorreconstructiontest.cxx index 2b87811d8..d8bbf5e7e 100644 --- a/test/rtkcylindricaldetectorreconstructiontest.cxx +++ b/test/rtkcylindricaldetectorreconstructiontest.cxx @@ -84,7 +84,7 @@ main(int, char **) rei = REIType::New(); rei->SetAngle(0.); rei->SetDensity(1.); - rei->SetCenter(itk::MakeVector(0., 0., 0.)); + rei->SetCenter(itk::MakePoint(0., 0., 0.)); rei->SetAxis(itk::MakeVector(90., 90., 90.)); rei->SetInput(projectionsSource->GetOutput()); diff --git a/test/rtkdecomposespectralprojectionstest.cxx b/test/rtkdecomposespectralprojectionstest.cxx index 1bb19f4ea..df644733a 100644 --- a/test/rtkdecomposespectralprojectionstest.cxx +++ b/test/rtkdecomposespectralprojectionstest.cxx @@ -102,7 +102,7 @@ main(int argc, char * argv[]) for (unsigned int material = 0; material < 3; material++) { auto semiprincipalaxis = itk::MakeVector(10., 10., 10.); - auto center = itk::MakeVector(15., 0., 15.); + auto center = itk::MakePoint(15., 0., 15.); rei->SetAngle(0.); if (material == 2) // water rei->SetDensity(1.); diff --git a/test/rtkdrawgeometricphantomtest.cxx b/test/rtkdrawgeometricphantomtest.cxx index e741be45a..484684544 100644 --- a/test/rtkdrawgeometricphantomtest.cxx +++ b/test/rtkdrawgeometricphantomtest.cxx @@ -100,7 +100,7 @@ main(int argc, char * argv[]) dcl->SetInput(tomographySource->GetOutput()); dcl->SetAxis(itk::MakeVector(100., 0., 100.)); - dcl->SetCenter(itk::MakeVector(2., 2., 2.)); + dcl->SetCenter(itk::MakePoint(2., 2., 2.)); dcl->SetAngle(0.); dcl->SetDensity(2.); dcl->InPlaceOff(); @@ -109,7 +109,7 @@ main(int argc, char * argv[]) auto dco = rtk::DrawConeImageFilter::New(); dco->SetInput(tomographySource->GetOutput()); dco->SetAxis(itk::MakeVector(25., -50., 25.)); - dco->SetCenter(itk::MakeVector(2., 2., 2.)); + dco->SetCenter(itk::MakePoint(2., 2., 2.)); dco->SetAngle(0.); dco->SetDensity(-0.54); diff --git a/test/rtkforwardattenuatedprojectiontest.cxx b/test/rtkforwardattenuatedprojectiontest.cxx index 4fbc07609..f7cfbd050 100644 --- a/test/rtkforwardattenuatedprojectiontest.cxx +++ b/test/rtkforwardattenuatedprojectiontest.cxx @@ -79,7 +79,7 @@ main(int, char **) auto deif = rtk::DrawEllipsoidImageFilter::New(); auto axis_vol = itk::MakeVector(50., 50., 50.); - auto center_vol = itk::MakeVector(0., 0., -30.); + auto center_vol = itk::MakePoint(0., 0., -30.); deif->SetInput(volInput->GetOutput()); deif->SetCenter(center_vol); deif->SetAxis(axis_vol); @@ -89,7 +89,7 @@ main(int, char **) typename OutputImageType::Pointer attenuationMap, volumeSource; volumeSource = deif->GetOutput(); volumeSource->DisconnectPipeline(); - deif->SetCenter(itk::MakeVector(0., 0., 0.)); + deif->SetCenter(itk::MakePoint(0., 0., 0.)); deif->SetAxis(itk::MakeVector(90, 90, 90)); deif->SetDensity(att); deif->Update(); @@ -158,7 +158,7 @@ main(int, char **) auto sphere_attenuation = REIType::New(); sphere_attenuation->SetAngle(0); sphere_attenuation->SetDensity(1); - sphere_attenuation->SetCenter(itk::MakeVector(0., 0., 0.)); + sphere_attenuation->SetCenter(itk::MakePoint(0., 0., 0.)); sphere_attenuation->SetAxis(itk::MakeVector(90, 90, 90)); sphere_attenuation->SetInput(projInput->GetOutput()); auto sphere_emission = REIType::New(); diff --git a/test/rtkforwardprojectiontest.cxx b/test/rtkforwardprojectiontest.cxx index 7b1ad329c..417aa40e3 100644 --- a/test/rtkforwardprojectiontest.cxx +++ b/test/rtkforwardprojectiontest.cxx @@ -90,8 +90,8 @@ main(int, char **) auto rbi = rtk::RayBoxIntersectionImageFilter::New(); rbi->InPlaceOff(); rbi->SetInput(projInput->GetOutput()); - rbi->SetBoxMin(itk::MakeVector(-126.0, -126.0, -126.0)); - rbi->SetBoxMax(itk::MakeVector(126.0, 126.0, 47.6)); + rbi->SetBoxMin(itk::MakePoint(-126.0, -126.0, -126.0)); + rbi->SetBoxMax(itk::MakePoint(126.0, 126.0, 47.6)); // Streaming filter to test for unusual regions auto stream = itk::StreamingImageFilter::New(); @@ -133,7 +133,7 @@ main(int, char **) #endif std::cout << "\n\n****** Case 2: outer ray source ******" << std::endl; - rbi->SetBoxMax(itk::MakeVector(126.0, 126.0, 126.0)); + rbi->SetBoxMax(itk::MakePoint(126.0, 126.0, 126.0)); // Geometry using GeometryType = rtk::ThreeDCircularProjectionGeometry; diff --git a/test/rtkfourdconjugategradienttest.cxx b/test/rtkfourdconjugategradienttest.cxx index 98ca5e210..8c95eeccd 100644 --- a/test/rtkfourdconjugategradienttest.cxx +++ b/test/rtkfourdconjugategradienttest.cxx @@ -126,7 +126,7 @@ main(int, char **) // Ellipse 1 auto e1 = REIType::New(); auto semiprincipalaxis = itk::MakeVector(60., 30., 60.); - auto center = itk::MakeVector(0., 0., 0.); + auto center = itk::MakePoint(0., 0., 0.); e1->SetInput(oneProjectionSource->GetOutput()); e1->SetGeometry(oneProjGeometry); e1->SetDensity(2.); @@ -183,7 +183,7 @@ main(int, char **) axis.Fill(60.); axis[1] = 30; de1->SetAxis(axis); - DEType::VectorType center; + DEType::PointType center; center.Fill(0.); de1->SetCenter(center); de1->SetAngle(0.); @@ -197,7 +197,7 @@ main(int, char **) DEType::VectorType axis2; axis2.Fill(8.); de2->SetAxis(axis2); - DEType::VectorType center2; + DEType::PointType center2; center2[0] = 4 * (itk::Math::abs((4 + n) % 8 - 4.) - 2.); center2[1] = 0.; center2[2] = 0.; diff --git a/test/rtkfourdroostertest.cxx b/test/rtkfourdroostertest.cxx index b57c865b4..7df15a21d 100644 --- a/test/rtkfourdroostertest.cxx +++ b/test/rtkfourdroostertest.cxx @@ -129,7 +129,7 @@ main(int, char **) // Ellipse 1 auto e1 = REIType::New(); auto semiprincipalaxis = itk::MakeVector(60., 30., 60.); - auto center = itk::MakeVector(0., 0., 0.); + auto center = itk::MakePoint(0., 0., 0.); e1->SetInput(oneProjectionSource->GetOutput()); e1->SetGeometry(oneProjGeometry); e1->SetDensity(2.); @@ -238,7 +238,7 @@ main(int, char **) axis.Fill(60.); axis[1] = 30; de1->SetAxis(axis); - DEType::VectorType center; + DEType::PointType center; center.Fill(0.); de1->SetCenter(center); de1->SetAngle(0.); @@ -252,7 +252,7 @@ main(int, char **) DEType::VectorType axis2; axis2.Fill(8.); de2->SetAxis(axis2); - DEType::VectorType center2; + DEType::PointType center2; center2[0] = 4 * (itk::Math::abs((4 + n) % 8 - 4.) - 2.); center2[1] = 0.; center2[2] = 0.; @@ -276,7 +276,7 @@ main(int, char **) axis.Fill(15.); axis[0] = 20; roi->SetAxis(axis); - DEType::VectorType center; + DEType::PointType center; center.Fill(0.); roi->SetCenter(center); roi->SetAngle(0.); diff --git a/test/rtkfourdsarttest.cxx b/test/rtkfourdsarttest.cxx index b6626a314..0b8490d40 100644 --- a/test/rtkfourdsarttest.cxx +++ b/test/rtkfourdsarttest.cxx @@ -173,7 +173,7 @@ main(int, char **) // Ellipse 1 auto e1 = REIType::New(); auto semiprincipalaxis = itk::MakeVector(60., 30., 60.); - auto center = itk::MakeVector(0., 0., 0.); + auto center = itk::MakePoint(0., 0., 0.); e1->SetInput(oneProjectionSource->GetOutput()); e1->SetGeometry(oneProjGeometry); e1->SetDensity(2.); @@ -230,7 +230,7 @@ main(int, char **) axis.Fill(60.); axis[1] = 30; de1->SetAxis(axis); - DEType::VectorType center; + DEType::PointType center; center.Fill(0.); de1->SetCenter(center); de1->SetAngle(0.); @@ -244,7 +244,7 @@ main(int, char **) DEType::VectorType axis2; axis2.Fill(8.); de2->SetAxis(axis2); - DEType::VectorType center2; + DEType::PointType center2; center2[0] = 4 * (itk::Math::abs((4 + n) % 8 - 4.) - 2.); center2[1] = 0.; center2[2] = 0.; diff --git a/test/rtkmotioncompensatedfdktest.cxx b/test/rtkmotioncompensatedfdktest.cxx index 85502a8e6..96a80c88f 100644 --- a/test/rtkmotioncompensatedfdktest.cxx +++ b/test/rtkmotioncompensatedfdktest.cxx @@ -94,7 +94,7 @@ main(int, char **) // Ellipse 1 auto e1 = REIType::New(); auto semiprincipalaxis = itk::MakeVector(60., 60., 60.); - auto center = itk::MakeVector(0., 0., 0.); + auto center = itk::MakePoint(0., 0., 0.); e1->SetInput(oneProjectionSource->GetOutput()); e1->SetGeometry(oneProjGeometry); e1->SetDensity(2.); @@ -111,7 +111,7 @@ main(int, char **) e2->SetGeometry(oneProjGeometry); e2->SetDensity(-1.); e2->SetAxis(itk::MakeVector(8., 8., 8.)); - e2->SetCenter(itk::MakeVector(4 * (itk::Math::abs((4 + noProj) % 8 - 4.) - 2.), 0., 0.)); + e2->SetCenter(itk::MakePoint(4 * (itk::Math::abs((4 + noProj) % 8 - 4.) - 2.), 0., 0.)); e2->SetAngle(0.); e2->Update(); @@ -197,7 +197,7 @@ main(int, char **) e1->SetInput(tomographySource->GetOutput()); e1->SetDensity(2.); e1->SetAxis(itk::MakeVector(60., 60., 60.)); - e1->SetCenter(itk::MakeVector(0., 0., 0.)); + e1->SetCenter(itk::MakePoint(0., 0., 0.)); e1->SetAngle(0.); e1->InPlaceOff(); TRY_AND_EXIT_ON_ITK_EXCEPTION(e1->Update()) @@ -207,7 +207,7 @@ main(int, char **) e2->SetInput(e1->GetOutput()); e2->SetDensity(-1.); e2->SetAxis(itk::MakeVector(8., 8., 8.)); - e2->SetCenter(itk::MakeVector(0., 0., 0.)); + e2->SetCenter(itk::MakePoint(0., 0., 0.)); e2->SetAngle(0.); e2->InPlaceOff(); TRY_AND_EXIT_ON_ITK_EXCEPTION(e2->Update()) diff --git a/test/rtkosemtest.cxx b/test/rtkosemtest.cxx index 5a8c4e497..3a909ab5d 100644 --- a/test/rtkosemtest.cxx +++ b/test/rtkosemtest.cxx @@ -94,7 +94,7 @@ main(int, char **) REIType::Pointer rei; auto semiprincipalaxis = itk::MakeVector(60., 60., 60.); - auto center = itk::MakeVector(0., 0., 0.); + auto center = itk::MakePoint(0., 0., 0.); rei = REIType::New(); rei->SetAngle(0.); rei->SetDensity(1.); diff --git a/test/rtkquadrictest.cxx b/test/rtkquadrictest.cxx index b771e8f81..92eea3ba6 100644 --- a/test/rtkquadrictest.cxx +++ b/test/rtkquadrictest.cxx @@ -20,9 +20,9 @@ main(int, char **) cylinder->SetA(100. - 1.42109e-14); cylinder->SetC(100. - 1.42109e-14); cylinder->SetJ(-1.); - rtk::QuadricShape::ScalarType infDist, supDist; - auto rayOrigin = itk::MakeVector(52.43581919641932, -0.5, 998.6243011589495); + rtk::QuadricShape::ScalarType nearDist, farDist; + auto rayOrigin = itk::MakePoint(52.43581919641932, -0.5, 998.6243011589495); auto rayDirection = itk::MakeVector(-0.05233595624294384, 0., -0.9986295347545739); - TRY_AND_EXIT_ON_ITK_EXCEPTION(cylinder->IsIntersectedByRay(rayOrigin, rayDirection, infDist, supDist)); + TRY_AND_EXIT_ON_ITK_EXCEPTION(cylinder->IsIntersectedByRay(rayOrigin, rayDirection, nearDist, farDist)); return EXIT_SUCCESS; } diff --git a/test/rtkregularizedconjugategradienttest.cxx b/test/rtkregularizedconjugategradienttest.cxx index 2e4946cff..ea0a94294 100644 --- a/test/rtkregularizedconjugategradienttest.cxx +++ b/test/rtkregularizedconjugategradienttest.cxx @@ -83,7 +83,7 @@ main(int, char **) rei = REIType::New(); rei->SetAngle(0.); rei->SetDensity(1.); - rei->SetCenter(itk::MakeVector(0., 0., 0.)); + rei->SetCenter(itk::MakePoint(0., 0., 0.)); rei->SetAxis(itk::MakeVector(90., 90., 90.)); rei->SetInput(projectionsSource->GetOutput()); rei->SetGeometry(geometry); diff --git a/test/rtksarttest.cxx b/test/rtksarttest.cxx index 70ed6b304..f4560d4cb 100644 --- a/test/rtksarttest.cxx +++ b/test/rtksarttest.cxx @@ -83,7 +83,7 @@ main(int, char **) rei = REIType::New(); rei->SetAngle(0.); rei->SetDensity(1.); - rei->SetCenter(itk::MakeVector(0., 0., 0.)); + rei->SetCenter(itk::MakePoint(0., 0., 0.)); rei->SetAxis(itk::MakeVector(90., 90., 90.)); rei->SetInput(projectionsSource->GetOutput()); diff --git a/test/rtkselectoneprojpercycletest.cxx b/test/rtkselectoneprojpercycletest.cxx index 807362cd6..8e211abd4 100644 --- a/test/rtkselectoneprojpercycletest.cxx +++ b/test/rtkselectoneprojpercycletest.cxx @@ -77,7 +77,7 @@ main(int, char **) // Ellipse 1 auto e1 = REIType::New(); auto semiprincipalaxis = itk::MakeVector(60., 60., 60.); - auto center = itk::MakeVector(0., 0., 0.); + auto center = itk::MakePoint(0., 0., 0.); e1->SetInput(oneProjectionSource->GetOutput()); e1->SetGeometry(oneProjGeometry); e1->SetDensity(2.); diff --git a/test/rtkspectralonesteptest.cxx b/test/rtkspectralonesteptest.cxx index b1d468208..7c417a8f0 100644 --- a/test/rtkspectralonesteptest.cxx +++ b/test/rtkspectralonesteptest.cxx @@ -156,7 +156,7 @@ main(int argc, char * argv[]) rei = REIType::New(); rei->SetAngle(0.); - rei->SetCenter(itk::MakeVector(0., 0., 0.)); + rei->SetCenter(itk::MakePoint(0., 0., 0.)); rei->SetAxis(itk::MakeVector(90., 90., 90.)); rei->SetInput(projectionsSource->GetOutput()); rei->SetGeometry(geometry); diff --git a/test/rtkwarpfourdtoprojectionstacktest.cxx b/test/rtkwarpfourdtoprojectionstacktest.cxx index b29e6c233..e67a4c2e9 100644 --- a/test/rtkwarpfourdtoprojectionstacktest.cxx +++ b/test/rtkwarpfourdtoprojectionstacktest.cxx @@ -138,7 +138,7 @@ main(int, char **) // Ellipse 1 auto e1 = REIType::New(); auto semiprincipalaxis = itk::MakeVector(60., 30., 60.); - auto center = itk::MakeVector(0., 0., 0.); + auto center = itk::MakePoint(0., 0., 0.); e1->SetInput(oneProjectionSource->GetOutput()); e1->SetGeometry(oneProjGeometry); e1->SetDensity(1.); @@ -266,7 +266,7 @@ main(int, char **) axis.Fill(60.); axis[1] = 30; de1->SetAxis(axis); - DEType::VectorType center; + DEType::PointType center; center.Fill(0.); de1->SetCenter(center); de1->SetAngle(0.); @@ -280,7 +280,7 @@ main(int, char **) DEType::VectorType axis2; axis2.Fill(8.); de2->SetAxis(axis2); - DEType::VectorType center2; + DEType::PointType center2; center2[0] = 4 * (itk::Math::abs((4 + n) % 8 - 4.) - 2.); center2[1] = 0.; center2[2] = 0.; diff --git a/test/rtkwarpprojectionstacktofourdtest.cxx b/test/rtkwarpprojectionstacktofourdtest.cxx index ac349d593..df69fbfe7 100644 --- a/test/rtkwarpprojectionstacktofourdtest.cxx +++ b/test/rtkwarpprojectionstacktofourdtest.cxx @@ -140,7 +140,7 @@ main(int, char **) // Ellipse 1 auto e1 = REIType::New(); auto semiprincipalaxis = itk::MakeVector(60., 30., 60.); - auto center = itk::MakeVector(0., 0., 0.); + auto center = itk::MakePoint(0., 0., 0.); e1->SetInput(oneProjectionSource->GetOutput()); e1->SetGeometry(oneProjGeometry); e1->SetDensity(1.); diff --git a/test/rtkwarptest.cxx b/test/rtkwarptest.cxx index d3a869a61..ddf25bd11 100644 --- a/test/rtkwarptest.cxx +++ b/test/rtkwarptest.cxx @@ -82,7 +82,7 @@ main(int, char **) DEType::VectorType axis; axis.Fill(60.); e1->SetAxis(axis); - DEType::VectorType center; + DEType::PointType center; center.Fill(0.); e1->SetCenter(center); e1->SetAngle(0.); @@ -96,7 +96,7 @@ main(int, char **) DEType::VectorType axis2; axis2.Fill(8.); e2->SetAxis(axis2); - DEType::VectorType center2; + DEType::PointType center2; center2.Fill(0.); e2->SetCenter(center2); e2->SetAngle(0.); diff --git a/test/rtkzengforwardprojectiontest.cxx b/test/rtkzengforwardprojectiontest.cxx index 6d6040b9c..304388365 100644 --- a/test/rtkzengforwardprojectiontest.cxx +++ b/test/rtkzengforwardprojectiontest.cxx @@ -76,7 +76,7 @@ main(int, char **) auto volInput = rtk::DrawEllipsoidImageFilter::New(); auto axis_vol = itk::MakeVector(32., 32., 32.); - auto center_vol = itk::MakeVector(0., 0., 0.); + auto center_vol = itk::MakePoint(0., 0., 0.); volInput->SetInput(tomographySource->GetOutput()); volInput->SetCenter(center_vol); volInput->SetAxis(axis_vol);