Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitkBeamformingSettings.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef MITK_BEAMFORMING_SETTINGS
14 #define MITK_BEAMFORMING_SETTINGS
15 
16 #include <itkObject.h>
17 #include <itkMacro.h>
18 #include <mitkCommon.h>
20 
21 namespace mitk {
29  {
30  public:
32  itkCloneMacro(Self);
33 
39  enum Apodization { Hamm, Hann, Box };
40 
45  enum BeamformingAlgorithm { DMAS, DAS, sDMAS };
46 
51  enum ProbeGeometry { Linear, Concave};
52 
53  itkGetConstMacro(PitchInMeters, float);
54  itkGetConstMacro(SpeedOfSound, float);
55  itkGetConstMacro(TimeSpacing, float);
56  itkGetConstMacro(Angle, float);
57  itkGetConstMacro(IsPhotoacousticImage, bool);
58  itkGetConstMacro(TransducerElements, unsigned int);
59  itkGetConstMacro(SamplesPerLine, unsigned int);
60  itkGetConstMacro(ReconstructionLines, unsigned int);
61  itkGetConstMacro(InputDim, const unsigned int*);
62  itkGetConstMacro(UseGPU, bool);
63  itkGetConstMacro(GPUBatchSize, unsigned int);
64  itkGetConstMacro(ApodizationFunction, const float*);
65  itkGetConstMacro(Apod, Apodization);
66  itkGetConstMacro(ApodizationArraySize, int);
67  itkGetConstMacro(Algorithm, BeamformingAlgorithm);
68  itkGetConstMacro(ReconstructionDepth, float);
69  itkGetConstMacro(Geometry, ProbeGeometry);
70  itkGetConstMacro(ProbeRadius, float);
71  itkGetConstMacro(ElementHeights, float*);
72  itkGetConstMacro(ElementPositions, float*);
73  itkGetConstMacro(HorizontalExtent, float);
74 
78  static bool SettingsChangedOpenCL(const BeamformingSettings::Pointer lhs, const BeamformingSettings::Pointer rhs)
79  {
80  return !((std::abs(lhs->GetAngle() - rhs->GetAngle()) < 0.01f) && // 0.01 degree error margin
81  (lhs->GetApod() == rhs->GetApod()) &&
82  (lhs->GetGeometry() == rhs->GetGeometry()) &&
83  (std::abs(lhs->GetProbeRadius() - rhs->GetProbeRadius()) < 0.001f) &&
84  (lhs->GetIsPhotoacousticImage() == rhs->GetIsPhotoacousticImage()) &&
85  (std::abs(lhs->GetPitchInMeters() - rhs->GetPitchInMeters()) < 0.000001f) && // 0.0001 mm error margin
86  (lhs->GetReconstructionLines() == rhs->GetReconstructionLines()) &&
87  (lhs->GetSamplesPerLine() == rhs->GetSamplesPerLine()) &&
88  (lhs->GetReconstructionDepth() == rhs->GetReconstructionDepth()) &&
89  (std::abs(lhs->GetSpeedOfSound() - rhs->GetSpeedOfSound()) < 0.01f) &&
90  (std::abs(lhs->GetTimeSpacing() - rhs->GetTimeSpacing()) < 0.00000000001f) && //0.01 ns error margin
91  (lhs->GetTransducerElements() == rhs->GetTransducerElements()));
92  }
93 
94  static Pointer New(float pitchInMeters,
95  float speedOfSound,
96  float timeSpacing,
97  float angle,
98  bool isPhotoacousticImage,
99  unsigned int samplesPerLine,
100  unsigned int reconstructionLines,
101  unsigned int* inputDim,
102  float reconstructionDepth,
103  bool useGPU,
104  unsigned int GPUBatchSize,
105  Apodization apod,
106  unsigned int apodizationArraySize,
107  BeamformingAlgorithm algorithm,
108  ProbeGeometry geometry,
109  float probeRadius)
110  {
111  Pointer smartPtr = new BeamformingSettings(pitchInMeters,
112  speedOfSound,
113  timeSpacing,
114  angle,
115  isPhotoacousticImage,
116  samplesPerLine,
117  reconstructionLines,
118  inputDim,
119  reconstructionDepth,
120  useGPU,
121  GPUBatchSize,
122  apod,
123  apodizationArraySize,
124  algorithm,
125  geometry,
126  probeRadius);
127  smartPtr->UnRegister();
128  return smartPtr;
129  }
130 
131  unsigned short* GetMinMaxLines();
132 
133  protected:
134 
137  BeamformingSettings(float pitchInMeters,
138  float speedOfSound,
139  float timeSpacing,
140  float angle,
141  bool isPhotoacousticImage,
142  unsigned int samplesPerLine,
143  unsigned int reconstructionLines,
144  unsigned int* inputDim,
145  float reconstructionDepth,
146  bool useGPU,
147  unsigned int GPUBatchSize,
148  Apodization apod,
149  unsigned int apodizationArraySize,
150  BeamformingAlgorithm algorithm,
151  ProbeGeometry geometry,
152  float probeRadius
153  );
154 
155  ~BeamformingSettings() override;
156 
160 
164 
167  float m_TimeSpacing; // [s]
168 
171  float m_Angle;
172 
176 
179  unsigned int m_TransducerElements;
180 
183  unsigned int m_SamplesPerLine;
184 
187  unsigned int m_ReconstructionLines;
188 
191  const unsigned int* m_InputDim;
192 
196 
199  bool m_UseGPU;
200 
201  unsigned int m_GPUBatchSize;
205  const float* m_ApodizationFunction;
206 
210 
214 
218 
222 
226 
230 
234 
238 
241  unsigned short* m_MinMaxLines;
242  };
243 }
244 #endif //MITK_BEAMFORMING_SETTINGS
Class holding the configuration data for the beamforming filters mitk::BeamformingFilter and mitk::Ph...
float m_PitchInMeters
Pitch of the used transducer in [m].
float m_ReconstructionDepth
The Depth up to which the filter should reconstruct the image [m].
float m_TimeSpacing
The time spacing of the input image.
float m_ProbeRadius
Sets the radius of the curved probe [m].
DataCollection - Class to facilitate loading/accessing structured data.
int m_ApodizationArraySize
Sets the resolution of the apodization array (must be greater than 0).
#define MITKPHOTOACOUSTICSALGORITHMS_EXPORT
float m_SpeedOfSound
Speed of sound in the used medium in [m/s].
ProbeGeometry
Available geometries for Probes:
float m_Angle
The angle of the transducer elements.
bool m_UseGPU
Decides whether GPU computing should be used.
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:49
BeamformingAlgorithm
Available beamforming algorithms:
static Pointer New(float pitchInMeters, float speedOfSound, float timeSpacing, float angle, bool isPhotoacousticImage, unsigned int samplesPerLine, unsigned int reconstructionLines, unsigned int *inputDim, float reconstructionDepth, bool useGPU, unsigned int GPUBatchSize, Apodization apod, unsigned int apodizationArraySize, BeamformingAlgorithm algorithm, ProbeGeometry geometry, float probeRadius)
unsigned int m_ReconstructionLines
How many lines should be reconstructed in the final image.
unsigned int m_SamplesPerLine
How many vertical samples should be used in the final image.
const float * m_ApodizationFunction
Sets the amount of image slices in batches when GPU is used.
unsigned int m_TransducerElements
How many transducer elements the used transducer had.
bool m_IsPhotoacousticImage
Flag whether processed image is a photoacoustic image or an ultrasound image.
Apodization
Available apodization functions:
BeamformingAlgorithm m_Algorithm
Sets the used beamforming algorithm.
ProbeGeometry m_Geometry
Sets the used probe geometry.
static bool SettingsChangedOpenCL(const BeamformingSettings::Pointer lhs, const BeamformingSettings::Pointer rhs)
function for mitk::PhotoacousticOCLBeamformingFilter to check whether buffers need to be updated this...
Apodization m_Apod
Sets the used apodization function.
const unsigned int * m_InputDim
Sets the dimensions of the inputImage.