NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkForwardImageProjector3Dto2D.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef itkForwardImageProjector3Dto2D_h
16 #define itkForwardImageProjector3Dto2D_h
17 
18 #include "itkRay.h"
20 
21 namespace itk
22 {
23 
28 template <class IntensityType = float>
29 class ITK_EXPORT ForwardImageProjector3Dto2D :
30  public ImageProjectionBaseClass2D3D<Image< IntensityType, 3>, // Input image
31  Image< IntensityType, 2> > // Output image
32 {
33 public:
36  typedef SmartPointer<Self> Pointer;
37  typedef SmartPointer<const Self> ConstPointer;
40 
42  itkNewMacro(Self);
43 
46 
49  typedef typename InputImageType::Pointer InputImagePointer;
50  typedef typename InputImageType::ConstPointer InputImageConstPointer;
53 
55  typedef typename OutputImageType::Pointer OutputImagePointer;
58  typedef typename OutputImageType::SpacingType OutputImageSpacingType;
59  typedef typename OutputImageType::PointType OutputImagePointType;
62 
64  itkStaticConstMacro(InputImageDimension, unsigned int, 3);
65  itkStaticConstMacro(OutputImageDimension, unsigned int, 2);
66 
74  virtual void GenerateOutputInformation(void);
75 
83  virtual void GenerateInputRequestedRegion(void);
84  virtual void EnlargeOutputRequestedRegion(DataObject *output);
85 
87  void SetProjectedImageSize(OutputImageSizeType &outImageSize) {m_OutputImageSize = outImageSize;};
89  void SetProjectedImageSpacing(OutputImageSpacingType &outImageSpacing) {
90  m_OutputImageSpacing = outImageSpacing;
91  this->GetOutput()->SetSpacing(m_OutputImageSpacing);
92  };
94  void SetProjectedImageOrigin(OutputImagePointType &outImageOrigin) {
95  m_OutputImageOrigin = outImageOrigin;
96  this->GetOutput()->SetOrigin(m_OutputImageOrigin);
97  };
98 
100  void SetRayIntegrationThreshold(double threshold) {m_Threshold = threshold;}
101 
103  void SetSingleThreadedExecution(void) {m_FlagMultiThreadedExecution = false;}
104 
105 protected:
108  void PrintSelf(std::ostream& os, Indent indent) const;
109 
120  virtual void BeforeThreadedGenerateData(void);
121 
132  virtual void AfterThreadedGenerateData(void);
133 
136  void GenerateData();
137 
148  void ThreadedGenerateData(const OutputImageRegionType& outputRegionForThread,
149  ThreadIdType threadId );
150 
152  OutputImageSizeType m_OutputImageSize;
154  OutputImageSpacingType m_OutputImageSpacing;
156  OutputImagePointType m_OutputImageOrigin;
157 
159  double m_Threshold;
160 
163 
164 private:
165  ForwardImageProjector3Dto2D(const Self&); //purposely not implemented
166  void operator=(const Self&); //purposely not implemented
167 
168 };
169 
170 } // end namespace itk
171 
172 #ifndef ITK_MANUAL_INSTANTIATION
173 #include "itkForwardImageProjector3Dto2D.txx"
174 #endif
175 
176 #endif
Image< IntensityType, 2 > OutputImageType
Definition: itkForwardImageProjector3Dto2D.h:54
OutputImageType::PixelType OutputImagePixelType
Definition: itkForwardImageProjector3Dto2D.h:60
OutputImagePointType m_OutputImageOrigin
The origin of the output projected image.
Definition: itkForwardImageProjector3Dto2D.h:156
ImageType::SizeType SizeType
Definition: niftkMakeLapUSProbeBasicModel.cxx:31
OutputImageType::SpacingType OutputImageSpacingType
Definition: itkForwardImageProjector3Dto2D.h:58
The base class for 2D-3D forward and back projection.
Definition: itkImageProjectionBaseClass2D3D.h:31
SmartPointer< Self > Pointer
Definition: itkForwardImageProjector3Dto2D.h:36
void SetProjectedImageOrigin(OutputImagePointType &outImageOrigin)
Set the origin of the output projected image.
Definition: itkForwardImageProjector3Dto2D.h:94
InputImageType::RegionType InputImageRegionType
Definition: itkForwardImageProjector3Dto2D.h:51
Definition: niftkITKAffineResampleImage.cxx:74
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
void SetRayIntegrationThreshold(double threshold)
Set the ray integration threshold.
Definition: itkForwardImageProjector3Dto2D.h:100
OutputImageType::Pointer OutputImagePointer
Definition: itkForwardImageProjector3Dto2D.h:55
InputImageType::Pointer InputImagePointer
Definition: itkForwardImageProjector3Dto2D.h:49
OutputImageSizeType m_OutputImageSize
The size of the output projected image.
Definition: itkForwardImageProjector3Dto2D.h:152
OutputImageType::RegionType OutputImageRegionType
Definition: itkForwardImageProjector3Dto2D.h:56
OutputImageType::IndexType OutputImageIndexType
Definition: itkForwardImageProjector3Dto2D.h:61
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
double m_Threshold
The threshold above which voxels along the ray path are integrated.
Definition: itkForwardImageProjector3Dto2D.h:159
ImageProjectionBaseClass2D3D< Image< IntensityType, 3 >, Image< IntensityType, 2 > > Superclass
Definition: itkForwardImageProjector3Dto2D.h:39
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
InputImageType::PixelType InputImagePixelType
Definition: itkForwardImageProjector3Dto2D.h:52
Class to project a 3D image into 2D.
Definition: itkForwardImageProjector3Dto2D.h:29
void SetProjectedImageSize(OutputImageSizeType &outImageSize)
Set the size in pixels of the output projected image.
Definition: itkForwardImageProjector3Dto2D.h:87
OutputImageSpacingType m_OutputImageSpacing
The resolution of the output projected image.
Definition: itkForwardImageProjector3Dto2D.h:154
OutputImageType::PointType OutputImagePointType
Definition: itkForwardImageProjector3Dto2D.h:59
bool m_FlagMultiThreadedExecution
Flag to turn multithreading on or off.
Definition: itkForwardImageProjector3Dto2D.h:162
InputImageType::ConstPointer InputImageConstPointer
Definition: itkForwardImageProjector3Dto2D.h:50
Simultaneous itk::Image and itk::Array (and hence vnl_vector) class.
void SetSingleThreadedExecution(void)
For debugging purposes, set single threaded execution.
Definition: itkForwardImageProjector3Dto2D.h:103
Image< IntensityType, 3 > InputImageType
Definition: itkForwardImageProjector3Dto2D.h:45
virtual ~ForwardImageProjector3Dto2D(void)
Definition: itkForwardImageProjector3Dto2D.h:107
OutputImageType::SizeType OutputImageSizeType
Definition: itkForwardImageProjector3Dto2D.h:57
SmartPointer< const Self > ConstPointer
Definition: itkForwardImageProjector3Dto2D.h:37
void SetProjectedImageSpacing(OutputImageSpacingType &outImageSpacing)
Set the resolution in mm of the output projected image.
Definition: itkForwardImageProjector3Dto2D.h:89
ForwardImageProjector3Dto2D Self
Definition: itkForwardImageProjector3Dto2D.h:35