UsTK : Ultrasound ToolKit  version 2.0.1 under development (2023-12-07)
usImagePostScan2D.h
1 /****************************************************************************
2  *
3  * This file is part of the ustk software.
4  * Copyright (C) 2016 - 2017 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ustk with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * This software was developed at:
17  * Inria Rennes - Bretagne Atlantique
18  * Campus Universitaire de Beaulieu
19  * 35042 Rennes Cedex
20  * France
21  *
22  * If you have questions regarding the use of this file, please contact
23  * Inria at ustk@inria.fr
24  *
25  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27  *
28  * Authors:
29  * Pierre Chatelain
30  * Marc Pouliquen
31  *
32  *****************************************************************************/
33 
39 #ifndef __usImagePostScan2D_h_
40 #define __usImagePostScan2D_h_
41 
42 #include <visp3/core/vpConfig.h>
43 #include <visp3/core/vpImage.h>
44 
45 #include <visp3/ustk_core/usTransducerSettings.h>
46 
108 template <class Type> class usImagePostScan2D : public vpImage<Type>, public usTransducerSettings
109 {
110 public:
112  usImagePostScan2D(const vpImage<Type> &image, const usTransducerSettings &transducerSettings,
113  double widthResolution = 0.0, double heightResolution = 0.0);
116 
117  double getHeightResolution() const;
118  double getWidthResolution() const;
119 
122 
123  void setData(const vpImage<Type> &image);
124  void setHeightResolution(double heightResolution);
125  void setWidthResolution(double widthResolution);
126 
127 private:
128  double m_widthResolution;
129  double m_heightResolution;
130 };
131 
135 template <class Type>
137  : vpImage<Type>(), usTransducerSettings(), m_widthResolution(0.0), m_heightResolution(0.0)
138 {
139 }
140 
145 template <class Type>
147  : vpImage<Type>(other), usTransducerSettings(other), m_widthResolution(other.getWidthResolution()),
148  m_heightResolution(other.getHeightResolution())
149 {
150 }
151 
159 template <class Type>
160 usImagePostScan2D<Type>::usImagePostScan2D(const vpImage<Type> &image, const usTransducerSettings &transducerSettings,
161  double widthResolution, double heightResolution)
162  : vpImage<Type>(image), usTransducerSettings(transducerSettings), m_widthResolution(widthResolution),
163  m_heightResolution(heightResolution)
164 {
165 }
166 
171 
176 {
177  // from vpImage
178  vpImage<Type>::operator=(other);
179 
180  // from usTransducerSettings
182 
183  // from this class
184  m_heightResolution = other.getHeightResolution();
185  m_widthResolution = other.getWidthResolution();
186 
187  return *this;
188 }
189 
193 template <class Type> bool usImagePostScan2D<Type>::operator==(const usImagePostScan2D<Type> &other)
194 {
195  return (vpImage<Type>::operator==(other) && usTransducerSettings::operator==(other) &&
196  m_heightResolution == other.getHeightResolution() && m_widthResolution == other.getWidthResolution());
197 }
198 
202 template <class Type> std::ostream &operator<<(std::ostream &out, const usImagePostScan2D<Type> &other)
203 {
204  return out << static_cast<const usTransducerSettings &>(other) << "image width : " << other.getWidth() << std::endl
205  << "image height : " << other.getHeight() << std::endl
206  << "image width resolution : " << other.getWidthResolution() << std::endl
207  << "image height resolution : " << other.getHeightResolution() << std::endl;
208 }
209 
214 template <class Type> void usImagePostScan2D<Type>::setData(const vpImage<Type> &image)
215 {
216  vpImage<Type>::operator=(image);
217 }
218 
223 template <class Type> double usImagePostScan2D<Type>::getHeightResolution() const { return m_heightResolution; }
224 
229 template <class Type> double usImagePostScan2D<Type>::getWidthResolution() const { return m_widthResolution; }
230 
235 template <class Type> void usImagePostScan2D<Type>::setHeightResolution(double heightResolution)
236 {
237  m_heightResolution = heightResolution;
238 }
239 
244 template <class Type> void usImagePostScan2D<Type>::setWidthResolution(double widthResolution)
245 {
246  m_widthResolution = widthResolution;
247 }
248 #endif // __usImagePostScan2D_h_
2D post-scan ultrasound image.
void setHeightResolution(double heightResolution)
void setData(const vpImage< Type > &image)
double getHeightResolution() const
usImagePostScan2D< Type > & operator=(const usImagePostScan2D< Type > &other)
usImagePostScan2D(const vpImage< Type > &image, const usTransducerSettings &transducerSettings, double widthResolution=0.0, double heightResolution=0.0)
usImagePostScan2D(const usImagePostScan2D< Type > &other)
virtual ~usImagePostScan2D()
void setWidthResolution(double widthResolution)
double getWidthResolution() const
bool operator==(const usImagePostScan2D< Type > &other)
Generic class for 2D ultrasound data common settings associated to the type of probe transducer used ...
usTransducerSettings & operator=(const usTransducerSettings &other)