ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
rtkWeidingerForwardModelImageFilter.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#ifndef rtkWeidingerForwardModelImageFilter_h
19#define rtkWeidingerForwardModelImageFilter_h
20
22#include "rtkMacro.h"
23
24#ifdef RTK_USE_CUDA
25# include <itkCudaImage.h>
26#endif
27
28namespace rtk
29{
41template <class TDecomposedProjections,
42 class TMeasuredProjections,
43 class TIncidentSpectrum,
44 class TProjections =
46class ITK_TEMPLATE_EXPORT WeidingerForwardModelImageFilter
47 : public itk::ImageToImageFilter<TDecomposedProjections, TDecomposedProjections>
48{
49public:
50 ITK_DISALLOW_COPY_AND_MOVE(WeidingerForwardModelImageFilter);
51
56
58 itkNewMacro(Self);
59
61 itkOverrideGetNameOfClassMacro(WeidingerForwardModelImageFilter);
62
64 static constexpr unsigned int nBins = TMeasuredProjections::PixelType::Dimension;
65 static constexpr unsigned int nMaterials = TDecomposedProjections::PixelType::Dimension;
66
68 using dataType = typename TDecomposedProjections::PixelType::ValueType;
69
74 using TOutputImage1 = TDecomposedProjections;
76#ifdef RTK_USE_CUDA
77 using TOutputImage2 = itk::CudaImage<TPixelOutput2, TDecomposedProjections::ImageDimension>;
78#else
80#endif
81
87
89 void
90 SetInputDecomposedProjections(const TDecomposedProjections * decomposedProjections);
91 void
92 SetInputMeasuredProjections(const TMeasuredProjections * measuredProjections);
93 void
94 SetInputIncidentSpectrum(const TIncidentSpectrum * incidentSpectrum);
95#ifndef ITK_FUTURE_LEGACY_REMOVE
96 void
97 SetInputMaterialProjections(const TDecomposedProjections * decomposedProjections);
98 void
99 SetInputPhotonCounts(const TMeasuredProjections * measuredProjections);
100 void
101 SetInputSpectrum(const TIncidentSpectrum * incidentSpectrum);
102#endif
103 void
104 SetInputProjectionsOfOnes(const TProjections * projectionsOfOnes);
105
107 using BinnedDetectorResponseType = vnl_matrix<dataType>;
108 using MaterialAttenuationsType = vnl_matrix<dataType>;
109
111 itkGetConstReferenceMacro(BinnedDetectorResponse, BinnedDetectorResponseType);
112 itkGetConstReferenceMacro(MaterialAttenuations, MaterialAttenuationsType);
113 virtual void
115 virtual void
117
118protected:
121
122 void
124 void
125 VerifyInputInformation() const override
126 {}
127
129 void
130 DynamicThreadedGenerateData(const typename TOutputImage1::RegionType & outputRegionForThread) override;
131
137
139 typename TDecomposedProjections::ConstPointer
141 typename TMeasuredProjections::ConstPointer
143 typename TIncidentSpectrum::ConstPointer
145#ifndef ITK_FUTURE_LEGACY_REMOVE
146 typename TDecomposedProjections::ConstPointer
147 GetInputMaterialProjections();
148 typename TMeasuredProjections::ConstPointer
149 GetInputPhotonCounts();
150 typename TIncidentSpectrum::ConstPointer
151 GetInputSpectrum();
152#endif
153 typename TProjections::ConstPointer
155
160};
161} // namespace rtk
162
163
164#ifndef ITK_MANUAL_INSTANTIATION
165# include "rtkWeidingerForwardModelImageFilter.hxx"
166#endif
167
168#endif
Base class for filters that take an image as input and produce an image as output.
Templated n-dimensional image class.
Definition itkImage.h:89
DataObjectPointerArray::size_type DataObjectPointerArraySizeType
DataObject::Pointer DataObjectPointer
DataObject::DataObjectIdentifierType DataObjectIdentifierType
Implements transparent reference counting.
A templated class holding a n-Dimensional vector.
Definition itkVector.h:63
TDecomposedProjections::ConstPointer GetInputDecomposedProjections()
virtual void SetMaterialAttenuations(const MaterialAttenuationsType &matAtt)
void SetInputMeasuredProjections(const TMeasuredProjections *measuredProjections)
void SetInputIncidentSpectrum(const TIncidentSpectrum *incidentSpectrum)
void SetInputProjectionsOfOnes(const TProjections *projectionsOfOnes)
void DynamicThreadedGenerateData(const typename TOutputImage1::RegionType &outputRegionForThread) override
TIncidentSpectrum::ConstPointer GetInputIncidentSpectrum()
~WeidingerForwardModelImageFilter() override=default
void VerifyInputInformation() const override
Verifies that the input images occupy the same physical space and the each index is at the same physi...
void SetInputDecomposedProjections(const TDecomposedProjections *decomposedProjections)
itk::ProcessObject::DataObjectPointer MakeOutput(itk::ProcessObject::DataObjectPointerArraySizeType idx) override
itk::ProcessObject::DataObjectPointer MakeOutput(const itk::ProcessObject::DataObjectIdentifierType &) override
virtual void SetBinnedDetectorResponse(const BinnedDetectorResponseType &detResp)
TMeasuredProjections::ConstPointer GetInputMeasuredProjections()
TProjections::ConstPointer GetInputProjectionsOfOnes()
unsigned long SizeValueType
Definition itkIntTypes.h:82