Closed kmpape closed 10 months ago
Hi, can you provide a minimal working example to regenerate the error? Additionally what version of SyMBac are you using, the one from PyPi or are you using the latest version from GitHub?
If using from GitHub, the example notebook linked here shown.
I believe the below will throw the error. I have tried installing it using pip from a python-venv, but it reverts to using setup.py. It is at commit d7214ee1f4b70d7f84d714887731a955090859ae on the main branch.
from SyMBac.simulation import Simulation
from SyMBac.PSF import PSF_generator
from SyMBac.renderer import Renderer
from SyMBac.PSF import Camera
from SyMBac.misc import get_sample_images
real_image = get_sample_images()["E. coli 100x"]
my_simulation = Simulation(
trench_length=15,
trench_width=1.3,
cell_max_length=6.65, #6, long cells # 1.65 short cells
cell_width= 1, #1 long cells # 0.95 short cells
sim_length = 100,
pix_mic_conv = 0.065,
gravity=0,
phys_iters=15,
max_length_var = 0.,
width_var = 0.,
lysis_p = 0.,
save_dir="/tmp/",
resize_amount = 3
)
my_simulation.run_simulation(show_window=False)
my_simulation.draw_simulation_OPL(do_transformation=True, label_masks=True)
my_kernel = PSF_generator(
radius = 50,
wavelength = 0.75,
NA = 1.2,
n = 1.3,
resize_amount = 3,
pix_mic_conv = 0.065,
apo_sigma = None,
mode="simple fluo")
my_kernel.calculate_PSF()
my_kernel.plot_PSF()
my_camera = Camera(baseline=100, sensitivity=2.9, dark_noise=8)
my_camera.render_dark_image(size=(300,300));
my_renderer = Renderer(simulation = my_simulation, PSF = my_kernel, real_image = real_image, camera = my_camera)
my_renderer.select_intensity_napari()
my_renderer.optimise_synth_image(manual_update=False)
Ignore my previous comment (deleted) I am able to reproduce the error. I will work on a fix today.
Just pushed 8f658d3f947b239f9a4b75c0b95287c2474cf27c which hopefully should fix the issue, tested in a fresh env using Python 3.10. Please report more bugs if you find them!
Thanks a lot I just saw that now. I will pull the newer version.
Hi, When the example in simple_mother_machine.ipynb is ran with something other than a phase contrast kernel, the function generate_testcomparison throws an error on line 250: `R, W, radius, scale, NA, n, , λ = self.PSF.R, self.PSF.W, self.PSF.radius, self.PSF.scale, self.PSF.NA, self.PSF.n, self.PSF.apo_sigma, self.PSF.wavelength`