Openholo  v2.1
Open Source Digital Holographic Library
ophWaveAberration.h
Go to the documentation of this file.
1 /*M///////////////////////////////////////////////////////////////////////////////////////
2 //
3 // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
4 //
5 // By downloading, copying, installing or using the software you agree to this license.
6 // If you do not agree to this license, do not download, install, copy or use the software.
7 //
8 //
9 // License Agreement
10 // For Open Source Digital Holographic Library
11 //
12 // Openholo library is free software;
13 // you can redistribute it and/or modify it under the terms of the BSD 2-Clause license.
14 //
15 // Copyright (C) 2017-2024, Korea Electronics Technology Institute. All rights reserved.
16 // E-mail : contact.openholo@gmail.com
17 // Web : http://www.openholo.org
18 //
19 // Redistribution and use in source and binary forms, with or without modification,
20 // are permitted provided that the following conditions are met:
21 //
22 // 1. Redistribution's of source code must retain the above copyright notice,
23 // this list of conditions and the following disclaimer.
24 //
25 // 2. Redistribution's in binary form must reproduce the above copyright notice,
26 // this list of conditions and the following disclaimer in the documentation
27 // and/or other materials provided with the distribution.
28 //
29 // This software is provided by the copyright holders and contributors "as is" and
30 // any express or implied warranties, including, but not limited to, the implied
31 // warranties of merchantability and fitness for a particular purpose are disclaimed.
32 // In no event shall the copyright holder or contributors be liable for any direct,
33 // indirect, incidental, special, exemplary, or consequential damages
34 // (including, but not limited to, procurement of substitute goods or services;
35 // loss of use, data, or profits; or business interruption) however caused
36 // and on any theory of liability, whether in contract, strict liability,
37 // or tort (including negligence or otherwise) arising in any way out of
38 // the use of this software, even if advised of the possibility of such damage.
39 //
40 // This software contains opensource software released under GNU Generic Public License,
41 // NVDIA Software License Agreement, or CUDA supplement to Software License Agreement.
42 // Check whether software you use contains licensed software.
43 //
44 //M*/
45 
46 
47 
48 #pragma once
49 #ifndef __OphWaveAberration_h
50 #define __OphWaveAberration_h
51 
52 #include "ophRec.h"
53 #include <iostream>
54 #include <fstream>
55 #include <complex>
56 #include <cmath>
57 #include <memory>
58 #include <algorithm>
59 #include <vector>
60 #include "tinyxml2.h"
61 #include "sys.h"
62 
63 using namespace std;
64 
65 
69 
86 
88 
95 {
96 private :
100  Real waveLength;
101 
105  Real pixelPitchX;
109  Real pixelPitchY;
113  int nOrder;
117  int mFrequency;
121  Real zernikeCoefficent[45];
122 
123 public:
124 
136  oph::Complex<Real> ** complex_W;
137 
138 
147 
152  bool readConfig(const char* fname);
153 
154 
159  Real factorial(double x);
169  void imresize(double **X, int Nx, int Ny, int nx, int ny, double **Y);
178  double ** calculateZernikePolynomial(double n, double m, vector<double> x, vector<double> y, double d);
182  void accumulateZernikePolynomial();
186  void Free2D(oph::Complex<Real> ** doublePtr);
191  void saveAberration(const char* fname);
196  void readAberration(const char* fname);
197  virtual bool loadAsOhc(const char* fname);
198 
199  void ophFree(void);
200 };
201 
202 #endif
Definition: ophRec.h:85
#define RECON_DLL
Definition: ophWRP.h:56
float Real
Definition: typedef.h:55
Wave Aberration module.
oph::Complex< Real > ** complex_W
double pointer of the 2D data array of a wave aberration
unsigned int uint
Definition: typedef.h:62