46 #ifndef __OphReconstruction_h 47 #define __OphReconstruction_h 53 #define RECON_DLL __declspec(dllexport) 55 #define RECON_DLL __declspec(dllimport) 59 #define RECON_DLL __attribute__((visibility("default"))) 87 bool SimulationPos[3];
90 : EyeLength(0.0), EyePupilDiaMeter(0.0), EyeBoxSizeScale(0.0), EyeBoxSize(0.0, 0.0), EyeBoxUnit(0),
91 EyeCenter(0.0, 0.0, 0.0), EyeFocusDistance(0.0), ResultSizeScale(0.0), SimulationTo(0.0), SimulationFrom(0.0),
92 SimulationStep(0), SimulationMode(0), RatioAtRetina(0.0), RatioAtPupil(0.0), CreatePupilFieldImg(false),
93 CenteringRetinaImg(false), ViewingWindow(false)
95 SimulationPos[0] = SimulationPos[1] = SimulationPos[2] =
false;
120 vector<Real *> m_vecEncoded;
121 vector<uchar *> m_vecNormalized;
123 std::vector<Complex<Real>*> field_set_;
124 std::vector<double*> field_ret_set_;
126 std::vector<double*> res_set_;
127 std::vector<double*> res_set_norm_255_;
129 std::vector<ivec2> pn_set_;
130 std::vector<vec2> pp_set_;
131 std::vector<ivec2> pn_ret_set_;
132 std::vector<vec2> pp_ret_set_;
133 std::vector<vec2> ss_ret_set_;
135 std::vector<Real*> recon_set;
136 std::vector<uchar*> img_set;
137 std::vector<ivec2> img_size;
138 std::vector<Real*> focus_recon_set;
139 std::vector<uchar*> focus_img_set;
140 std::vector<ivec2> focus_img_size;
156 void GetPupilFieldFromHologram();
157 void GetPupilFieldFromVWHologram();
158 void Propagation_Fresnel_FFT(
int chnum);
159 void ASM_Propagation();
160 void ASM_Propagation_GPU();
162 void getVarname(
int vtr,
vec3& var_vals, std::string& varname2);
164 void SaveImage(
const char* path,
const char* ext =
"bmp");
166 void SetMode(
unsigned int mode) { m_mode = mode; }
168 bool ReconstructImage();
169 bool readConfig(
const char* fname);
170 bool readImage(
const char* path);
171 bool readImagePNA(
const char* phase,
const char* amplitude);
172 bool readImageRNI(
const char* real,
const char* imaginary);
173 void Perform_Simulation();
175 bool save(
const char * fname, uint8_t bitsperpixel,
uchar* src,
uint px,
uint py);
183 for (
int i = 0; i < size; i++)
190 T gap = maxVal - minVal;
192 for (
int i = 0; i < y; i++)
197 for (
int j = 0; j < x; j++)
199 dst[base + j] = (
uchar)((src[base + j] - minVal) / gap * 255.0);
208 for (
int i = 0; i < y; i++)
211 for (
int j = 0; j < x; j++)
213 dst[base + j] = (
uchar)((src[base + j] - min) / gap * 255.0);
222 #endif // !__OphReconstruction_h
void normalize(T *src, uchar *dst, int x, int y, T max, T min)
void SetMode(unsigned int mode)
void setConfig(OphRecConfig config)
vector< uchar * > & getNormalizedBuffer()
OphRecConfig & getConfig()
structure for 2-dimensional Real type vector and its arithmetic.
structure for 3-dimensional Real type vector and its arithmetic.
virtual void ophFree(void)
Pure virtual function for override in child classes.
void normalize(T *src, uchar *dst, int x, int y)