NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkImageProjector2D3D.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 itkImageProjector2D3D_h
16 #define itkImageProjector2D3D_h
17 
19 
20 namespace itk
21 {
22 
27 template <class IntensityType = float>
28 class ITK_EXPORT ImageProjector2D3D :
29  public ImageProjectionBaseClass2D3D<Image< IntensityType, 3>, // Input image
30  Image< IntensityType, 2> > // Output image
31 {
32 public:
35  typedef SmartPointer<Self> Pointer;
36  typedef SmartPointer<const Self> ConstPointer;
39 
41  itkNewMacro(Self);
42 
45 
48  typedef typename InputImageType::Pointer InputImagePointer;
49  typedef typename InputImageType::ConstPointer InputImageConstPointer;
53  typedef typename InputImageType::SpacingType InputImageSpacingType;
54  typedef typename InputImageType::PointType InputImagePointType;
56 
58  typedef typename OutputImageType::Pointer OutputImagePointer;
61  typedef typename OutputImageType::SpacingType OutputImageSpacingType;
62  typedef typename OutputImageType::PointType OutputImagePointType;
65 
67  itkStaticConstMacro(InputImageDimension, unsigned int, 3);
68  itkStaticConstMacro(OutputImageDimension, unsigned int, 2);
69 
77  virtual void GenerateOutputInformation(void);
78 
86  virtual void GenerateInputRequestedRegion(void);
87  virtual void EnlargeOutputRequestedRegion(DataObject *output);
88 
90  void SetProjectedImageSize(OutputImageSizeType &outImageSize) {m_OutputImageSize = outImageSize;};
92  void SetProjectedImageSpacing(OutputImageSpacingType &outImageSpacing) {
93  m_OutputImageSpacing = outImageSpacing;
94  this->GetOutput()->SetSpacing(m_OutputImageSpacing);
95  };
97  void SetProjectedImageOrigin(OutputImagePointType &outImageOrigin) {
98  m_OutputImageOrigin = outImageOrigin;
99  this->GetOutput()->SetOrigin(m_OutputImageOrigin);
100  };
101 
103  void SetRayIntegrationThreshold(double threshold) {m_Threshold = threshold;}
104 
106  void SetSingleThreadedExecution(void) {m_FlagMultiThreadedExecution = false;}
107 
108 protected:
110  virtual ~ImageProjector2D3D(void) {};
111  void PrintSelf(std::ostream& os, Indent indent) const;
112 
123  virtual void BeforeThreadedGenerateData(void);
124 
135  virtual void AfterThreadedGenerateData(void);
136 
139  void GenerateData();
140 
151  void ThreadedGenerateData(const InputImageRegionType& inputRegionForThread,
152  ThreadIdType threadId );
153 
159  int SplitRequestedRegion(int i, int num, InputImageRegionType& splitRegion);
160 
164  static ITK_THREAD_RETURN_TYPE ImageProjectorThreaderCallback( void *arg );
165 
167  OutputImageSizeType m_OutputImageSize;
169  OutputImageSpacingType m_OutputImageSpacing;
171  OutputImagePointType m_OutputImageOrigin;
172 
174  double m_Threshold;
175 
178 
181  {
182  Pointer Filter;
183  };
184 
185 private:
186  ImageProjector2D3D(const Self&); //purposely not implemented
187  void operator=(const Self&); //purposely not implemented
188 
189 };
190 
191 } // end namespace itk
192 
193 #ifndef ITK_MANUAL_INSTANTIATION
194 #include "itkImageProjector2D3D.txx"
195 #endif
196 
197 #endif
Definition: itkImageProjector2D3D.h:180
OutputImageType::IndexType OutputImageIndexType
Definition: itkImageProjector2D3D.h:64
ImageType::SizeType SizeType
Definition: niftkMakeLapUSProbeBasicModel.cxx:31
void SetProjectedImageSpacing(OutputImageSpacingType &outImageSpacing)
Set the resolution in mm of the output projected image.
Definition: itkImageProjector2D3D.h:92
The base class for 2D-3D forward and back projection.
Definition: itkImageProjectionBaseClass2D3D.h:31
double m_Threshold
The threshold above which voxels along the ray path are integrated.
Definition: itkImageProjector2D3D.h:174
SmartPointer< Self > Pointer
Definition: itkImageProjector2D3D.h:35
Definition: niftkITKAffineResampleImage.cxx:74
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
InputImageType::RegionType InputImageRegionType
Definition: itkImageProjector2D3D.h:50
void SetRayIntegrationThreshold(double threshold)
Set the ray integration threshold.
Definition: itkImageProjector2D3D.h:103
ImageProjectionBaseClass2D3D< Image< IntensityType, 3 >, Image< IntensityType, 2 > > Superclass
Definition: itkImageProjector2D3D.h:38
virtual ~ImageProjector2D3D(void)
Definition: itkImageProjector2D3D.h:110
OutputImageType::RegionType OutputImageRegionType
Definition: itkImageProjector2D3D.h:59
OutputImageType::SizeType OutputImageSizeType
Definition: itkImageProjector2D3D.h:60
OutputImageType::Pointer OutputImagePointer
Definition: itkImageProjector2D3D.h:58
SmartPointer< const Self > ConstPointer
Definition: itkImageProjector2D3D.h:36
GLuint num
Definition: glew.h:2607
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
bool m_FlagMultiThreadedExecution
Flag to turn multithreading on or off.
Definition: itkImageProjector2D3D.h:177
OutputImageType::SpacingType OutputImageSpacingType
Definition: itkImageProjector2D3D.h:61
Image< IntensityType, 2 > OutputImageType
Definition: itkImageProjector2D3D.h:57
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
void SetProjectedImageSize(OutputImageSizeType &outImageSize)
Set the size in pixels of the output projected image.
Definition: itkImageProjector2D3D.h:90
ImageProjector2D3D Self
Definition: itkImageProjector2D3D.h:34
OutputImageType::PointType OutputImagePointType
Definition: itkImageProjector2D3D.h:62
void SetProjectedImageOrigin(OutputImagePointType &outImageOrigin)
Set the origin of the output projected image.
Definition: itkImageProjector2D3D.h:97
InputImageType::SpacingType InputImageSpacingType
Definition: itkImageProjector2D3D.h:53
InputImageType::PixelType InputImagePixelType
Definition: itkImageProjector2D3D.h:52
Image< IntensityType, 3 > InputImageType
Definition: itkImageProjector2D3D.h:44
Pointer Filter
Definition: itkImageProjector2D3D.h:182
OutputImageType::PixelType OutputImagePixelType
Definition: itkImageProjector2D3D.h:63
Class to project a 3D image into 2D.
Definition: itkImageProjector2D3D.h:28
InputImageType::SizeType InputImageSizeType
Definition: itkImageProjector2D3D.h:51
Simultaneous itk::Image and itk::Array (and hence vnl_vector) class.
InputImageType::PointType InputImagePointType
Definition: itkImageProjector2D3D.h:54
OutputImageSizeType m_OutputImageSize
The size of the output projected image.
Definition: itkImageProjector2D3D.h:167
InputImageType::IndexType InputImageIndexType
Definition: itkImageProjector2D3D.h:55
OutputImageSpacingType m_OutputImageSpacing
The resolution of the output projected image.
Definition: itkImageProjector2D3D.h:169
void SetSingleThreadedExecution(void)
For debugging purposes, set single threaded execution.
Definition: itkImageProjector2D3D.h:106
InputImageType::ConstPointer InputImageConstPointer
Definition: itkImageProjector2D3D.h:49
OutputImagePointType m_OutputImageOrigin
The origin of the output projected image.
Definition: itkImageProjector2D3D.h:171
InputImageType::Pointer InputImagePointer
Definition: itkImageProjector2D3D.h:48