NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkBackwardImageProjector2Dto3D.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 itkBackwardImageProjector2Dto3D_h
16 #define itkBackwardImageProjector2Dto3D_h
17 
18 #include "itkRay.h"
20 
21 namespace itk
22 {
23 
28 template <class IntensityType = float>
29 class ITK_EXPORT BackwardImageProjector2Dto3D :
30  public ImageProjectionBaseClass2D3D<Image<IntensityType, 2>, // Input image
31  Image<IntensityType, 3> > // 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  typedef typename InputImageType::SpacingType InputImageSpacingType;
54  typedef typename InputImageType::PointType InputImagePointType;
57 
59  typedef typename OutputImageType::Pointer OutputImagePointer;
60  typedef typename OutputImageType::ConstPointer OutputImageConstPointer;
63  typedef typename OutputImageType::SpacingType OutputImageSpacingType;
65  typedef typename OutputImageType::PointType OutputImagePointType;
66 
68  itkStaticConstMacro(InputImageDimension, unsigned int, 2);
69  itkStaticConstMacro(OutputImageDimension, unsigned int, 3);
70 
78  virtual void GenerateOutputInformation();
79 
87  virtual void GenerateInputRequestedRegion();
88  virtual void EnlargeOutputRequestedRegion(DataObject *output);
89 
91  void SetBackProjectedImageSize(OutputImageSizeType &outImageSize) {m_OutputImageSize = outImageSize;};
93  void SetBackProjectedImageSpacing(OutputImageSpacingType &outImageSpacing) {
94  m_OutputImageSpacing = outImageSpacing;
95  this->GetOutput()->SetSpacing(m_OutputImageSpacing);
96  };
98  void SetBackProjectedImageOrigin(OutputImagePointType &outImageOrigin) {
99  m_OutputImageOrigin = outImageOrigin;
100  this->GetOutput()->SetOrigin(m_OutputImageOrigin);
101  };
102 
104  void SetSingleThreadedExecution(void) {m_FlagMultiThreadedExecution = false;}
105 
107  void ClearVolumePriorToNextBackProjection(void) {m_ClearBackProjectedVolume = true;}
108 
109 
110 protected:
111 
114  void PrintSelf(std::ostream& os, Indent indent) const;
115 
117  void ClearVolume(void);
118 
121  virtual void BeforeThreadedGenerateData(void);
122 
124  virtual void AfterThreadedGenerateData(void);
125 
128  void GenerateData();
129 
131  void ThreadedGenerateData(const InputImageRegionType& inputRegionForThread,
132  ThreadIdType threadId );
133 
139  int SplitRequestedRegion(int i, int num, InputImageRegionType& splitRegion);
140 
144  static ITK_THREAD_RETURN_TYPE BackwardImageProjectorThreaderCallback( void *arg );
145 
147  OutputImageSizeType m_OutputImageSize;
149  OutputImageSpacingType m_OutputImageSpacing;
151  OutputImagePointType m_OutputImageOrigin;
152 
155 
158 
161  {
162  Pointer Filter;
163  };
164 
167  OutputImagePointer m_VoxelRayCount;
168 
169 
170 private:
171  BackwardImageProjector2Dto3D(const Self&); //purposely not implemented
172  void operator=(const Self&); //purposely not implemented
173 
174 };
175 
176 } // end namespace itk
177 
178 #ifndef ITK_MANUAL_INSTANTIATION
179 #include "itkBackwardImageProjector2Dto3D.txx"
180 #endif
181 
182 #endif
virtual ~BackwardImageProjector2Dto3D()
Definition: itkBackwardImageProjector2Dto3D.h:113
InputImageType::RegionType InputImageRegionType
Definition: itkBackwardImageProjector2Dto3D.h:51
Definition: itkBackwardImageProjector2Dto3D.h:160
void ClearVolumePriorToNextBackProjection(void)
Set the backprojection volume to zero prior to the next back-projection.
Definition: itkBackwardImageProjector2Dto3D.h:107
ImageProjectionBaseClass2D3D< Image< IntensityType, 2 >, Image< IntensityType, 3 > > Superclass
Definition: itkBackwardImageProjector2Dto3D.h:39
Class to project a 3D image into 2D.
Definition: itkBackwardImageProjector2Dto3D.h:29
Image< IntensityType, 2 > InputImageType
Definition: itkBackwardImageProjector2Dto3D.h:45
ImageType::SizeType SizeType
Definition: niftkMakeLapUSProbeBasicModel.cxx:31
InputImageType::PixelType InputImagePixelType
Definition: itkBackwardImageProjector2Dto3D.h:56
OutputImageType::PointType OutputImagePointType
Definition: itkBackwardImageProjector2Dto3D.h:65
OutputImageType::RegionType OutputImageRegionType
Definition: itkBackwardImageProjector2Dto3D.h:61
bool m_ClearBackProjectedVolume
Flag that back-projected volume should be filled with zeros.
Definition: itkBackwardImageProjector2Dto3D.h:157
Image< IntensityType, 3 > OutputImageType
Definition: itkBackwardImageProjector2Dto3D.h:58
InputImageType::IndexType InputImageIndexType
Definition: itkBackwardImageProjector2Dto3D.h:55
The base class for 2D-3D forward and back projection.
Definition: itkImageProjectionBaseClass2D3D.h:31
OutputImageSizeType m_OutputImageSize
The size of the output projected image.
Definition: itkBackwardImageProjector2Dto3D.h:147
void SetBackProjectedImageSize(OutputImageSizeType &outImageSize)
Set the size in voxels of the output back-projected image.
Definition: itkBackwardImageProjector2Dto3D.h:91
BackwardImageProjector2Dto3D Self
Definition: itkBackwardImageProjector2Dto3D.h:35
Definition: niftkITKAffineResampleImage.cxx:74
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
OutputImagePointType m_OutputImageOrigin
The origin of the output projected image.
Definition: itkBackwardImageProjector2Dto3D.h:151
InputImageType::Pointer InputImagePointer
Definition: itkBackwardImageProjector2Dto3D.h:49
OutputImageType::PixelType OutputImagePixelType
Definition: itkBackwardImageProjector2Dto3D.h:64
SmartPointer< Self > Pointer
Definition: itkBackwardImageProjector2Dto3D.h:36
void SetBackProjectedImageOrigin(OutputImagePointType &outImageOrigin)
Set the origin of the output back-projected image.
Definition: itkBackwardImageProjector2Dto3D.h:98
InputImageType::SpacingType InputImageSpacingType
Definition: itkBackwardImageProjector2Dto3D.h:53
InputImageType::ConstPointer InputImageConstPointer
Definition: itkBackwardImageProjector2Dto3D.h:50
GLuint num
Definition: glew.h:2607
OutputImagePointer m_VoxelRayCount
Definition: itkBackwardImageProjector2Dto3D.h:167
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
OutputImageSpacingType m_OutputImageSpacing
The resolution of the output projected image.
Definition: itkBackwardImageProjector2Dto3D.h:149
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
InputImageType::PointType InputImagePointType
Definition: itkBackwardImageProjector2Dto3D.h:54
SmartPointer< const Self > ConstPointer
Definition: itkBackwardImageProjector2Dto3D.h:37
bool m_FlagMultiThreadedExecution
Flag to turn multithreading on or off.
Definition: itkBackwardImageProjector2Dto3D.h:154
OutputImageType::SpacingType OutputImageSpacingType
Definition: itkBackwardImageProjector2Dto3D.h:63
Pointer Filter
Definition: itkBackwardImageProjector2Dto3D.h:162
void SetSingleThreadedExecution(void)
For debugging purposes, set single threaded execution.
Definition: itkBackwardImageProjector2Dto3D.h:104
OutputImageType::Pointer OutputImagePointer
Definition: itkBackwardImageProjector2Dto3D.h:59
OutputImageType::SizeType OutputImageSizeType
Definition: itkBackwardImageProjector2Dto3D.h:62
InputImageType::SizeType InputImageSizeType
Definition: itkBackwardImageProjector2Dto3D.h:52
Simultaneous itk::Image and itk::Array (and hence vnl_vector) class.
OutputImageType::ConstPointer OutputImageConstPointer
Definition: itkBackwardImageProjector2Dto3D.h:60
void SetBackProjectedImageSpacing(OutputImageSpacingType &outImageSpacing)
Set the resolution in mm of the output back-projected image.
Definition: itkBackwardImageProjector2Dto3D.h:93