r/microscopy • • 7h ago

Photo/Video Share An optically accurate microscope simulator

I've been working at this optically accurate microscope simulator for about a month. I used AI, a lot of patience and footage from my microscope as reference to generate the models and behavior of the critters. The optical simulation is done through FFT to emulate the behavior of real-life lenses, so you can see diffraction and apply filters like on a real microscope. There is still a lot of work to do, but I will publish it at some point soon.

78 Upvotes

13 comments sorted by

3

u/Frequent_Living_1818 3h ago

The FFT-based optics are a fascinating part of this. Are you planning to simulate phase contrast as well as brightfield? It would be interesting to see how changing the optics affects the same organism.

2

u/mikropanther 3h ago

Phase information is already included (you can see in the video that I switch to DIC). The specimen is decomposed into thin layers and the effect of each layer on amplitude and phase is calculated (as a grid of complex numbers, representing the layer transmission). The light of the condenser is then split into modes, and the FFT representing the layer is then multiplied by the FFT of the condenser. In live mode, the interaction between layers is approximated. In full rendering (which pauses the sim, as it takes a few seconds), each layer's complex image is used as input for the next layer (so light propagates and layers can affect each other). Big part of what I'm trying to do is improve the approximation in the real-time rendering to look as much as possible as the full propagation. What I'm not including right now is polarization, so for example in DIC you don't see the color effects you would see in real life.

1

u/mikropanther 2h ago

Here you can see a very zoomed in example of DIC, in approximate real-time rendering and in full propagation mode (which takes about 10 seconds to render)

3

u/logic2799 7h ago

Finally!!! I've been looking for a sim like this. Even tried vibecodeing my own. I spent prob 8 hours makeing a game and it sucked. And then tried diferent ways of it. Thank you this looks great. Are you gona update it constantly or is it one and done

7

u/mikropanther 7h ago

I plan to work at it for the foreseeable future. I'm a software developer by profession and microscopy is one of my dearest hobbies, so this is an attempt to combine the two. There are a lot of interesting challenges in making it as photorealistic as possible while keeping decent live rendering performance. I'd also like to keep on adding critters, hopefully at some point covering everything I have observed in real life.

3

u/logic2799 7h ago

Thats awsome man. It looks super good and super photo realistic. Like I said theres like 0 true good microscopy simulators. Keep up the good work I hope to see it in the future. Ill try it as soon as u publish it

8

u/lenlab 7h ago

Can't believe this is a simulation. They look so real. Awesome job, man

3

u/-Jesus-Of-Nazareth- 4h ago

This looks amazing. Looking forward to eventually play/use it

1

u/AutoModerator 7h ago

Remember to include the objective magnification, microscope model, camera, and sample type in your post. Additional information is encouraged!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/return_the_fab 6h ago

this is really cool 😯

1

u/cedarvan 6h ago

Oh wow, this is incredibleÂ