gVirtualXRay  2.0.10
VirtualX-RayImagingLibraryonGPU
MaterialSet.inl
Go to the documentation of this file.
1 /*
2 
3 Copyright (c) 2014, 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 
62 //******************************************************************************
63 // namespace
64 //******************************************************************************
65 namespace gVirtualXRay {
66 
67 
68 //--------------------------------
69 inline MaterialSet::MaterialSet():
70 //--------------------------------
71  m_mu_min_energy(0),
72  m_mu_max_energy(0),
73  m_min_S(0),
74  m_max_S(0),
75  m_min_HU(0),
76  m_max_HU(0)
77 //--------------------------------
78 {
80 }
81 
82 
83 //--------------------------------
85 //--------------------------------
86 {
87  clearMemory();
88 }
89 
90 
91 //------------------------------------
93 //------------------------------------
94 {
95  m_material_set.clear();
96 }
97 
98 
99 //----------------------------------------------
100 inline float MaterialSet::getMuMinEnergy() const
101 //----------------------------------------------
102 {
103  return (m_mu_min_energy);
104 }
105 
106 
107 //----------------------------------------------
108 inline float MaterialSet::getMuMaxEnergy() const
109 //----------------------------------------------
110 {
111  return (m_mu_max_energy);
112 }
113 
114 
115 inline short MaterialSet::getMinHU() const
116 {
117  return (m_min_HU);
118 }
119 
120 
121 inline short MaterialSet::getMaxHU() const
122 {
123  return (m_max_HU);
124 }
125 
126 
127 //--------------------------------------------------------
128 inline unsigned int MaterialSet::getMaterialNumber() const
129 //--------------------------------------------------------
130 {
131  return (m_material_set.size());
132 }
133 
134 
135 //-----------------------------------------------------------------
136 inline std::ostream & operator << (std::ostream& anOutputSream,
137  const MaterialSet& aMaterialSet)
138 //-----------------------------------------------------------------
139 {
140  for (std::map<std::pair<short, short>, TissueMaterial>::const_iterator ite(aMaterialSet.m_material_set.begin());
141  ite != aMaterialSet.m_material_set.end();
142  ++ite)
143  {
144  anOutputSream << ite->second << std::endl;
145  }
146 
147  return (anOutputSream);
148 }
149 
150 
151 } // namespace gVirtualXRay
unsigned int getMaterialNumber() const
Accessor on the number of materials in the set.
MaterialSet is a class to manage a table of materials.
Definition: MaterialSet.h:94
void loadMaterialSetFromMemory()
Load the table of materials.
~MaterialSet()
Destructor.
Definition: MaterialSet.inl:84
void clearMemory()
Clear all the memory.
Definition: MaterialSet.inl:92
float getMuMaxEnergy() const
Accessor on the higher energy cutoff for attenuation coefficient.
TissueMaterial is a class to manage a material.
std::ostream & operator<<(std::ostream &anOutputSream, const gVirtualXRay::AtomicElement &anElement)
operator <<
short getMaxHU() const
Accessor on the maximum Hounsfield unit that the material set can handle.
short getMinHU() const
Accessor on the minimum Hounsfield unit that the material set can handle.
float getMuMinEnergy() const
Accessor on the lower energy cutoff for attenuation coefficient.