UsTK : Ultrasound ToolKit  version 2.0.1 under development (2024-11-21)
usImagePostScan3D.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 __usImagePostScan3D_h_
40 #define __usImagePostScan3D_h_
41 
42 #include <visp3/core/vpConfig.h>
43 #include <visp3/ustk_core/usImage3D.h>
44 
45 #include <visp3/ustk_core/usMotorSettings.h>
46 
141 template <class Type>
143 {
144 public:
146  usImagePostScan3D(const usImage3D<Type> &image, const usTransducerSettings &transducerSettings,
147  const usMotorSettings &motorSettings, double spacingX, double spacingY, double spacingZ,
148  double scanLineDepth);
151 
152  double getElementSpacingX() const;
153  double getElementSpacingY() const;
154  double getElementSpacingZ() const;
155  double getScanLineDepth() const;
156 
158 
160 
161  void setData(const usImage3D<Type> &image3D);
162 
163  void setElementSpacingX(double elementSpacingX);
164  void setElementSpacingY(double elementSpacingY);
165  void setElementSpacingZ(double elementSpacingZ);
166  void setScanLineDepth(double scanLineDepth);
167 
168 private:
169  double m_elementSpacingX;
170  double m_elementSpacingY;
171  double m_elementSpacingZ;
173  double m_scanLineDepth;
174 };
175 
179 template <class Type>
181  : usImage3D<Type>(), usTransducerSettings(), usMotorSettings(), m_elementSpacingX(1.0), m_elementSpacingY(1.0),
182  m_elementSpacingZ(1.0), m_scanLineDepth(0.0)
183 {
184 }
185 
190 template <class Type>
192  : usImage3D<Type>(other), usTransducerSettings(other), usMotorSettings(other),
193  m_elementSpacingX(other.getElementSpacingX()), m_elementSpacingY(other.getElementSpacingY()),
194  m_elementSpacingZ(other.getElementSpacingZ()), m_scanLineDepth(other.getScanLineDepth())
195 {
196 }
197 
208 template <class Type>
210  const usMotorSettings &motorSettings, double spacingX, double spacingY,
211  double spacingZ, double scanLineDepth)
212  : usImage3D<Type>(image), usTransducerSettings(transducerSettings), usMotorSettings(motorSettings),
213  m_elementSpacingX(spacingX), m_elementSpacingY(spacingY), m_elementSpacingZ(spacingZ),
214  m_scanLineDepth(scanLineDepth)
215 {
216 }
217 
222 
227 {
228  // from usImage3D
230 
231  // from settings
234 
235  // from this class
236  m_elementSpacingX = other.getElementSpacingX();
237  m_elementSpacingY = other.getElementSpacingY();
238  m_elementSpacingZ = other.getElementSpacingZ();
239  m_scanLineDepth = other.getScanLineDepth();
240 
241  return *this;
242 }
243 
247 template <class Type> bool usImagePostScan3D<Type>::operator==(usImagePostScan3D<Type> const &other)
248 {
250  usMotorSettings::operator==(other) && m_elementSpacingX == other.getElementSpacingX() &&
251  m_elementSpacingY == other.getElementSpacingY() && m_elementSpacingZ == other.getElementSpacingZ() &&
252  m_scanLineDepth == other.getScanLineDepth();
253 }
254 
258 template <class Type> std::ostream &operator<<(std::ostream &out, const usImagePostScan3D<Type> &other)
259 {
260  return out << static_cast<const usImage3D<Type> &>(other) << static_cast<const usTransducerSettings &>(other)
261  << static_cast<const usMotorSettings &>(other) << "spacingX = " << other.getElementSpacingX() << std::endl
262  << "spacingY = " << other.getElementSpacingY() << std::endl
263  << "spacingZ = " << other.getElementSpacingZ() << std::endl
264  << "scan line depth = " << other.getScanLineDepth() << std::endl;
265 }
266 
271 template <class Type> void usImagePostScan3D<Type>::setData(const usImage3D<Type> &image3D)
272 {
274 }
275 
280 template <class Type> double usImagePostScan3D<Type>::getElementSpacingX() const { return m_elementSpacingX; }
281 
286 template <class Type> double usImagePostScan3D<Type>::getElementSpacingY() const { return m_elementSpacingY; }
287 
292 template <class Type> double usImagePostScan3D<Type>::getElementSpacingZ() const { return m_elementSpacingZ; }
293 
298 template <class Type> double usImagePostScan3D<Type>::getScanLineDepth() const { return m_scanLineDepth; }
299 
304 template <class Type> void usImagePostScan3D<Type>::setElementSpacingX(double elementSpacingX)
305 {
306  m_elementSpacingX = elementSpacingX;
307 }
308 
313 template <class Type> void usImagePostScan3D<Type>::setElementSpacingY(double elementSpacingY)
314 {
315  m_elementSpacingY = elementSpacingY;
316 }
317 
322 template <class Type> void usImagePostScan3D<Type>::setElementSpacingZ(double elementSpacingZ)
323 {
324  m_elementSpacingZ = elementSpacingZ;
325 }
326 
331 template <class Type> void usImagePostScan3D<Type>::setScanLineDepth(double scanLineDepth)
332 {
333  m_scanLineDepth = scanLineDepth;
334 }
335 
336 #endif // __usImagePostScan3D_h_
Representation of a physical image volume.
Definition: usImage3D.h:61
bool operator==(const usImage3D< Type > &other)
Definition: usImage3D.h:332
usImage3D< Type > & operator=(const usImage3D< Type > &other)
Definition: usImage3D.h:324
3D post-scan ultrasound image.
double getScanLineDepth() const
double getElementSpacingX() const
void setElementSpacingZ(double elementSpacingZ)
void setScanLineDepth(double scanLineDepth)
bool operator==(const usImagePostScan3D< Type > &other)
usImagePostScan3D(const usImagePostScan3D &other)
void setElementSpacingX(double elementSpacingX)
double getElementSpacingY() const
void setData(const usImage3D< Type > &image3D)
virtual ~usImagePostScan3D()
usImagePostScan3D(const usImage3D< Type > &image, const usTransducerSettings &transducerSettings, const usMotorSettings &motorSettings, double spacingX, double spacingY, double spacingZ, double scanLineDepth)
usImagePostScan3D< Type > & operator=(const usImagePostScan3D< Type > &other)
double getElementSpacingZ() const
void setElementSpacingY(double elementSpacingY)
Generic class for 3D ultrasound motor settings associated to the 3D probe used during acquisition.
usMotorSettings & operator=(const usMotorSettings &other)
bool operator==(const usMotorSettings &other)
Generic class for 2D ultrasound data common settings associated to the type of probe transducer used ...
usTransducerSettings & operator=(const usTransducerSettings &other)
bool operator==(usTransducerSettings const &other)