RTK  2.6.0
Reconstruction Toolkit
rtkMaximumIntensityProjectionImageFilter.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright RTK 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  * https://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 
19 #ifndef rtkMaximumIntensityProjectionImageFilter_h
20 #define rtkMaximumIntensityProjectionImageFilter_h
21 
23 
24 namespace rtk
25 {
26 namespace Functor
27 {
28 
36 template <class TInput, class TOutput>
37 class ITK_TEMPLATE_EXPORT MaximumIntensityAlongRay
38 {
39 public:
41 
42  MaximumIntensityAlongRay() = default;
43  ~MaximumIntensityAlongRay() = default;
44  bool
46  {
47  return false;
48  }
49  bool
50  operator==(const MaximumIntensityAlongRay & other) const
51  {
52  return !(*this != other);
53  }
54 
55  inline void
56  operator()(const ThreadIdType itkNotUsed(threadId),
57  TOutput & mipValue,
58  const TInput volumeValue,
59  const VectorType & itkNotUsed(stepInMM))
60  {
61  TOutput tmp = static_cast<TOutput>(volumeValue);
62  if (tmp > mipValue)
63  {
64  mipValue = tmp;
65  }
66  }
67 };
68 
76 template <class TInput, class TOutput>
78 {
79 public:
81 
82  bool
84  {
85  return false;
86  }
87  bool
89  {
90  return !(*this != other);
91  }
92 
93  inline void
94  operator()(const ThreadIdType itkNotUsed(threadId),
95  const TInput & input,
96  TOutput & output,
97  const TOutput & rayCastValue,
98  const VectorType & stepInMM,
99  const VectorType & itkNotUsed(source),
100  const VectorType & itkNotUsed(sourceToPixel),
101  const VectorType & itkNotUsed(nearestPoint),
102  const VectorType & itkNotUsed(farthestPoint)) const
103  {
104  TOutput tmp = static_cast<TOutput>(input);
105  if (tmp < rayCastValue)
106  {
107  tmp = rayCastValue;
108  }
109  output = tmp * stepInMM.GetNorm();
110  }
111 };
112 
113 } // end namespace Functor
114 
115 
127 template <class TInputImage,
128  class TOutputImage,
129  class TInterpolationWeightMultiplication = Functor::InterpolationWeightMultiplication<
130  typename TInputImage::PixelType,
132  class TProjectedValueAccumulation =
133  Functor::MaximumIntensityProjectedValueAccumulation<typename TInputImage::PixelType,
134  typename TOutputImage::PixelType>,
135  class TSumAlongRay =
136  Functor::MaximumIntensityAlongRay<typename TInputImage::PixelType, typename TOutputImage::PixelType>>
137 class ITK_TEMPLATE_EXPORT MaximumIntensityProjectionImageFilter
138  : public JosephForwardProjectionImageFilter<TInputImage,
139  TOutputImage,
140  TInterpolationWeightMultiplication,
141  TProjectedValueAccumulation,
142  TSumAlongRay>
143 {
144 public:
145  ITK_DISALLOW_COPY_AND_MOVE(MaximumIntensityProjectionImageFilter);
146 
150 
152  itkNewMacro(Self);
153 
155 #ifdef itkOverrideGetNameOfClassMacro
156  itkOverrideGetNameOfClassMacro(MaximumIntensityProjectionImageFilter);
157 #else
159 #endif
160 
161 
162 protected:
164  ~MaximumIntensityProjectionImageFilter() override = default;
165 };
166 } // end namespace rtk
167 
168 #endif
bool operator==(const MaximumIntensityProjectedValueAccumulation &other) const
void operator()(const ThreadIdType, TOutput &mipValue, const TInput volumeValue, const VectorType &)
typename TPixelType::ValueType ValueType
Function to calculate maximum intensity step along the ray projection.
bool operator!=(const MaximumIntensityAlongRay &) const
Function to compute the maximum intensity (MIP) value along the ray projection.
bool operator==(const MaximumIntensityAlongRay &other) const
bool operator!=(const MaximumIntensityProjectedValueAccumulation &) const
unsigned int ThreadIdType
void operator()(const ThreadIdType, const TInput &input, TOutput &output, const TOutput &rayCastValue, const VectorType &stepInMM, const VectorType &, const VectorType &, const VectorType &, const VectorType &) const