leginon-org / leginon-redmine-archive

1 stars 0 forks source link

advance phase plate at fixed time interval #3786

Open leginonbot opened 5 months ago

leginonbot commented 5 months ago

Author Name: Anchi Cheng (@anchi2c) Original Redmine Issue: 3786, https://emg.nysbc.org/redmine/issues/3786 Original Date: 2015-11-27 Original Assignee: Anchi Cheng


simple wait for user method

leginonbot commented 5 months ago

Original Redmine Comment Author Name: Jian Shi (Jian Shi) Original Date: 2016-03-16T14:03:05Z


Hi Anchi,

Is phase plate functioning. I saw some code in the respository but I can't find the tool in any node or application. I am using latest 19600 version. I would happy to test it for you on our Krios.

Regards, Jian

leginonbot commented 5 months ago

Original Redmine Comment Author Name: Anchi Cheng (@anchi2c) Original Date: 2016-03-16T14:34:11Z


I was working with Matthias Wolf when I committed these changes. There is no TEM scripting for advancing phase plate, so the node simply wait for the user. However, we locally on his scope used a cursor/mouse button manipulation program called AutoIt to "click" the "Next Phase Plate" button on TUI to achieve automation effect.

The node class is PhasePlateAligner. It needs PhasePlatePublishEvent binding from Exposure node. The usage and settings is similar to AlignZLP for energy filter. Therefore, you will need to define a reference target (empty) somewhere on the grid.

FEI promise a scripting access but it has not happened, yet.

Nearly in-focus phase plate usage also needs multi-point focus measurement averaging. Issue #3785

These will be release on 3.3. Matthias is fairly happy with it, but there are still details to clean up. You are welcome to try out. Maybe you will notice different problems.

leginonbot commented 5 months ago

Original Redmine Comment Author Name: Matthias Wolf (Matthias Wolf) Original Date: 2016-03-27T13:16:18Z


On popular demand, I am adding a brief description of automated phase plate (pp) advance with AutoIt. The pp is working brilliantly on our Krios thanks to Anchi's 4-point focuser and pp conditioner (initiates next pp and charges up pp for preset time after chosen time elapsed). AutoIt does Windows GUI automation and works very reliably, but requires the flapped-out "next pp" OCX open in TUI and visible on screen.

  1. Download and install AutoIt on the scope PC: [[https://www.autoitscript.com/site/autoit/downloads/]]
  2. pp conditioner node is already in repository, I think. Requires reference position (empty square) in grid atlas.
  3. Tecnai.py on the scope client needs Anchi's pp modification - look for "AUTOIT". Set AUTOIT_EXE_PATH = "C:\Program Files\AutoIt3\nextphaseplate.exe" in Tecnai.py on scope PC
  4. Modify attached AutoIt script to match your pp OCX window dimensions (use AutoIt Window Info Finder Tool) and compile to exe file

Matthias

leginonbot commented 5 months ago

Original Redmine Comment Author Name: Anchi Cheng (@anchi2c) Original Date: 2016-03-29T03:49:35Z


committed pyscope/tecnai.py that calls AutoIt script executable to go with Matthias's instruction above as r19640

leginonbot commented 5 months ago

Original Redmine Comment Author Name: Jian Shi (Jian Shi) Original Date: 2016-08-09T07:53:41Z


I got AUTOIT script and exe working, and installed latest GIT version includes the function all. But I am not quite sure how tecnai.py call the exe? Is there a node, or setting to control it?

leginonbot commented 5 months ago

Original Redmine Comment Author Name: Jian Shi (Jian Shi) Original Date: 2016-08-09T07:58:25Z


Jian Shi wrote:

I got AUTOIT script and exe working, and installed latest GIT version includes the function call. But I am not quite sure how tecnai.py call the exe? Is there a node, or setting to control it?

leginonbot commented 5 months ago

Original Redmine Comment Author Name: Matthias Wolf (Matthias Wolf) Original Date: 2016-08-09T08:08:04Z


Hi Jian, there is a variable AUTOIT_EXE_PATH in tecnai.py on the microscopy PC, which points to the path and name of the executable. Compile the autoit script, store it in a readable place and modify this path. Matthias

leginonbot commented 5 months ago

Original Redmine Comment Author Name: Jian Shi (Jian Shi) Original Date: 2016-08-09T08:16:31Z


Hi Matthia,

I have done what you have pointed out, and it works well when I double click the exe on Krios PC. Tecnai.py was also modified to the path.

But I am wondering if there is a node/setting in Leginon to activate the function call to the exe. ie. How to control the intervals and incubating time etc.

There is some code in wx folder, suggesting there may be a node for phase plate, just like LN2 filler. But I didn't see it anywhere in latest applications.

leginonbot commented 5 months ago

Original Redmine Comment Author Name: Matthias Wolf (Matthias Wolf) Original Date: 2016-08-09T09:04:25Z


Jian, I don't know where the applications "live" and how to export them... probably in the database.

Try first to import Anchi's latest MSI-T2 xml through the web interface.

If the phase plate node does not show up in the node list, you can create your own new application based on your old one: In leginon GUI "Application - Edit", "Application - Load", choose your existing MSI-T2, right-click on "Main - add node", choose "Phase Plate Aligner", name it "Phase Plate". Then in "exposure" and "Presets Manager" right-click and "bind event" to "Phase Plate" as in the attached screen shot. Save the application under a new name, e.g. "PP-MSI-T2".

I did the same for adding the GIF zero-loss align conditioner, hence "PP-MSI-T2-GIF". For tomo it's similar. Once you load the new application, the properties of the new nodes are self-explanatory when you open them. Anchi, maybe you could make the phase plate conditioner a default of MSI-T2 (3.3)?

leginonbot commented 5 months ago

Original Redmine Comment Author Name: Jian Shi (Jian Shi) Original Date: 2016-08-09T10:54:44Z


Thanks a million, Matthias.

Regards, Jian

leginonbot commented 5 months ago

Original Redmine Comment Author Name: Anchi Cheng (@anchi2c) Original Date: 2016-08-10T01:24:57Z


Matthias,

Thanks for helping Jian. To answer your questions, yes the applications live in the database.

See [[Applications]] regarding "Exporting to Leginon application XML file

It can then imported at the other end.

I will add PP control in 3.3 applications.

leginonbot commented 5 months ago

Original Redmine Comment Author Name: William Rice (@wjrice) Original Date: 2017-01-19T17:13:12Z


added file from krios2

leginonbot commented 5 months ago

Original Redmine Comment Author Name: William Rice (@wjrice) Original Date: 2019-07-05T14:55:29Z


I'm trying to get the PP app working here. I don't see any AUTOIT_EXE_PATH in Tecnai2.py (in the pyscope directory) on the scope PC, and I don't see a tecnai.py file anywhere in the site packages directory. Where is this variable now defined?

leginonbot commented 5 months ago

Original Redmine Comment Author Name: William Rice (@wjrice) Original Date: 2019-07-05T15:09:22Z


NM found it in fei.cfg

leginonbot commented 5 months ago

Original Redmine Comment Author Name: Anchi Cheng (@anchi2c) Original Date: 2020-01-07T18:33:50Z


Saved nextphaseplate.au3.txt as NextPhasePlate.au3 in pyscope/autoit

Also changed the fei.cfg key to

AUTOIT_PHASE_PLATE_EXE_PATH