UsTK : Ultrasound ToolKit  version 2.0.1 under development (2025-01-20)
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 
144 template <class Type>
146  : vpImage<Type>(other), usTransducerSettings(other), m_widthResolution(other.getWidthResolution()),
147  m_heightResolution(other.getHeightResolution())
148 { }
149 
157 template <class Type>
158 usImagePostScan2D<Type>::usImagePostScan2D(const vpImage<Type> &image, const usTransducerSettings &transducerSettings,
159  double widthResolution, double heightResolution)
160  : vpImage<Type>(image), usTransducerSettings(transducerSettings), m_widthResolution(widthResolution),
161  m_heightResolution(heightResolution)
162 { }
163 
168 
173 {
174  // from vpImage
175  vpImage<Type>::operator=(other);
176 
177  // from usTransducerSettings
179 
180  // from this class
181  m_heightResolution = other.getHeightResolution();
182  m_widthResolution = other.getWidthResolution();
183 
184  return *this;
185 }
186 
190 template <class Type> bool usImagePostScan2D<Type>::operator==(const usImagePostScan2D<Type> &other)
191 {
192  return (vpImage<Type>::operator==(other) && usTransducerSettings::operator==(other) &&
193  m_heightResolution == other.getHeightResolution() && m_widthResolution == other.getWidthResolution());
194 }
195 
199 template <class Type> std::ostream &operator<<(std::ostream &out, const usImagePostScan2D<Type> &other)
200 {
201  return out << static_cast<const usTransducerSettings &>(other) << "image width : " << other.getWidth() << std::endl
202  << "image height : " << other.getHeight() << std::endl
203  << "image width resolution : " << other.getWidthResolution() << std::endl
204  << "image height resolution : " << other.getHeightResolution() << std::endl;
205 }
206 
211 template <class Type> void usImagePostScan2D<Type>::setData(const vpImage<Type> &image)
212 {
213  vpImage<Type>::operator=(image);
214 }
215 
220 template <class Type> double usImagePostScan2D<Type>::getHeightResolution() const { return m_heightResolution; }
221 
226 template <class Type> double usImagePostScan2D<Type>::getWidthResolution() const { return m_widthResolution; }
227 
232 template <class Type> void usImagePostScan2D<Type>::setHeightResolution(double heightResolution)
233 {
234  m_heightResolution = heightResolution;
235 }
236 
241 template <class Type> void usImagePostScan2D<Type>::setWidthResolution(double widthResolution)
242 {
243  m_widthResolution = widthResolution;
244 }
245 #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)