gVirtualXRay  2.0.10
VirtualX-RayImagingLibraryonGPU
XRayDetector.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (c) 2017, Dr Franck P. Vidal (franck.p.vidal@fpvidal.net),
4 http://www.fpvidal.net/
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without modification,
8 are permitted provided that the following conditions are met:
9 
10 1. Redistributions of source code must retain the above copyright notice,
11 this list of conditions and the following disclaimer.
12 
13 2. Redistributions in binary form must reproduce the above copyright notice,
14 this list of conditions and the following disclaimer in the documentation and/or
15 other materials provided with the distribution.
16 
17 3. Neither the name of the Bangor University nor the names of its contributors
18 may be used to endorse or promote products derived from this software without
19 specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 
32 */
33 
34 
35 #ifndef __XRayDetector_h
36 #define __XRayDetector_h
37 
38 
70 //******************************************************************************
71 // Include
72 //******************************************************************************
73 #ifndef __gVirtualXRayConfig_h
75 #endif
76 
77 #include <memory>
78 #include <vector> // To store the energy response
79 #include <utility> // To create STL pairs
80 
81 #ifndef __Types_h
82 #include "gVirtualXRay/Types.h"
83 #endif
84 
85 #ifndef __Matrix4x4_h
86 #include "gVirtualXRay/Matrix4x4.h"
87 #endif
88 
89 #ifndef __VBO_h
90 #include "gVirtualXRay/VBO.h"
91 #endif
92 
93 #ifndef __SphereMesh_h
95 #endif
96 
97 #ifndef __CubeMesh_h
98 #include "gVirtualXRay/CubeMesh.h"
99 #endif
100 
101 #ifndef __Scintillator_h
103 #endif
104 
105 #ifndef __Image_h
106 #include "gVirtualXRay/Image.h"
107 #endif
108 
109 
110 //******************************************************************************
111 // namespace
112 //******************************************************************************
113 namespace gVirtualXRay {
114 
115 
116 //==============================================================================
121 //==============================================================================
123 //------------------------------------------------------------------------------
124 {
125 //******************************************************************************
126 public:
128  typedef enum SourceShapeTag
129  {
138  } SourceShape;
139 
140 
141  //--------------------------------------------------------------------------
143  //--------------------------------------------------------------------------
144  XRayDetector();
145 
146 
147  //--------------------------------------------------------------------------
149  //--------------------------------------------------------------------------
150  ~XRayDetector();
151 
152 
153  //--------------------------------------------------------------------------
155  //--------------------------------------------------------------------------
156  void release();
157 
158 
159  //--------------------------------------------------------------------------
161  //--------------------------------------------------------------------------
162  void displayDetector();
163 
164 
165  void setWidgetLength(const RATIONAL_NUMBER& aLength);
166 
167 
168  //--------------------------------------------------------------------------
170  //--------------------------------------------------------------------------
171  void displaySource();
172 
173 
174  //--------------------------------------------------------------------------
176  //--------------------------------------------------------------------------
177  void displaySourceWireframe();
178 
179 
180  //--------------------------------------------------------------------------
182  //--------------------------------------------------------------------------
183  void displayBeam();
184 
185 
186  //--------------------------------------------------------------------------
188  //--------------------------------------------------------------------------
190 
191 
192  //--------------------------------------------------------------------------
194  //--------------------------------------------------------------------------
196 
197 
198  //--------------------------------------------------------------------------
201 
204  //--------------------------------------------------------------------------
206  const RATIONAL_NUMBER& aResolution);
207 
208 
209  //--------------------------------------------------------------------------
212 
215  //--------------------------------------------------------------------------
216  void setResolutionInUnitsOfLengthPerPixel(const VEC2& aResolution);
217 
218 
219  //--------------------------------------------------------------------------
221 
224  //--------------------------------------------------------------------------
225  void setNumberOfPixels(const Vec2ui& aSizeInPixels);
226 
227 
228  //--------------------------------------------------------------------------
230 
233  //--------------------------------------------------------------------------
234  void setDetectorPosition(const VEC3& aDetectorPosition);
235 
236 
237  //--------------------------------------------------------------------------
239 
242  //--------------------------------------------------------------------------
243  void setXrayPointSource(const VEC3& aXraySourcePosition);
244 
245 
246  //--------------------------------------------------------------------------
248 
256  //--------------------------------------------------------------------------
257  void setCubicSource(const VEC3& aXraySourcePosition,
258  unsigned int aNumberOfSamplesAlongOneDirection,
259  RATIONAL_NUMBER aLength);
260 
261 
262  //--------------------------------------------------------------------------
265 
271  //--------------------------------------------------------------------------
272  void setSquareSource(const VEC3& aXraySourcePosition,
273  unsigned int aNumberOfSamplesAlongOneDirection,
274  RATIONAL_NUMBER aLength);
275 
276 
277  //--------------------------------------------------------------------------
281 
296  //--------------------------------------------------------------------------
297  void setRectangleSource(const VEC3& aXraySourcePosition,
298  unsigned int aNumberOfSamplesAlongLength,
299  unsigned int aNumberOfSamplesAlongHeight,
300  RATIONAL_NUMBER aLongitudinalLength,
301  RATIONAL_NUMBER aHeight);
302 
303 
304  //--------------------------------------------------------------------------
306 
312  //--------------------------------------------------------------------------
313  void setLineSource(const VEC3& aXraySourcePosition,
314  const VEC3& aDirection,
315  unsigned int aNumberOfSamplesAlongOneDirection,
316  RATIONAL_NUMBER aLength);
317 
318 
319  //--------------------------------------------------------------------------
321  //--------------------------------------------------------------------------
322  void setXrayPointSource();
323 
324 
325  //--------------------------------------------------------------------------
327  //--------------------------------------------------------------------------
328  void setCubicSource();
329 
330 
331  //--------------------------------------------------------------------------
333  //--------------------------------------------------------------------------
334  void setSquareSource();
335 
336 
337  //--------------------------------------------------------------------------
339  //--------------------------------------------------------------------------
340  void setRectangleSource();
341 
342 
343  //--------------------------------------------------------------------------
345  //--------------------------------------------------------------------------
346  void setLineSource();
347 
348 
349  //--------------------------------------------------------------------------
351 
354  //--------------------------------------------------------------------------
355  void setUpVector(const VEC3& anUpVector);
356 
357 
358  //--------------------------------------------------------------------------
360 
363  //--------------------------------------------------------------------------
364  void setRightVector(const VEC3& aRightVector);
365 
366 
367  void autoAlignDetector(bool aFlag = true);
368 
369 
370  void rotateDetector(const RATIONAL_NUMBER& anAngle, const VEC3& aRotationAxis);
371 
372 
373  //--------------------------------------------------------------------------
375 
378  //--------------------------------------------------------------------------
379  void setRotationMatrix(const MATRIX4& aMatrix);
380 
381 
382  //--------------------------------------------------------------------------
384  //--------------------------------------------------------------------------
385  void setParallelBeam();
386 
387 
388  //--------------------------------------------------------------------------
390  //--------------------------------------------------------------------------
391  void setConeBeam();
392 
393 
394  //--------------------------------------------------------------------------
396  //--------------------------------------------------------------------------
397  void setPointSource();
398 
399 
400  //--------------------------------------------------------------------------
402 
405  //--------------------------------------------------------------------------
406  const Vec2ui& getNumberOfPixels() const;
407 
408 
409  //--------------------------------------------------------------------------
411 
414  //--------------------------------------------------------------------------
415  const VEC2& getSizeInUnitOfLength() const;
416 
417 
418  //--------------------------------------------------------------------------
420 
423  //--------------------------------------------------------------------------
424  const VEC2& getPixelSpacingInUnitOfLength() const;
425 
426 
427  //--------------------------------------------------------------------------
429 
432  //--------------------------------------------------------------------------
433  const VEC3& getDetectorPosition() const;
434 
435 
436  //--------------------------------------------------------------------------
438 
441  //--------------------------------------------------------------------------
442  const VEC3& getXraySourceCentre() const;
443 
444 
445  unsigned int getNumberOfSourceSamples()const;
446 
447 
448  const VEC3& getSourceSamplePosition(unsigned int aSampleID) const;
449 
450 
451  //--------------------------------------------------------------------------
453 
456  //--------------------------------------------------------------------------
457  const VEC3& getUpVector() const;
458 
459 
460  //--------------------------------------------------------------------------
462 
465  //--------------------------------------------------------------------------
466  const MATRIX4& getRotationMatrix() const;
467 
468 
469  //--------------------------------------------------------------------------
471  //--------------------------------------------------------------------------
472  const VEC3& getNormal() const;
473 
474 
475  //--------------------------------------------------------------------------
477 
480  //--------------------------------------------------------------------------
481  const VEC3& getRightVector() const;
482 
483 
484  //--------------------------------------------------------------------------
486 
492  //--------------------------------------------------------------------------
494  RATIONAL_NUMBER& B,
495  RATIONAL_NUMBER& C,
496  RATIONAL_NUMBER& D);
497 
498 
499  //------------------------------------------------------------------------------
501 
504  //------------------------------------------------------------------------------
505  const std::vector<float>& getVertices() const;
506 
507 
508  //--------------------------------------------------------------------------
510 
514  //--------------------------------------------------------------------------
515  SourceShape getSourceShape() const;
516 
517 
518  const std::vector<VEC3>& getSourcePositionSet() const;
519 
520 
521  void setSourcePositions(const std::vector<VEC3>& aSourcePostionSet);
522 
523 
524  //--------------------------------------------------------------------------
526 
530  //--------------------------------------------------------------------------
531  void rotateFocalSpot(const RATIONAL_NUMBER& aRotationAngle, const VEC3& aRotationAxis);
532 
533 
534  //--------------------------------------------------------------------------
536 
541  //--------------------------------------------------------------------------
542  void rotateSource(const RATIONAL_NUMBER& aRotationAngle,
543  const VEC3& aRotationCentre,
544  const VEC3& aRotationAxis);
545 
546 
547  //--------------------------------------------------------------------------
549 
553  //--------------------------------------------------------------------------
554  bool useParallelBeam() const;
555 
556 
557  //--------------------------------------------------------------------------
559 
562  //--------------------------------------------------------------------------
563  const RATIONAL_NUMBER& getFOVY() const;
564 
565 
566  const VEC2& getPixelSizeInUnitOfLength() const;
567 
568 
569  //--------------------------------------------------------------------------
571  //--------------------------------------------------------------------------
572  void clearEnergyResponse();
573 
574 
575  //--------------------------------------------------------------------------
577 
582  //--------------------------------------------------------------------------
583  void loadEnergyResponse(const std::string& aFileName,
584  const RATIONAL_NUMBER& aUnitOfEnergy);
585 
586 
587  void setEnergyResponse(const std::vector<std::pair<float, float> >& anEnergyResponse);
588 
589 
590  void setEnergyResponse(const std::vector<std::pair<double, double> >& anEnergyResponse);
591 
592 
593  void setScintillator(const Scintillator& aScintillator);
594 
595 
596  void setScintillator(const std::string& aMaterial,
597  const float& aThickness);
598 
599 
600  const std::string& getScintillatorMaterial();
601 
602 
603  double getScintillatorThickness();
604 
605  std::vector<std::pair<RATIONAL_NUMBER, RATIONAL_NUMBER> > getEnergyResponse() const;
606 
607 
608  //--------------------------------------------------------------------------
610 
614  //--------------------------------------------------------------------------
615  RATIONAL_NUMBER applyEnergyResponse(const RATIONAL_NUMBER& anEnergy) const;
616 
617 
618  //--------------------------------------------------------------------------
620 
623  //--------------------------------------------------------------------------
624  void setLSF(const std::string& aFileName);
625 
626 
627  //--------------------------------------------------------------------------
629 
632  //--------------------------------------------------------------------------
633  void setLSF(const std::vector<RATIONAL_NUMBER>& aLSF);
634 
635 
636  //--------------------------------------------------------------------------
638 
641  //--------------------------------------------------------------------------
642  const std::vector<RATIONAL_NUMBER>& getLSF() const;
643 
644 
645  //--------------------------------------------------------------------------
647  //--------------------------------------------------------------------------
648  void clearLSF();
649 
650 
651  //--------------------------------------------------------------------------
653 
656  //--------------------------------------------------------------------------
657  void setPSF(const Image<RATIONAL_NUMBER>& aPSF);
658 
659 
660  //--------------------------------------------------------------------------
662 
665  //--------------------------------------------------------------------------
666  const Image<RATIONAL_NUMBER>& getPSF() const;
667 
668 
669  //--------------------------------------------------------------------------
671  //--------------------------------------------------------------------------
672  void clearPSF();
673 
674 
675 //******************************************************************************
676 protected:
677  //--------------------------------------------------------------------------
679  //--------------------------------------------------------------------------
681 
682 
683  //--------------------------------------------------------------------------
685  //--------------------------------------------------------------------------
686  void updateInternalValues();
687 
688 
689  //--------------------------------------------------------------------------
691  //--------------------------------------------------------------------------
692  void updateVBOs();
693 
694 
695  //--------------------------------------------------------------------------
697  //--------------------------------------------------------------------------
698  void updateDetectorVBO();
699 
700 
701  //--------------------------------------------------------------------------
703  //--------------------------------------------------------------------------
704  void updateParallelBeamVBO();
705 
706 
707  //--------------------------------------------------------------------------
709  //--------------------------------------------------------------------------
710  void updateConeBeamVBO();
711 
712 
713  //--------------------------------------------------------------------------
715  //--------------------------------------------------------------------------
716  void updateFOVY();
717 
718 
721 
722 
725 
726 
728  std::vector<VEC3> m_p_xray_source_position_set;
729 
730 
733 
734 
737 
738 
741 
742 
745 
746 
749 
750 
753 
754 
757 
758 
760 #if __cplusplus < 199711L
761  std::auto_ptr<VBO> m_detector_geometry;
762 #else
763  std::unique_ptr<VBO> m_detector_geometry;
764 #endif
765 
766  std::vector<GLfloat> m_p_detector_geometry_vertices;
767 
769 #if __cplusplus < 199711L
770  std::auto_ptr<VBO> m_parallel_beam;
771 #else
772  std::unique_ptr<VBO> m_parallel_beam;
773 #endif
774 
775 
777 #if __cplusplus < 199711L
778  std::auto_ptr<VBO> m_cone_beam;
779 #else
780  std::unique_ptr<VBO> m_cone_beam;
781 #endif
782 
783 
785 #if __cplusplus < 199711L
786  std::auto_ptr<VBO> m_parallel_beam_highlight;
787 #else
788  std::unique_ptr<VBO> m_parallel_beam_highlight;
789 #endif
790 
791 
793 #if __cplusplus < 199711L
794  std::auto_ptr<VBO> m_cone_beam_highlight;
795 #else
796  std::unique_ptr<VBO> m_cone_beam_highlight;
797 #endif
798 
799 
802 
803 
806 
807 
811 
812 
815 
816 
819 
820 
824 
825 
828 
829 
832 
833 
836 
837 
839  std::vector<RATIONAL_NUMBER> m_LSF;
840 
841 
844 
845 
849 };
850 
851 
852 } // namespace gVirtualXRay
853 
854 
855 //******************************************************************************
856 #include "XRayDetector.inl"
857 
858 
859 #endif // __XRayDetector_h
SourceShape
SourceShape is a type that defines the shape of X-ray sources.
Definition: XRayDetector.h:128
void clearLSF()
Clear the LSF to use a Dirac as impulse response.
RATIONAL_NUMBER applyEnergyResponse(const RATIONAL_NUMBER &anEnergy) const
Apply the energy response if any.
void rotateFocalSpot(const RATIONAL_NUMBER &aRotationAngle, const VEC3 &aRotationAxis)
Rotate the focal spot around its centre.
bool useParallelBeam() const
Accessor on the flag about projection.
RATIONAL_NUMBER m_distance_source_detector
Distance between the source and the detector.
Definition: XRayDetector.h:748
std::auto_ptr< VBO > m_parallel_beam
The triangle mesh corresponding to the parallel beam.
Definition: XRayDetector.h:770
Class to handle 3D meshes of spheres.
void loadEnergyResponse(const std::string &aFileName, const RATIONAL_NUMBER &aUnitOfEnergy)
Load the energy response of the detector from a TSV file.
void rotateSource(const RATIONAL_NUMBER &aRotationAngle, const VEC3 &aRotationCentre, const VEC3 &aRotationAxis)
Rotate the source around and arbitrary point.
void setPSF(const Image< RATIONAL_NUMBER > &aPSF)
Set the point spread function from a 2D image.
Type declarations.
Scintillator is a class to generate the energy response due to the scintillator of the X-Ray detector...
Definition: Scintillator.h:101
void setEnergyResponse(const std::vector< std::pair< float, float > > &anEnergyResponse)
void setLineSource()
Set the shape of the source as a line segment.
Class to generate the energy response due to the scintillator of the X-Ray detector.
std::auto_ptr< VBO > m_cone_beam_highlight
The triangle mesh corresponding to the cone beam highlight.
Definition: XRayDetector.h:794
VEC3 m_xray_source_centre
The position of the source centre.
Definition: XRayDetector.h:724
Class to handle 3D meshes of cubes.
VEC3 m_normal
The vector normal to the detector.
Definition: XRayDetector.h:818
void displayBeam()
Display the beam using OpenGL.
Image< RATIONAL_NUMBER > m_PSF
Impulse response of the detector as a point spread function.
Definition: XRayDetector.h:843
Class to handle vertex buffer objects (VBOs).
const VEC3 & getSourceSamplePosition(unsigned int aSampleID) const
void displaySourceWireframe()
Display the source using OpenGL.
std::vector< RATIONAL_NUMBER > m_LSF
Impulse response of the detector as a line spread function.
Definition: XRayDetector.h:839
void setLSF(const std::string &aFileName)
Set the line spread function from a file.
Vec3 is a template class to handle a 3D vector.
Definition: Vec3.h:88
const MATRIX4 & getRotationMatrix() const
Accessor on the rotation matrix.
void setSquareSource()
Set the shape of the source as a square.
bool m_vbo_need_update
A flag set to true when the VBOs need to be updated.
Definition: XRayDetector.h:756
void setScintillator(const Scintillator &aScintillator)
const std::string & getScintillatorMaterial()
void setRightVector(const VEC3 &aRightVector)
Set the right vector that defines the detector&#39;s orientation.
VEC2 m_size_in_unit_of_length
The size of the detector.
Definition: XRayDetector.h:740
void setRotationMatrix(const MATRIX4 &aMatrix)
Set the rotation matrix.
const VEC2 & getPixelSizeInUnitOfLength() const
const std::vector< RATIONAL_NUMBER > & getLSF() const
Accessor on the line spread function.
std::vector< VEC3 > m_p_xray_source_position_set
The sample positions of the source.
Definition: XRayDetector.h:728
VEC3 m_right_vector
The cross product between m_look_at_vector and m_up_vector.
Definition: XRayDetector.h:827
SphereMesh is a class to handle 3D meshes of spheres.
Definition: SphereMesh.h:99
MATRIX4 m_rotation_matrix
The rotation matrix.
Definition: XRayDetector.h:736
CubeMesh< float > m_first_pixel_mesh
Polygon mesh of the first pixel of the detector.
Definition: XRayDetector.h:809
Source whose shape corresponds to a square.
Definition: XRayDetector.h:131
Vec2ui m_size_in_number_of_pixels
Size of the detector (in number of pixels)
Definition: XRayDetector.h:752
void autoAlignDetector(bool aFlag=true)
VEC2 m_resolution_in_unit_of_length_per_pixel
Resolution (in unit of length per pixel)
Definition: XRayDetector.h:744
void displayDetector()
Display the detector using OpenGL.
const std::vector< VEC3 > & getSourcePositionSet() const
void setCubicSource()
Set the shape of the source as a cube.
const VEC3 & getRightVector() const
Accessor on the cross product between m_look_at_vector and m_up_vector.
void updateInternalValues()
Compute the distance between the source and the detector, etc.
XRayDetector is a class to handle a X-ray detector.
Definition: XRayDetector.h:122
SourceShape m_source_shape
Source type.
Definition: XRayDetector.h:814
void updateConeBeamVBO()
Update the VBO of the cone beam.
Template class to handle a 4x4 matrixs.
RATIONAL_NUMBER m_fovy
Field of view along the Y-axis.
Definition: XRayDetector.h:831
const Vec2ui & getNumberOfPixels() const
Accessor on the number of pixels.
RATIONAL_NUMBER m_widget_length
The length of the widgets.
Definition: XRayDetector.h:801
std::auto_ptr< VBO > m_parallel_beam_highlight
The triangle mesh corresponding to the parallel beam highlight.
Definition: XRayDetector.h:786
std::vector< GLfloat > m_p_detector_geometry_vertices
Definition: XRayDetector.h:766
float RATIONAL_NUMBER
Type of data used to store real numbers.
Definition: Types.h:107
Source whose shape corresponds to a line segment.
Definition: XRayDetector.h:134
void setDetectorPosition(const VEC3 &aDetectorPosition)
Set the position of the X-ray detector.
const RATIONAL_NUMBER & getFOVY() const
Accessor on the view along the Y-axis.
Class to handle a greyscale image.
void setXrayPointSource()
Set the shape of the source as an infinitely small point.
void updateParallelBeamVBO()
Update the VBO of the parallel beam.
std::auto_ptr< VBO > m_cone_beam
The triangle mesh corresponding to the cone beam.
Definition: XRayDetector.h:778
const VEC3 & getDetectorPosition() const
Accessor on the detector position.
VEC3 m_detector_position
The position of the detector centre.
Definition: XRayDetector.h:720
const std::vector< float > & getVertices() const
Accessor on the four corners of the X-ray detector.
void setConeBeam()
Set the projection mode to cone beam (same as point source).
void setPointSource()
Set the projection mode to point source (same as cone beam).
Source whose shape corresponds to a cube.
Definition: XRayDetector.h:133
void updateSizeInUnitOfLength()
Compute the size of the detector.
void updateDetectorVBO()
Update the VBO of the detector.
void clearEnergyResponse()
Clear the energy response of the detector.
void setParallelBeam()
Set the projection mode to parallel beam.
void getPlaneEquation(RATIONAL_NUMBER &A, RATIONAL_NUMBER &B, RATIONAL_NUMBER &C, RATIONAL_NUMBER &D)
Accessor on the plane equation (Ax + By + Cz + D = 0).
SourceShape getSourceShape() const
Accessor on the shape of the source.
XRayDetector()
Default constructor.
const VEC2 & getSizeInUnitOfLength() const
Accessor on the size of the detector (in unit of length).
Source whose shape corresponds to a rectangle.
Definition: XRayDetector.h:132
SphereMesh m_source_mesh
Polygon mesh of the source.
Definition: XRayDetector.h:805
Class to handle virtual X-Ray detectors.
const VEC3 & getXraySourceCentre() const
Accessor on the centre of the source.
unsigned int getNumberOfSourceSamples() const
Infinitively small point source.
Definition: XRayDetector.h:130
void rotateDetector(const RATIONAL_NUMBER &anAngle, const VEC3 &aRotationAxis)
const Image< RATIONAL_NUMBER > & getPSF() const
Accessor on the point spread function.
void setNumberOfPixels(const Vec2ui &aSizeInPixels)
Set the number of pixels.
void setSourcePositions(const std::vector< VEC3 > &aSourcePostionSet)
std::vector< std::pair< RATIONAL_NUMBER, RATIONAL_NUMBER > > getEnergyResponse() const
const VEC3 & getNormal() const
Accessor on the vector normal to the detector.
void setRectangleSource()
Set the shape of the source as a rectangle.
std::auto_ptr< VBO > m_detector_geometry
The triangle mesh corresponding to the detector.
Definition: XRayDetector.h:761
void release()
Release the data.
void setResolutionInUnitsOfLengthPerPixel(const RATIONAL_NUMBER &aResolution)
void updateFOVY()
Update the view along the Y-axis.
const VEC3 & getUpVector() const
Accessor on the up vector, which defines the orientation of the detector.
void updateVBOs()
Update the VBOs.
VEC3 m_up_vector
The "up" vector the the detector.
Definition: XRayDetector.h:732
void clearPSF()
Clear the PSF to use a Dirac as impulse response.
Matrix4x4 is a template class to handle a 4 by 4 matrix.
Definition: Matrix4x4.h:89
void setUpVector(const VEC3 &anUpVector)
Set the up vector that defines the detector&#39;s orientation.
void displaySource()
Display the source using OpenGL.
void displayDetectorPosition()
Display a sphere on the position of the centre of the detecotr using OpenGL.
void setWidgetLength(const RATIONAL_NUMBER &aLength)
Scintillator m_scintillator
Scintillator.
Definition: XRayDetector.h:835
void displayFirstPixelPosition()
Display a sphere on the position of the first pixel of the image using OpenGL.
const VEC2 & getPixelSpacingInUnitOfLength() const
Accessor on the pixel spacing (in unit of length).