Nikon PFS one-time autofocusing

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Nikon PFS one-time autofocusing

jonchengw
Hi all,

I'm new to Micro-Manager was I was wondering if there is a feature in MM where I can do auto-Perfect Focus for one time like I can in Nikon Elements. A typical workflow would be like this:

1. I set up auto-Perfect Focus where the software automatically adjusts Perfect Focus to an optimal setting, using one or two passes (may include rough or fine steps as in Elements).

2. Then knowing the Perfect Focus setting (in Z units) set the current microscope Z position to the auto-PFS-determined value and do a Multi-D acquisition.

Does anyone know of an auto-PFS feature? Thank you.

Best regards,
Jonathan 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Nikon PFS one-time autofocusing

centswu
Hi Jonathan,

NIS two passes aufofocus is similar with uM two steps autofocus flow.
You can follow this website to do configuration .


Jonathan Cheng <[hidden email]>
Hi all,

I'm new to Micro-Manager was I was wondering if there is a feature in MM where I can do auto-Perfect Focus for one time like I can in Nikon Elements. A typical workflow would be like this:

1. I set up auto-Perfect Focus where the software automatically adjusts Perfect Focus to an optimal setting, using one or two passes (may include rough or fine steps as in Elements).

2. Then knowing the Perfect Focus setting (in Z units) set the current microscope Z position to the auto-PFS-determined value and do a Multi-D acquisition.

Does anyone know of an auto-PFS feature? Thank you.

Best regards,
Jonathan 
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Nikon PFS one-time autofocusing

jonchengw
Hi,
Thank you very much for your help!

Best,
Jonathan

On Thu, Apr 26, 2018 at 6:10 PM, cents wu <[hidden email]> wrote:
Hi Jonathan,

NIS two passes aufofocus is similar with uM two steps autofocus flow.
You can follow this website to do configuration .


Jonathan Cheng <[hidden email]>
Hi all,

I'm new to Micro-Manager was I was wondering if there is a feature in MM where I can do auto-Perfect Focus for one time like I can in Nikon Elements. A typical workflow would be like this:

1. I set up auto-Perfect Focus where the software automatically adjusts Perfect Focus to an optimal setting, using one or two passes (may include rough or fine steps as in Elements).

2. Then knowing the Perfect Focus setting (in Z units) set the current microscope Z position to the auto-PFS-determined value and do a Multi-D acquisition.

Does anyone know of an auto-PFS feature? Thank you.

Best regards,
Jonathan 
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Nikon PFS one-time autofocusing

julou
In reply to this post by centswu
I believe that https://micro-manager.org/wiki/Autofocus_manual is *not*
relevant for PFS…

There're a few things to know when using PFS with MM's MDA, in particular
whether or not PFS should be turned off before starting the acquisition:
https://github.com/vanNimwegenLab/MiM_NikonTi/blob/master/Docs/NikonTi_with_MicroManager.md#pfs-autofocus

Also, if you want to focus over a deeper range, you can use
HardwareFocusExtender as AF device instead of TiPFS (you still need to
specify TiPFS in HardwareFocusExtender settings).

If you need more help, please tell us more about the type of MDA you're
trying to achieve.
Best,
--
Thomas Julou  |  Computational & Systems Biology  |  Biozentrum – University
of Basel  |  Klingelbergstrasse 50/70 CH-4056 Basel  |  +41 (0)61 207 16 21
|  https://julou.github.io/




-----
Thomas Julou  |  Computational & Systems Biology  |  Biozentrum – University of Basel  |  Klingelbergstrasse 50/70 CH-4056 Basel  |  +41 (0)61 267 16 21

--
Sent from: http://micro-manager.3463995.n2.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Thomas Julou  |  Computational & Systems Biology  |  Biozentrum – University of Basel  |  Klingelbergstrasse 50/70 CH-4056 Basel  |  +41 (0)61 267 16 21
Reply | Threaded
Open this post in threaded view
|

Re: Nikon PFS one-time autofocusing

centswu
Hi Julou,

NIS's continue autofocus is a very good feature to do autofocus.
Is there a similar feature for uM do this with Leica DM6B microscope .

Thanks,
Cents

2018-04-27 20:17 GMT+08:00 julou <[hidden email]>:
I believe that https://micro-manager.org/wiki/Autofocus_manual is *not*
relevant for PFS…

There're a few things to know when using PFS with MM's MDA, in particular
whether or not PFS should be turned off before starting the acquisition:
https://github.com/vanNimwegenLab/MiM_NikonTi/blob/master/Docs/NikonTi_with_MicroManager.md#pfs-autofocus

Also, if you want to focus over a deeper range, you can use
HardwareFocusExtender as AF device instead of TiPFS (you still need to
specify TiPFS in HardwareFocusExtender settings).

If you need more help, please tell us more about the type of MDA you're
trying to achieve.
Best,
--
Thomas Julou  |  Computational & Systems Biology  |  Biozentrum – University
of Basel  |  Klingelbergstrasse 50/70 CH-4056 Basel  |  +41 (0)61 207 16 21
https://julou.github.io/




-----
Thomas Julou  |  Computational & Systems Biology  |  Biozentrum – University of Basel  |  Klingelbergstrasse 50/70 CH-4056 Basel  |  +41 (0)61 267 16 21

--
Sent from: http://micro-manager.3463995.n2.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Nikon PFS one-time autofocusing

jonchengw
In reply to this post by julou
Hi Thomas,

Yes, I found that the autofocus features in MM are not relevant for automatically detecting an optimal PFS offset focus (they all use the microscope Z drive with PFS turned off). Ideally, here is my MDA workflow:

1) At extremities of the scan area, ideally have MM automatically adjust PFS offset for autofocusing.

2) Take an average of the PFS offsets in the extremities and apply that PFS value for all the stage positions to be scanned (maybe directly enter PFS offset in Device Property Browser).

Normally, our samples are fairly flat such that this PFS averaging method has worked well for us. Any hints would be appreciated.

Thanks.

Best regards,
Jonathan

On Fri, Apr 27, 2018 at 5:17 AM, julou <[hidden email]> wrote:
I believe that https://micro-manager.org/wiki/Autofocus_manual is *not*
relevant for PFS…

There're a few things to know when using PFS with MM's MDA, in particular
whether or not PFS should be turned off before starting the acquisition:
https://github.com/vanNimwegenLab/MiM_NikonTi/blob/master/Docs/NikonTi_with_MicroManager.md#pfs-autofocus

Also, if you want to focus over a deeper range, you can use
HardwareFocusExtender as AF device instead of TiPFS (you still need to
specify TiPFS in HardwareFocusExtender settings).

If you need more help, please tell us more about the type of MDA you're
trying to achieve.
Best,
--
Thomas Julou  |  Computational & Systems Biology  |  Biozentrum – University
of Basel  |  Klingelbergstrasse 50/70 CH-4056 Basel  |  +41 (0)61 207 16 21
https://julou.github.io/




-----
Thomas Julou  |  Computational & Systems Biology  |  Biozentrum – University of Basel  |  Klingelbergstrasse 50/70 CH-4056 Basel  |  +41 (0)61 267 16 21

--
Sent from: http://micro-manager.3463995.n2.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Nikon PFS one-time autofocusing

julou
Hi Jonathan,

The standard use case is (as mentioned in the link sent above) to adjust the
focus at each position. It's difficult for me to understand your constraints
and why this doesn't work in your case from the description you give.

One thing that might be relevant here would be to attach a "runnable" (i.e a
small script run at specified iterations of your MDA) so that you could
disable the autofocusing in the MDA settings and do something custom at
certain positions/iterations (e.g. visit corner positions, run PFS there and
average their z values…).

To get more help, please send a description of your MDA settings (or your
saved MDA settings as xml file) and explain at what steps and how you would
like to run the PFS.

Best,
Thomas



-----
Thomas Julou  |  Computational & Systems Biology  |  Biozentrum – University of Basel  |  Klingelbergstrasse 50/70 CH-4056 Basel  |  +41 (0)61 267 16 21

--
Sent from: http://micro-manager.3463995.n2.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Thomas Julou  |  Computational & Systems Biology  |  Biozentrum – University of Basel  |  Klingelbergstrasse 50/70 CH-4056 Basel  |  +41 (0)61 267 16 21
Reply | Threaded
Open this post in threaded view
|

Re: Nikon PFS one-time autofocusing

jonchengw
Hi Thomas,

I'm sorry that I may not have been clear. Regardless, of any kind of MDA, even for one stage position and one image capture, I need something where the software adjusts PFS offset to an optimal position based on image sharpness. In NIS-Elements, this the "Auto PFS Focus" option. My question is: is there a plugin in Micro-Manager that can do this? Thanks.

Best,
Jonathan



On Sat, Apr 28, 2018 at 11:06 AM, julou <[hidden email]> wrote:
Hi Jonathan,

The standard use case is (as mentioned in the link sent above) to adjust the
focus at each position. It's difficult for me to understand your constraints
and why this doesn't work in your case from the description you give.

One thing that might be relevant here would be to attach a "runnable" (i.e a
small script run at specified iterations of your MDA) so that you could
disable the autofocusing in the MDA settings and do something custom at
certain positions/iterations (e.g. visit corner positions, run PFS there and
average their z values…).

To get more help, please send a description of your MDA settings (or your
saved MDA settings as xml file) and explain at what steps and how you would
like to run the PFS.

Best,
Thomas



-----
Thomas Julou  |  Computational & Systems Biology  |  Biozentrum – University of Basel  |  Klingelbergstrasse 50/70 CH-4056 Basel  |  +41 (0)61 267 16 21

--
Sent from: http://micro-manager.3463995.n2.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Nikon PFS one-time autofocusing

Nico Stuurman-2
Hi Jonathan,

> I'm sorry that I may not have been clear. Regardless, of any kind of
> MDA, even for one stage position and one image capture, I need
> something where the software adjusts PFS offset to an optimal position
> based on image sharpness. In NIS-Elements, this the "Auto PFS Focus"
> option. My question is: is there a plugin in Micro-Manager that can do
> this?

Make sure that you set your PFS Offset device as the Core-Focus drive
(in Device Properties), then use any of the standard image-based
autofocus methods (see:
https://micro-manager.org/wiki/Micro-Manager_User%27s_Guide#Software_Autofocus)
to autofocus.  Since the PFS Offset often does not vary much, I do not
think anyone uses this approach, but it should be possible (depending on
the quality of the software autofocus).

Also, the Nikon documentation says that it is not possible to get
microns out of the PFS offset, so there is some magic going on when
using this approach.

Best,

Nico




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Nikon PFS one-time autofocusing

julou
In reply to this post by jonchengw
Hi Jonathan,

I'll give it one last try, but I'm afraid we talk past each other:
- as described in the documentation
(https://micro-manager.org/wiki/Micro-Manager_User%27s_Guide#Hardware_Autofocus)
you first have to "include [the PFS] in the Hardware Configuration and
select it in the Autofocus Properties dialog".

Then I know 3 (straightforward) ways to call the PFS from MM:
- to focus manually at the current position: use the AF button in the main
window (binoculars icon, right of ROI and zoom; the next "settings" icon
allow you to set the corresponding AF settings i.e. this is where you want
to select PFS for autofocusing)
- to focus during an MDA, you have to set MDA's autofocus settings to PFS.
And to make sure to manually disable the PFS before starting the MDA (cf
links in my previous posts)
- to use the PFS from scripts (either custom acquisition scripts used
instead of MDA, or MDA customisation aka runnable), you can use
mmc.fullFocus. The same API help page describes a bunch of lower level
functions to use the PFS programatically.
https://valelab4.ucsf.edu/~MM/doc/MMCore/html/class_c_m_m_core.html#a09a789a9ee5f2715244f26ecdab9c428

Also worth noting, wherever one select PFS as autofocus, one can instead
select hardware focus extender which runs PFS over a wider range and with
additional controls.
As an aside, the PFS doesn't rely on "image sharpness"; so your last post
made me wonder what you're really talking about, maybe some advanced
function of NIS that I dont know of.

I hope this helps.
Best,

Thomas
--
Thomas Julou  |  Computational & Systems Biology  |  Biozentrum – University
of Basel  |  Klingelbergstrasse 50/70 CH-4056 Basel  |  +41 (0)61 207 16 21
|  https://julou.github.io/




-----
Thomas Julou  |  Computational & Systems Biology  |  Biozentrum – University of Basel  |  Klingelbergstrasse 50/70 CH-4056 Basel  |  +41 (0)61 267 16 21

--
Sent from: http://micro-manager.3463995.n2.nabble.com/

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Thomas Julou  |  Computational & Systems Biology  |  Biozentrum – University of Basel  |  Klingelbergstrasse 50/70 CH-4056 Basel  |  +41 (0)61 267 16 21