ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
rtkProjectionsReader.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 rtkProjectionsReader_h
20#define rtkProjectionsReader_h
21
22// ITK
23#include <itkImageIOFactory.h>
24#include <itkImageSource.h>
26
27// RTK
30
31// Standard lib
32#include <string>
33#include <vector>
34
35namespace rtk
36{
37
125template <class TOutputImage>
126class ITK_TEMPLATE_EXPORT ProjectionsReader : public itk::ImageSource<TOutputImage>
127{
128public:
129 ITK_DISALLOW_COPY_AND_MOVE(ProjectionsReader);
130
135
137 itkNewMacro(Self);
138
140 itkOverrideGetNameOfClassMacro(ProjectionsReader);
141
143 using OutputImageType = TOutputImage;
144 using OutputImagePointer = typename OutputImageType::Pointer;
145 using OutputImageRegionType = typename OutputImageType::RegionType;
146 using OutputImagePixelType = typename OutputImageType::PixelType;
147 using OutputImageDirectionType = typename OutputImageType::DirectionType;
148 using OutputImageSpacingType = typename OutputImageType::SpacingType;
149 using OutputImagePointType = typename OutputImageType::PointType;
150 using OutputImageSizeType = typename OutputImageType::SizeType;
151
152 using FileNamesContainer = std::vector<std::string>;
155 using WaterPrecorrectionVectorType = std::vector<double>;
156
161
163 static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension;
164
167 void
169 {
170 if (m_FileNames != name)
171 {
172 m_FileNames = name;
173 this->Modified();
174 }
175 }
176 [[nodiscard]] const FileNamesContainer &
178 {
179 return m_FileNames;
180 }
181
184 itkGetConstMacro(Origin, OutputImagePointType);
185
187 itkGetConstMacro(Spacing, OutputImageSpacingType);
188
190 itkGetConstMacro(Direction, OutputImageDirectionType);
191
193 itkSetMacro(UpperBoundaryCropSize, OutputImageSizeType);
194 itkGetConstMacro(UpperBoundaryCropSize, OutputImageSizeType);
195 itkSetMacro(LowerBoundaryCropSize, OutputImageSizeType);
196 itkGetConstMacro(LowerBoundaryCropSize, OutputImageSizeType);
197
200 itkGetConstReferenceMacro(ShrinkFactors, ShrinkFactorsType);
201
204 itkGetConstReferenceMacro(MedianRadius, MedianRadiusType);
205 itkGetMacro(ConditionalMedianThresholdMultiplier, double);
206 itkSetMacro(ConditionalMedianThresholdMultiplier, double);
207
209 itkGetMacro(AirThreshold, double);
210 itkSetMacro(AirThreshold, double);
211
212 itkGetMacro(ScatterToPrimaryRatio, double);
213 itkSetMacro(ScatterToPrimaryRatio, double);
214
215 itkGetMacro(NonNegativityConstraintThreshold, double);
216 itkSetMacro(NonNegativityConstraintThreshold, double);
217
222 itkGetMacro(I0, double);
223 itkSetMacro(I0, double);
224
228 itkGetMacro(IDark, double);
229 itkSetMacro(IDark, double);
230
232 itkGetMacro(WaterPrecorrectionCoefficients, WaterPrecorrectionVectorType);
233 virtual void
235 {
236 if (this->m_WaterPrecorrectionCoefficients != _arg)
237 {
239 this->Modified();
240 }
241 }
242
245 itkSetMacro(ComputeLineIntegral, bool);
246 itkGetConstMacro(ComputeLineIntegral, bool);
247 itkBooleanMacro(ComputeLineIntegral);
248
251 itkGetMacro(VectorComponent, int);
252 itkSetMacro(VectorComponent, int);
253
260 itkSetObjectMacro(ImageIO, itk::ImageIOBase);
261 itkGetConstObjectMacro(ImageIO, itk::ImageIOBase);
262
265 void
267
268protected:
270 ~ProjectionsReader() override = default;
271 void
272 PrintSelf(std::ostream & os, itk::Indent indent) const override;
273
275 void
276 GenerateData() override;
277
280
281private:
285 template <class TInputImage>
286 void
288 void
290 void
292
297
307
311
315
319
322
335 double m_AirThreshold{ 32000 };
339 double m_IDark{ 0. };
344};
345
346} // namespace rtk
347
348#ifndef ITK_MANUAL_INSTANTIATION
349# include "rtkProjectionsReader.hxx"
350#endif
351
352#endif // rtkProjectionsReader_h
Simulate a standard C array with copy semantics.
Base class for templated image classes.
Abstract superclass defines image IO interface.
SmartPointer< Self > Pointer
Base class for all process objects that output image data.
SmartPointer< Self > Pointer
Control indentation during Print() invocation.
Definition itkIndent.h:53
static constexpr T NonpositiveMin()
static constexpr T max(const T &)
virtual void Modified() const
SmartPointer< Self > Pointer
Implements transparent reference counting.
Pipeline object to control data streaming for large data processing.
typename itk::ConstNeighborhoodIterator< TInputImage >::RadiusType MedianRadiusType
void SetFileNames(const FileNamesContainer &name)
const FileNamesContainer & GetFileNames() const
void PropagateParametersToMiniPipeline()
itk::ImageSource< TOutputImage > Superclass
itk::ImageSource< TOutputImage >::Pointer m_RawCastFilter
FileNamesContainer m_FileNames
OutputImageSizeType m_LowerBoundaryCropSize
itk::ImageIOBase::Pointer m_ImageIO
void PropagateI0(itk::ImageBase< OutputImageDimension > **nextInputBase)
itk::FixedArray< unsigned int, TOutputImage::ImageDimension > ShrinkFactorsType
virtual void SetWaterPrecorrectionCoefficients(const WaterPrecorrectionVectorType _arg)
OutputImageSpacingType m_Spacing
typename OutputImageType::PixelType OutputImagePixelType
typename OutputImageType::SizeType OutputImageSizeType
WaterPrecorrectionVectorType m_WaterPrecorrectionCoefficients
OutputImagePointType m_Origin
itk::ProcessObject::Pointer m_VectorComponentSelectionFilter
typename OutputImageType::SpacingType OutputImageSpacingType
itk::ProcessObject::Pointer m_ElektaRawFilter
void PrintSelf(std::ostream &os, itk::Indent indent) const override
typename rtk::ConditionalMedianImageFilter< TOutputImage >::MedianRadiusType MedianRadiusType
std::vector< double > WaterPrecorrectionVectorType
typename OutputImageType::Pointer OutputImagePointer
std::vector< std::string > FileNamesContainer
void GenerateData() override
itk::SizeValueType m_DefaultBoundaryCropValue
itk::ProcessObject::Pointer m_RawDataReader
StreamingType::Pointer m_StreamingFilter
void GenerateOutputInformation() override
itk::StreamingImageFilter< TOutputImage, TOutputImage > StreamingType
ShrinkFactorsType m_ShrinkFactors
static constexpr unsigned int OutputImageDimension
typename OutputImageType::RegionType OutputImageRegionType
typename OutputImageType::DirectionType OutputImageDirectionType
itk::ImageSource< TOutputImage >::Pointer m_RawToAttenuationFilter
itk::ProcessObject::Pointer m_I0EstimationFilter
~ProjectionsReader() override=default
OutputImageDirectionType m_Direction
itk::ProcessObject::Pointer m_ChangeInformationFilter
itk::ProcessObject::Pointer m_ConditionalMedianFilter
typename OutputImageType::PointType OutputImagePointType
OutputImageSizeType m_DefaultBoundaryCropSize
itk::ProcessObject::Pointer m_ScatterFilter
itk::ProcessObject::Pointer m_BinningFilter
itk::ProcessObject::Pointer m_CropFilter
rtk::WaterPrecorrectionImageFilter< TOutputImage, TOutputImage > WaterPrecorrectionType
itk::SmartPointer< Self > Pointer
itk::ProcessObject::Pointer m_WaterPrecorrectionFilter
OutputImageSizeType m_UpperBoundaryCropSize
void ConnectElektaRawFilter(itk::ImageBase< OutputImageDimension > **nextInputBase)
Performs the classical water precorrection for beam hardening (Kachelriess, Med. Phys....
constexpr TContainer MakeFilled(typename TContainer::const_reference value)
unsigned long SizeValueType
Definition itkIntTypes.h:82
#define itkSetMacro(name, type)