Ejemplo n.º 1
0
FMAXHOLO = int(ft.readvalue(CHEMINPARAM, 'fmaxHolo'))
DIMHOLO = int(ft.readvalue(CHEMINPARAM, 'dimHolo'))
PIXTHEO = float(ft.readvalue(CHEMINPARAM, 'pixTheo'))
UBornPitch = 1 / (2 * FMAXHOLO * PIXTHEO)
NB_HOLO = NB_ANGLE

# Path to the specular coordinates
SpecCoordPath = f"{DOSSIERDATA}Pretraitement/Centres_{DIMHOLO}.txt"
fi = rp.Calc_fi(SpecCoordPath, NB_ANGLE, DIMHOLO)

# Paths to the real, and imaginary parts of the field
CHEMIN_RE_UBORN = f"{DOSSIERDATA}Pretraitement/ReBorn_{DIMHOLO}.tiff"
CHEMIN_IM_UBORN = f"{DOSSIERDATA}Pretraitement/ImBorn_{DIMHOLO}.tiff"

# Field files reading
ReUBorn = ft.ReadtiffCube(CHEMIN_RE_UBORN)
ImUBorn = ft.ReadtiffCube(CHEMIN_IM_UBORN)
UBornCplx = ReUBorn + ImUBorn * 1j
del ReUBorn, ImUBorn

# Rounding tomographic volume dimensions to the next power of 2
pow2 = ft.NextPow2(2 * DIMHOLO)
DIMTOMO = 2**pow2

f_recon, TFVol, mask_sum = rp.retropropagation(UBornCplx, NB_HOLO, fi,
                                               FMAXHOLO, REWALD, M.LAMBDA,
                                               M.NIMM, PIXTHEO, UBornPitch)

Refraction = f_recon.real
Absorption = f_recon.imag
Ejemplo n.º 2
0
# Creation of results folder
GERCHBERGFOLDER = M.dossier_gerchberg
if not os.path.exists(GERCHBERGFOLDER):
    os.makedirs(GERCHBERGFOLDER)

# Rounding tomographic volume dimensions to the next power of 2
pow2 = ft.NextPow2(2 * DIMHOLO)
DIMTOMO = 2**pow2

# Paths to the refraction, and absorption of the object
CHEMINABSORP = f"{PROCESSINGFOLDER}/Absorption_{DIMTOMO}x{DIMTOMO}x{DIMTOMO}.tiff"
CHEMINREFRAC = f"{PROCESSINGFOLDER}/Refraction_{DIMTOMO}x{DIMTOMO}x{DIMTOMO}.tiff"
CHEMINOTF = f"{PROCESSINGFOLDER}/OTF_{DIMTOMO}x{DIMTOMO}x{DIMTOMO}.tiff"

# Files reading
Absorption = ft.ReadtiffCube(CHEMINABSORP)
Refraction = ft.ReadtiffCube(CHEMINREFRAC)
OTF = ft.ReadtiffCube(CHEMINOTF)
Rec_Object = Refraction + Absorption * 1j
# plt.imshow(Rec_Object.real[:, :, DIMHOLO], cmap="gray")
# plt.show()
# plt.imshow(Rec_Object.imag[:, :, DIMHOLO], cmap="gray")
# plt.show()

# Gerchberg parameters
NBITER = 10
NMIN = 0
NMAX = 0.05
KAPPAMIN = 0
KAPPAMAX = 0