# Create sub-FOV list Ns = N_space + N_edge Ms = M_space + N_edge ns, ms = wo.generate_sub_FOV_coordinates((N_full, M_full), (N_space, M_space), (N_edge, N_edge)) os.system('mkdir ' + output_path) # ### Initialize the processing (Source, OTF, ...) xx, yy, fxx, fyy = wo.gen_coordinate((Ns, Ms), ps) rotation_angle = [ 180 - 22.5, 225 - 22.5, 270 - 22.5, 315 - 22.5, 0 - 22.5, 45 - 22.5, 90 - 22.5, 135 - 22.5 ] sector_angle = 45 Source_BF = wo.gen_Pupil(fxx, fyy, NA_obj / n_media / 2, lambda_illu / n_media) Source = wo.gen_sector_Pupil(fxx, fyy, NA_obj / n_media, lambda_illu / n_media, sector_angle, rotation_angle) Source.append(Source_BF) Source = np.array(Source) Source_PolState = np.zeros((len(Source), 2), complex) for i in range(len(Source)): Source_PolState[i, 0] = E_in[0] Source_PolState[i, 1] = E_in[1] # Reconstruct parameters setup = wo.waveorder_microscopy((Ns, Ms), lambda_illu, ps, NA_obj,
wo.plot_multicolumn([del_f_component[0,:,:,z_layer], del_f_component[1,:,:,z_layer], del_f_component[2,:,:,z_layer], del_f_component[3,:,:,z_layer],\ del_f_component[4,:,:,z_layer], del_f_component[5,:,:,z_layer], del_f_component[6,:,:,z_layer]], origin='lower', num_col=4, titles=[r'$f_{0r}$', r'$f_{0i}$', r'$f_{1c}$',r'$f_{1s}$',\ r'$f_{2c}$', r'$f_{2s}$', r'$f_{3}$'],\ size=5, set_title = True) plt.show() ##################################################################### # Forward model of uPTI (polarization-diverse, illumination-diverse,# # depth-diverse acquisition) # ##################################################################### # DPC + BF illumination + PolState (sector illumination) xx, yy, fxx, fyy = wo.gen_coordinate((N, M), ps) Pupil_obj = wo.gen_Pupil(fxx, fyy, NA_obj / n_media, lambda_illu / n_media) Source_support = wo.gen_Pupil(fxx, fyy, NA_illu / n_media, lambda_illu / n_media) NAx_coord = lambda_illu / n_media * fxx NAy_coord = lambda_illu / n_media * fyy rotation_angle = [0, 45, 90, 135, 180, 225, 270, 315] Source = np.zeros((len(rotation_angle) + 1, N, M)) Source_cont = np.zeros_like(Source) Source_BF = wo.gen_Pupil(fxx, fyy, NA_illu / n_media / 2, lambda_illu / n_media) Source_cont[-1] = Source_BF.copy() Source[-1] = wo.Source_subsample(Source_BF, NAx_coord, NAy_coord, subsampled_NA=0.1 / n_media)
t_obj = np.exp(1j * 2 * np.pi * psz * (RI_map - n_media)) plt.figure(figsize=(10, 10)) plt.imshow(np.angle(t_obj[:, :, L // 2]), cmap='gray', origin='lower') plt.figure(figsize=(10, 10)) plt.imshow(np.transpose(np.angle(t_obj[N // 2, :, :])), cmap='gray', origin='lower', aspect=psz / ps) plt.show() # ### Setup acquisition # Subsampled Source pattern xx, yy, fxx, fyy = wo.gen_coordinate((N, M), ps) Source_cont = wo.gen_Pupil(fxx, fyy, NA_illu, lambda_illu) Source_discrete = wo.Source_subsample(Source_cont, lambda_illu * fxx, lambda_illu * fyy, subsampled_NA=0.1) plt.figure(figsize=(10, 10)) plt.imshow(fftshift(Source_discrete), cmap='gray') plt.show() print(np.sum(Source_discrete)) z_defocus = (np.r_[:L] - L // 2) * psz chi = 0.1 * 2 * np.pi setup = wo.waveorder_microscopy((N, M), lambda_illu, ps, NA_obj,