Correcting geometric distortion for a resonant scanner

classic Classic list List threaded Threaded
5 messages Options
David C David C
Reply | Threaded
Open this post in threaded view
|

Correcting geometric distortion for a resonant scanner

*****
To join, leave or search the confocal microscopy listserv, go to:
http://lists.umn.edu/cgi-bin/wa?A0=confocalmicroscopy
Post images on http://www.imgur.com and include the link in your posting.
*****

Hi community,

does anyone know of any plug-in or open-source code for correcting geometric distortion for a sinusoidally-scanned image using a resonant scanner?

Thanks, and have a nice day!
--
Ph.D. David Chen
Postdoc - Myers Lab
Max Planck Institute for Molecular Cell Biology and Genetics
David C David C
Reply | Threaded
Open this post in threaded view
|

Re: Correcting geometric distortion for a resonant scanner

*****
To join, leave or search the confocal microscopy listserv, go to:
http://lists.umn.edu/cgi-bin/wa?A0=confocalmicroscopy
Post images on http://www.imgur.com and include the link in your posting.
*****

Just to make myself clear. What I'm looking for is to correct the distortion of an acquired image given that the resonant scanner moves slower at the turning points, and therefore, the image looks elongated at the edges. The sinewave itself is stable enough and hasn't been a problem for me.

Thanks a lot!

--
Ph.D. David Chen
Postdoc - Myers Lab
Max Planck Institute for Molecular Cell Biology and Genetics
Johannes Helm Johannes Helm
Reply | Threaded
Open this post in threaded view
|

Re: Correcting geometric distortion for a resonant scanner

*****
To join, leave or search the confocal microscopy listserv, go to:
http://lists.umn.edu/cgi-bin/wa?A0=confocalmicroscopy
Post images on http://www.imgur.com and include the link in your posting.
*****

Dear Dr. Chen,

I do not know whether you are using a commercial system or a home made
system.

In a commercial system, the producer would make sure that the data
acquisition would be restricted to that part of the sweep of the
scanner, where the movement is "quasi linear", i. e. where the
distortions of the image caused by the deviation of the scanner movement
from "perfect" linearity - unattainable in principle - would be
"negligibly" small (I am going to elaborate on this "eligible" in a
minute). Trying to make this even better would possibly mean "overdoing
it".

What one also could keep in mind:
a)
The true shape of a pixel in the specimen is normally neither circular
nor quadratic even if it will in many image analysis software programs
be displayed on the screen - depending on the zoom factor, which you use
- as a square or cube. The true shape of the pixel will in general in
the specimen be shaped like a somewhat squeezed banana. In the
dimensions orthogonal to the movement of the swept laser beam, the size
of the pixel in the specimen is determined by the PSF of the objective
in conjunction with how well your laser beam made it through all the
table optics and whether it possibly has been "cleaned" by a spatial
filter before entering the microscope. In the direction of the movement
of the swept laser beam, the size is made by the angular speed of the
mirror (as translated into the linear speed of the laser spot in the
specimen!) times the pixel integration time.

b)
There will be aberrations, the worse the deeper you go into the
specimen.

c)
The objective is not perfectly planar corrected. What is suggested to be
a flat surface by the display on the screen is a more or less curved 3D
surface in the specimen. There are objectives, where the curvature of
the field is brought to "small values" as compared to any aberrations
you would expect. However, the "perfectness" of the flattening will
become the poorer the more you approach the outer limit of the field of
view.


Altogether, the aforementioned factors will, I far, outweigh the
distortion you are referring to.


If you are, however, using a home made system, you would have to talk to
the engineer, who built it, in order to find out how he had calibrated
the galvo movement and integrated it into the software.

Best wishes,

Johannes Helm



On 2018-08-01 16:32, David Chen wrote:

> *****
> To join, leave or search the confocal microscopy listserv, go to:
> http://lists.umn.edu/cgi-bin/wa?A0=confocalmicroscopy
> Post images on http://www.imgur.com and include the link in your
> posting.
> *****
>
> Just to make myself clear. What I'm looking for is to correct the
> distortion of an acquired image given that the resonant scanner moves
> slower at the turning points, and therefore, the image looks elongated
> at the edges. The sinewave itself is stable enough and hasn't been a
> problem for me.
>
> Thanks a lot!

--
P. Johannes Helm

Voice: (+47) 228 51159 (office)
Fax: (+47) 228 51499 (office)
David C David C
Reply | Threaded
Open this post in threaded view
|

Re: Correcting geometric distortion for a resonant scanner

In reply to this post by David C
*****
To join, leave or search the confocal microscopy listserv, go to:
http://lists.umn.edu/cgi-bin/wa?A0=confocalmicroscopy
Post images on http://www.imgur.com and include the link in your posting.
*****

Hi Johannes,

thanks for your reply. Ours is a home-built microscope. I believe that most commercial and custom 2p/confocal-microscopes using a resonant scanner do this kind of correction, either by hardware pixel clocking or by software. I was wondering if the code for correcting the image via software is freely available.

best regards,


Ph.D. David Chen
Postdoc - Myers Lab
Max Planck Institute for Molecular Cell Biology and Genetics
Michael Giacomelli Michael Giacomelli
Reply | Threaded
Open this post in threaded view
|

Re: Correcting geometric distortion for a resonant scanner

*****
To join, leave or search the confocal microscopy listserv, go to:
http://lists.umn.edu/cgi-bin/wa?A0=confocalmicroscopy
Post images on http://www.imgur.com and include the link in your posting.
*****

Hi David,

Do you need real time or offline? For offline, it is simple to correct in
Matlab. Image a grid target or haemocytometer to get a map of the scan path
(which will not be exactly sinusoidal unless your optical system is
perfectly corrected). Then use interp1 or spline to resample the pixels so
that they are linearly spaced. You can also just fit a sin if you are doing
a separate distortion correction step or don't need to be exact. You could
also use imagej's image unwarp pluguns, but Matlab is probably easier since
you image will be highly warped and on only one axis.

If you need real time that is a little harder. I started writing an opengl
library for doing this in real-time, but ended up switching to a commerical
product before I finished it.

Mike


On Wed, Aug 1, 2018, 12:36 PM David Chen <[hidden email]> wrote:

> *****
> To join, leave or search the confocal microscopy listserv, go to:
> http://lists.umn.edu/cgi-bin/wa?A0=confocalmicroscopy
> Post images on http://www.imgur.com and include the link in your posting.
> *****
>
> Hi Johannes,
>
> thanks for your reply. Ours is a home-built microscope. I believe that
> most commercial and custom 2p/confocal-microscopes using a resonant scanner
> do this kind of correction, either by hardware pixel clocking or by
> software. I was wondering if the code for correcting the image via software
> is freely available.
>
> best regards,
>
>
> Ph.D. David Chen
> Postdoc - Myers Lab
> Max Planck Institute for Molecular Cell Biology and Genetics
>