RCT-Raster focus targets.
Added by Jason van Rooyen about 14 years ago
I'm having a bit of trouble running RCT-Raster. Hopefully someone will point out what I'm doing wrong.
When I publish the queue of RCT targets i.e. the raster of exposure targets which will be collected at 0 and 40 degree tilts along with a single focus target, an error appears saying that “at least one focus target is needed to check drift”. Also, when I click acquire in the RCT toolbar, no matter what the min and max feature settings, it always returns only “one region found”. I, therefore, suspect that my installation of the feature finding algorithm has gone wrong. Is there a way to check this?
MSI-Raster works beautifully and we have collected many datasets so far, so the problem is definitely specific to RCT.
Please let me know if you have any suggestions.
Thanks in advance,
Jason
Replies (17)
RE: RCT-Raster focus targets. - Added by Anchi Cheng about 14 years ago
A few bug fixes have been made in svn branch for myami-2.0 regarding RCT that might help you with both of the problems you observe. I have merged them from the trunk to the branch myami-2.0 so that you can use them. I suggest that you do an svn update of your myami, run the python installations on your processing server which will update your copy in the python site-packages. You can also do a search in Leginon Issues on RCT and you will see what was worked on. Hopefully that will be all.
RE: RCT-Raster focus targets. - Added by Jason van Rooyen about 14 years ago
Thanks. The changes allow features to be found and the application collects the 0 tilt, rotates the stage, and keeps the features centered, but it then fails during RCT_Focus. The error given each time is: " ValueError: cannot convert float NaN to integer".
After this error appears the second tilted exposure is collected but the image is terrible due to the very incorrect beam tilt. I have to realign the rotation center each time.
Is this a bug or have I missed any additional alignments specific to RCT?
Jason
RE: RCT-Raster focus targets. - Added by Anchi Cheng about 14 years ago
This might be a bad parameter settings problem but Focuser should tilt the beam back regardlessly. I've started a new issue #969 for that.
Could you
1. list the Focus sequences (Items in the Second Toolbar) in the RCT_Focus node with their parameters.
2. Take a screenshot of the logger window (stretch it out so more can be shown) surrounding the error message. I need to identify where the error occurs.
3. Take a screenshot of the advanced settings of RCT node.
Post them here as added file and use them in your post if you want to comment on them.
Anchi
RE: RCT-Raster focus targets. - Added by Jason van Rooyen about 14 years ago
Most of the settings are the defaults loaded with the RCT-Raster application. The second focus step uses "defocus" in fa to adjust the final exposure.
focus_seq.jpg (45.8 KB) focus_seq.jpg | |||
RCTsettings.jpg (106 KB) RCTsettings.jpg | |||
error_RCT_panel.jpg (194 KB) error_RCT_panel.jpg | |||
error_RCT_panel.jpg (194 KB) error_RCT_panel.jpg | |||
error.jpg (200 KB) error.jpg |
RE: RCT-Raster focus targets. - Added by Anchi Cheng about 14 years ago
Do you have stage position calibration at your fa preset magnification? To measure defocus with stage tilted, Leginon needs both the defocus matrix and stage position matrix for the preset used for the beam tilt-based autofocusing. I think your error " ValueError: cannot convert float NaN to integer" came from not having one of the matrix in that tilt correction. A rough calibration that gives the direction of the stage axis and rough scale should be enough.
RE: RCT-Raster focus targets. - Added by Jason van Rooyen about 14 years ago
That sounds like the problem. I have been overlooking my bad "fa" stage calibration because I didn't need it for MSI-T or MSI-Raster. I will recalibrate and try again.
Thanks.
RE: RCT-Raster focus targets. - Added by Jason van Rooyen about 14 years ago
Unfortunately, recalibrating the scale-rotation stage model at "fa" did not help the problem. I am still getting the "ValueError: cannot convert float NaN to integer" error. I have included the terminal dump from the session (the traceback problems are from my sketchy WX installation).
RE: RCT-Raster focus targets. - Added by Jim Pulokas about 14 years ago
Jason,
Can you try the following replacement for calibrationclient.py. Make a backup of your installed version and then install the new one. This will help with debugging by saving all MRC images during the focusing procedure. The images will be stored in the current directory where you run Leginon, which filenames such as: calclient_20101101_123104_7.mrc. They include a time stamp of the form YYYYMMDD_HHMMSS, which can reference us to the times in the Leginon log. Also, it will print image statistics to the terminal window each time it saves one of these images.
Can you run Leginon in such a way to reproduce the NaN errors. Then send us these debug images that led to the error. Also a screen shot of the log from Leginon, both RCT and RCT Focus, so we can match the times with the MRC files. Finally, a copy/paste of the stats printed to the terminal window. There may be many MRC files saved, so you may be able to tell from the printed stats which ones are the interesting ones with NaN.
Jim
calibrationclient.py (62.5 KB) calibrationclient.py | replacement calibrationclient.py that will save MRC images |
RE: RCT-Raster focus targets. - Added by Jason van Rooyen about 14 years ago
Will do Jim. We're running an EM course for the students this week but I'll try again hopefully next week.
Thanks.
RE: RCT-Raster focus targets. - Added by Jason van Rooyen about 14 years ago
Hi Jim,
I managed to reproduce the error in MSI-Edge. The "cannot convert float NaN to integer" error occurs during edge detection. Funnily enough, MSI-T works perfectly. Do these applications call on different mathematical libraries or subroutines and if so which do you think is suspect?
Jason
RE: RCT-Raster focus targets. - Added by Anchi Cheng about 14 years ago
Hi, Jason,
Does this happen to all your image input into the edge target finder or just ones that are tilted or other specific condition? Yes, MSI-Edge and MSI-T do have different subroutines. In particular, there is an edge-finding algorithm in the former, but not the latter, which is why the first is called ....Edge.
In addition, you can check with the default image to see if what you get is caused by your image or particular settings of your edge finding, or a general problem in the installation.
In the wiki page below, it mentioned how you can load the default image, and that the default values of Leginon should find some targets for you.
http://emg.nysbc.org/projects/leginon/wiki/MSI_set-up_in_more_details#Hole-Targeting-Set-up
Anchi
RE: RCT-Raster focus targets. - Added by Jim Pulokas about 14 years ago
Can you tell us what version of numpy and scipy you are using. Easy way to check that is to start python, then enter the following:
import numpy numpy.__version__ import scipy scipy.__version__
(There are two "_" characters before and after "version")
RE: RCT-Raster focus targets. - Added by Jason van Rooyen about 14 years ago
I can confirm that the problem occurs with the test image and the default settings. I am using numpy 1.3.0-3build1 and scipy 0.7.0-2.
RE: RCT-Raster focus targets. - Added by Jim Pulokas about 14 years ago
Jason,
I searched for those packages exactly, but I only find that numpy package (3build1) for ubuntu 10.10 and 10.04. Let me know if you are using one of those or something else. I can try to install the exact same system you have so I can reproduce this error.
Jim
RE: RCT-Raster focus targets. - Added by Jason van Rooyen over 13 years ago
I have reproduced the "cannot convert float NaN to integer" error in a
new installation of Ubuntu 10.10 with Python 2.6.6 and Numpy 1.3.0
using the following:
import numpy x=numpy.array([1,2,3]) x[0]=numpy.nan
The problem therefore lies firmly with Python and not Leginon.
We're still working away with MSI-Raster and MSI-T but I think
installing Centos on the processing server will probably be the
easiest way to avoid these errors and get RCT working.
Jason
RE: RCT-Raster focus targets. - Added by Anchi Cheng over 13 years ago
Jim has installed Ubuntu on his workstation to check on the difference in the way its installation behaves different from that on CentOS. some of the error handling is certainly different between numpy 1.3 amd 1.1. There is a fix made by him that fixed the display problem r15007 which I just merged into the branches, r15442 in 2.0 and r15443 in 2.1 This will solve the display problem.
However, it does not help the RCT problem because we need to find out the cause of the the bad array. One possibility is the scipy.ndimage.affine_transform in tiltcorrector created bad output as that is passed back.
The modified tiltcorrector.py is attached.
You are using 2.0, right?
By the way, I've noticed that your RCT settings is such that it collect the 0 deg first and then high tilt. For RCT purpose, the high tilt image is what you will be doing the reconstruction. Therefore, it should be the first to be collected. I don't think that is related to the current problem, though.
Anchi
tiltcorrector.py (12.1 KB) tiltcorrector.py |
RE: RCT-Raster focus targets. - Added by Jason van Rooyen over 13 years ago
OK, I have a workaround. Ubuntu 8.04 with Python 2.5.2 and Numpy 1.0.4 works and there are no errors in the MSI-Edge application. These are all standard installs of the packages accessed through aptitude package manager and our local repository.
I think the problem lies with Python versions >= 2.6. Apparently they changed the was Nan (not a number) values are handled in Python 2.6 and this is likely the cause: http://old.nabble.com/ValueError:-cannot-convert-float-to-NaN-to-integer-td24612080.html
I can confirm that Python 2.6.6 (Ubuntu 10.1 & Numpy 1.3.0), Python 2.6.5 (Ubuntu 10.04 & Numpy 1.3.0), Python 2.7 (Ubuntu 11 & Numpy 1.5.1) all produce an error when converting NaN to an integer e.g.
mport numpy x=numpy.array([1,2,3]) x[0]=numpy.nan
However, Python 2.5.2 on Ubuntu 8.04 with Numpy 1.0.4 does not.
For now we will use this setup but hopefully a future Python version in Ubuntu will address the problem.
Thank you for the feedback and help.
Jason