19 #ifndef rtkJosephForwardAttenuatedProjectionImageFilter_h 20 #define rtkJosephForwardAttenuatedProjectionImageFilter_h 22 #include "rtkConfiguration.h" 26 #include <itkPixelTraits.h> 42 template <
class TInput,
class TCoordinateType,
class TOutput = TInput>
48 for (std::size_t i = 0; i < itk::ITK_MAX_THREADS; i++)
50 m_AttenuationRay[i] = 0;
51 m_AttenuationPixel[i] = 0;
66 return !(*
this != other);
71 const double stepLengthInVoxel,
72 const TCoordinateType weight,
76 const double w = weight * stepLengthInVoxel;
78 m_AttenuationRay[threadId] += w * (p + m_AttenuationMinusEmissionMapsPtrDiff)[i];
79 m_AttenuationPixel[threadId] += w * (p + m_AttenuationMinusEmissionMapsPtrDiff)[i];
86 m_AttenuationMinusEmissionMapsPtrDiff = pd;
91 return m_AttenuationRay;
96 return m_AttenuationPixel;
106 TInput m_AttenuationRay[itk::ITK_MAX_THREADS];
107 TInput m_AttenuationPixel[itk::ITK_MAX_THREADS];
108 TInput m_Ex1[itk::ITK_MAX_THREADS];
118 template <
class TInput,
class TOutput>
135 return !(*
this != other);
139 operator()(
const ThreadIdType threadId, TOutput & sumValue,
const TInput volumeValue,
const VectorType & stepInMM)
141 TInput ex2 = exp(-m_AttenuationRay[threadId] * stepInMM.GetNorm());
144 if (m_AttenuationPixel[threadId] > 0)
146 wf = (m_Ex1[threadId] - ex2) / m_AttenuationPixel[threadId];
150 wf = m_Ex1[threadId] * stepInMM.GetNorm();
153 m_Ex1[threadId] = ex2;
154 m_AttenuationPixel[threadId] = 0;
155 sumValue += wf * volumeValue;
161 m_AttenuationRay = attenuationRayVector;
166 m_AttenuationPixel = attenuationPixelVector;
187 template <
class TInput,
class TOutput>
204 return !(*
this != other);
209 const TInput & input,
211 const TOutput & rayCastValue,
218 output = input + rayCastValue;
219 m_Attenuation[threadId] = 0;
226 m_Attenuation = attenuationVector;
259 typename TInputImage::PixelType,
260 typename itk::PixelTraits<typename TInputImage::PixelType>::ValueType>,
261 class TProjectedValueAccumulation =
268 TInterpolationWeightMultiplication,
269 TProjectedValueAccumulation,
279 TInterpolationWeightMultiplication,
280 TProjectedValueAccumulation,
288 using VectorType = itk::Vector<CoordinateType, TInputImage::ImageDimension>;
291 static constexpr
unsigned int InputImageDimension = TInputImage::ImageDimension;
305 GenerateInputRequestedRegion()
override;
308 BeforeThreadedGenerateData()
override;
313 VerifyInputInformation()
const override;
317 #ifndef ITK_MANUAL_INSTANTIATION 318 # include "rtkJosephForwardAttenuatedProjectionImageFilter.hxx" itk::SmartPointer< const Self > ConstPointer
TOutput * GetAttenuationPixel()
Base class for forward projection, i.e. accumulation along x-ray lines.
typename TOutputImage::PixelType OutputPixelType
typename TInputImage::PixelType InputPixelType
void SetAttenuationVector(TInput *attenuationVector)
TOutput * GetAttenuationRay()
itk::Vector< double, 3 > VectorType
Joseph forward projection.
Function to accumulate the ray casting on the projection.
bool operator!=(const ProjectedValueAccumulationAttenuated &) const
TInput * m_AttenuationRay
bool operator!=(const InterpolationWeightMultiplicationAttenuated &) const
bool operator==(const ProjectedValueAccumulationAttenuated &other) const
std::ptrdiff_t m_AttenuationMinusEmissionMapsPtrDiff
void operator()(const ThreadIdType threadId, TOutput &sumValue, const TInput volumeValue, const VectorType &stepInMM)
itk::Vector< CoordinateType, TInputImage::ImageDimension > VectorType
void SetAttenuationPixelVector(TInput *attenuationPixelVector)
itk::InPlaceImageFilter< TInputImage, TOutputImage > Superclass
bool operator==(const ComputeAttenuationCorrection &other) const
TOutput operator()(const ThreadIdType threadId, const double stepLengthInVoxel, const TCoordinateType weight, const TInput *p, const int i)
TInput * m_AttenuationPixel
typename TOutputImage::RegionType OutputImageRegionType
void SetAttenuationMinusEmissionMapsPtrDiff(std::ptrdiff_t pd)
itk::Vector< double, 3 > VectorType
bool operator==(const InterpolationWeightMultiplicationAttenuated &other) const
Joseph forward projection.
InterpolationWeightMultiplicationAttenuated()
void SetAttenuationRayVector(TInput *attenuationRayVector)
itk::SmartPointer< Self > Pointer
Function to multiply the interpolation weights with the projected volume values and attenuation map...
void operator()(const ThreadIdType threadId, const TInput &input, TOutput &output, const TOutput &rayCastValue, const VectorType &, const VectorType &, const VectorType &, const VectorType &, const VectorType &)
Function to compute the attenuation correction on the projection.
bool operator!=(const ComputeAttenuationCorrection &) const