Project

General

Profile

Actions

Installation on the microscope computer 30 » History » Revision 1

Revision 1/70 | Next »
Anchi Cheng, 04/23/2013 03:37 PM


Installation on the microscope computer 30

If you are installing 2.2, see Installation on the microscope computer

Only processing-side of Leginon system is needed

Package requirement

Python and Support Packages (Note that python 2.7 must be used to match window installers of myami modules):

These are 64-bit versions of the packages we have used on Intel processors. You should generally be able to use the most recent versions of these packages that are available from their respective web sites. Just be sure to always get the version that is compatible with Python 2.7 except numpy which need to be 1.7.x. If you are having trouble with the most recent version, try to use the specific versions We includ in http:/emg.nysbc.org/redmine/projects/leginon/files

Python 2.7* http://www.python.org http://emg.nysbc.org/attachments/download/2057/python-2.7.3.amd64.msi
Python for Windows extension (pywin32) http://sourceforge.net/projects/pywin32/ http://emg.nysbc.org/attachments/download/1811/numextension-svn.win-amd64-py2.7.exe
wxPython 2.5.2.8 or newer http://www.wxpython.org http://emg.nysbc.org/attachments/download/2058/wxPython2.8-win64-unicode-2.8.12.1-py27.exe
MySQL Python client 1.2 or newer http://sourceforge.net/projects/mysql-python http://emg.nysbc.org/attachments/download/1815/MySQL-python-1.2.3.win-amd64-py2.7.exe
Python Imaging Library (PIL) 1.1.4 or newer http://www.pythonware.com/products/pil/ http://emg.nysbc.org/attachments/download/1814/PIL-fork-1.1.7.win-amd64-py2.7.exe
NumPy 1.6 (tested, others may work) http://www.scipy.org http://emg.nysbc.org/attachments/download/1812/numpy-MKL-1.6.2.win-amd64-py2.7.exe
SciPy 0.5.1 or newer http://www.scipy.org http://emg.nysbc.org/attachments/download/1813/scipy-0.11.0.win-amd64-py2.7.exe

*comarray is not yet compiled with python 2.7. You will need to use Python 2.5 if you have camera that must be controled through TIA such as FEI Eagle and Falcon.

SVN client used for check out from our repository

This required for following this instruction. We have used Tortois SVN client. Alternatively, you may copy the required NRAMM source files from another computer.

Name: Download site:
Tortoise SVN client http://tortoisesvn.tigris.org

Required supporting programs for the CCD camera from camera makers

Install and register the following programs for CCD cameras from the two makes. Most likely, you already have these installed when the camera and TEM software was installed:

Camera Make: File:
Gatan TecnaiCCD.dll
Tietz CAMC4.exe*
DirectElectronDE12 DirectElectronAPI.exe

Supporting programs for film exposure

Install the following if you need film exposure on FEI Tecnai TEM through Leginon, available through FEI. Please contact Max Otten: and request for adaexp.exe that works with your version of Tecnai user interface program.

Name: File:
exposure adaptor adaexp.exe

Packages required from NRAMM

These are the sub-packages of myami that you will install with the python installer.

Name: Purpose:
leginon modular TEM image acquisition
pyami general functions
sinedon Leginon/database interaction
pyscope microscope control and monitoring
imageviewer image viewing for tomography

For FEI Eagle Camera or Gatan Camera that uses TIA, comarray package needs to be install with python
Special Instructions for FEI Eagle Camera

Because numextension, comarray and libcv would require extra compilers if you build them yourself, we have created Windows installers for them for python 2.5 and made them available at http://emg.nysbc.org/projects/leginon/files.

These are the Leginon v2.0 python 2.7 compiled packages installed through python installer on Windows. Leginon v2.2 uses the same files.

Downloadfile Name Purpose:
http://emg.nysbc.org/attachments/download/1811/numextension-svn.win-amd64-py2.7.exe c extension for numerical processing
libCV-2.0.0.win32-py2.5.exe small c library of algorithm from computer vision field

Installation

Add the IP address and matching hostname of the microscope and digital camera computer in your host file on the main Leginon computer, and vice versa.

Find out what python thinks the hostname is with python command line. REPEAT this both on Linux and Windows PC

Run the following in python command line:

import socket
socket.gethostname()

Find out the ip address associated with the hostname

Run the following in python command line:

import socket
socket.gethostbyname('your_host_name')

Modify your "hosts" file on the linux Leginon computer to include the instrument hosts if the latter is not already mapped by your domain name server

  • On Linux, this "hosts" file is at

/etc/hosts

Example of a "hosts" file:

192.000.1.222   instrument_host_name.domain_name instrument_short_host_name

Use shorter linux hostname if desired

If you'd like to shorten your linux hostname recognized by socket without the domain name, you may do so as root

hostname your_shorter_hostname

and also add that to the /etc/hosts as an alternative name

192.000.1.333   long_host_name.domain_name your_shorter_hostname

You will need to restart networking to make it persistent.

/etc/init.d/network restart

Test the change by finding the ip address with the hostname as in the above section.

The Linux main Leginon computer also needs to identify itself by its hostname registered on the instrument Windows computer.

  • On Window XP and WIndows 7 this host file is

C:\\WINDOWS\system32\drivers\etc\hosts

  • On Window NT, this host file is

C:\\WINNT\system32\drivers\etc\hosts

Register TecnaiCCD.dll, CAMC4.exe (For Tietz camera), and adaexp.exe (For film exposure)

  • From the command prompt, run the following commands. You may need to enter the full path of the exe or dll:
    adaexp.exe /regserver
    CAMC4.exe /regserver
    REGSVR32 TecnaiCCD.dll

Install Python and supporting packages with their installers

Excute the installer files and follow the instructions.

Install the Windows Installer Files from Leginon website http://emg.nysbc.org/projects/leginon/files

Execute the installer files and follow the instructions. Do not execute comarray-2.0.0.win32-py2.5.3x3 if your camera uses TIA. See earlier section above.

Check out SVN Source Files from the repository

Use your mouse to do the following
  • Create Leginon2.2 directory somewhere at your convenience
  • Change directory into Leginon2.2
  • Right-click the mouse botton in this directory window and select Tortoise svn
    Checkout in the menu:

Install the packages you downloaded from NRAMM svn repository

  • Start a command line Window from Start Menu
  • Install the package in each folder with commands such as
    cd Your_Download_Place\Leginon2.2\leginon
    c:\\python25\python.exe setup.py install

    Then continue with the other packages, replacing leginon with the package name. See "These are the sub-packages of myami that you will install with the python installer." section above for complete list.

Run updatecom.py

From a command line window:

cd C:\python25\Lib\Site-Packages\pyScope
C:\python25\python.exe updatecom.py

The python window appears should say show the required type libraries it found:

Generating .py files from type libraries...
initializing TEM Scripting Error, cannot find typelib for "TEM Scripting" 
initializing Tecnai Scripting done.
initializing TOM Moniker done.
initializing Tecnai Low Dose Kit done.
initializing Tecnai Exposure Adaptor done.

initializing Tietz CCD Camera done.

The output is of course depending on what is available on your microscope computer. You should have either "Tecnai Scripting" or the pairing of "TEM Scripting" and "TOM Moniker".

You will only find Tecnai Exposure Adaptor (Scripting for film exposure) if you ask FEI for it.

The script should generate a few files in C:\\python25\Lib\win32com\gen_py with seemly scrambled names such as BC0A2B03-19FF-11D3-AE00-00A024CBA50Cx0x1x9.py

Locate global configuration directory following standard on Windows

Saving cfg files in a global location reduces future need for copying old configuration to updated installation. The location is different for different versions of Windows. To locate the one for your Windows version:

  1. go to C:\\python27\Lib\site-packages\leginon
  2. run configcheck.py

The script gives the three search directories of the cfg files and the loaded file if present. Note the first search directory that with a name most likely start with C:\\Programs and ends with \myami. This is the global configuration directory we will use.

Configure leginon.cfg:

Follow the instructions in Configure leginon.cfg located in the section for Linux installation but note the location of the configuration files follows. In addition, if the storage disk is mapped onto the Windows PC as drive Z, this mapping should be included in leginon.cfg. See below.

  • Configurations for all users and all local copy and installation of leginon (Recommended on the microscope computer since users are not expected to start the main processing here)
     <Global configuration directory>\leginon.cfg

    Example:

     C:\Programs\myami\leginon.cfg

  • The skeleton (default) configuration file is available at:
     C:\Python25\Lib\site-packages\leginon\leginon.cfg.template

Configure sinedon.cfg:

Follow instruction in Configure sinedon.cfg in the section for Linux installation but note the location of the configuration files follows.

  • (Recommanded on microscope computer) For all users, put sinedon.cfg in the global configuration directory such as
    C:\Programs\myami\sinedon.cfg
  • the skeleton sinedon configuration file is
    C:\Python25\Lib\site-packages\sinedon\examples\sinedon.cfg

Configure instruments.cfg:

  • A template for instruments.cfg is in the installed pyscope directory as "instruments.cfg.template". Copy it to
    C:\Programs\myami\instruments.cfg
  • Remove the Sim Tem and Sim Cam modules in the configuration.
  • Add the modules for your microscope and camera.
    • If you have Direct Electron camera DE12, your camera module.class is de.DE12
    • If your microscope uses Tecnai Scripting Interface, youe scope module.class is tecnai.Tecnai
    • If you have a Gatan camera that you interface through DigitalMicrograph, your camera module.class is gatan.Gatan
    • If you have a Tietz camera, there are several choices for the "class" field. Run the tietztest.py script that comes in pyscope to tell you your available options.

TEM

cs is the coefficient of spherical aberration in meters. Find out from TEM manufacture the proper value for your tem.
For example

[tem]
class: fei.Tecnai
cs: 2.0e-3

Camera

height and width are number of pixels based on the orientation presented in Leginon image viewer
  • Some Tietz camera may have an odd physical dimension. Use TCL/EMMenu program to find out the good dimension used in Tietz's own software and entered in this configuration.

For example

[camera]
class: gatan.Gatan
zplane: 50
height: 4096
width: 4096

zplane is a number that gives the order of camera. If a camera with low zplane value is going to acquire an image, Leginon will attempt to retract all cameras at higher zplane values.

HEIGHT and WIDTH are not shown in these examples for simplicity
  • One computer for both tem and digital camera:
    [tem]
    class: fei.Tecnai
    cs: 2.0e-3
    [camera]
    class: gatan.Gatan
    zplane: 50
    
  • Separate computers for the two instruments: configure only the instrument reside on the particular computer
    • On the computer that controls the tem:
      [tem]
      class: fei.Tecnai
      cs: 2.0e-3
      
    • On the computer that controls the digital camera:
      [camera]
      class: gatan.Gatan
      zplane: 50
      
  • Two camera at the same plane:
    • On the computer that controls the digital camera:

      DE12 and DE Survey camera are retract/extend together, with the survey camera at off-axis. Therefore zplane should be set at the same value
      For example,

      [camera1]
      class: de.DE12
      zplane: 50
      
      [camera2]
      class: de.DESurvey
      zplane: 50
      

  • Gatan Orius camera that is installed typically with Gatan K2/Falcon camera is technically on the same plane but is not capable of insertion unless K2 is retracted. On the other hand, K2 camera insertion includes a retraction of Orius at lower level of the function call in DM. Therefore, Orius is considered as a camera at lower zplane.
    [camera1]
    class: dmsem.GatanK2Base
    zplane: 50
    
    [camera2]
    class: dmsem.GatanOrius
    zplane: 49
    

The file contains other examples of microscope and camera drivers that we distribute from NRAMM.

Additional setup on Tietz cameras

Register the Tietz ping callback function. From a command line window:

cd C:\python25\Lib\Site-Packages\pyscope
C:\python25\python.exe tietzping.py

Troubleshooting Tietz cameras:

When Leginon initializes the camera, a program called CAMC4 should start automatically in the backgound. This is confirmed by the little camera icon showing up in the system tray in the lower right of the screen. Also, task manager can be started to confirm CAMC4 is running. Sometimes problems occur if more than one CAMC4 is running at the same time, so task manager will help identify this.

CAMC4 has its own configuration file "CAMC.ini" that will normally be set up already, but you can search for it on your computer and confirm that everything looks right. It will have configuration parameters for several cameras and only one of them will be activated. The only parameter that may need some adjustment is the readout geometry, which affects the rotation and mirror of the image.

If Leginon is not initializing the camera or not getting proper images, you should first test image acquisition using TVIPS software to make sure it is not a hardware issue. Use TCL or there is a test program called TestMFCCamera that can acquire an image and test the CAMC4 operation.

For strange dimension cameras

Some Tietz camera dimensions are slightly larger than a standard size, for example, 2084 x 2084 instead of the standard 2048 x 2048. Some software will have trouble dealing with these dimensions. It is recommended to force the camera to the lower standard size (some multiple of 2^n). Modify the function that gets camera dimension in tietz.py, gatan.py, or tia.py depending on which camera you are using.

  • Go to C:\Python25\Lib\site-packages\pyScope\
  • Edit tietz.py, gatan.py, or tia.py with a plain text editor
  • Find the function "getCameraSize" and replace its contents to force it to return a "hard coded" size. For example:
 def getCameraSize(self):
    return {'x': 2048, 'y': 2048}

Create Leginon Admin and Leginon Client shortcut in Start menu menu under Leginon

This instruction applies to Windows XP.

  • Go to C:\Documents and Settings\All Users\Start Menu\Programs\ and create a new
    folder named Leginon.
  • In another window, go to
    C:\Python25\Lib\site-packages\leginon
  • Create a shortcut from start-leginon.py as "Leginon Admin" and a shortcut from launcher.py as "Leginon Client".
  • Move the two shortcuts into
    C:\Documents and Settings\All Users\Start Menu\Programs\Leginon

Mapping Drives (Optional):

Although we don't recommend it, it is possible to run minimal Leginon directly on the Windows machine, Since the database and web servers are not there, you probably will be saving the images through a Samba server on a network drive also available to the Linux machine. If you do so, you will need to map the network drive. For example, if your Samba server has a hostname your_smbserver, and you have set up a share called [your_share_point] which points to /your_data_path/ and leginon data will be saved under a folder in /your_data_path/leginon/.

  • Start, My Computer
  • Tools menu, Map network drive
  • Use an unmapped drive such as Z:

    Enter shared path in Windows format as

    \\your_smbserver\your_share_point

  • Add the drive and the Linux path to leginon.cfg on the Windows machine as
    [Drive Mapping]
    Z:/your_data_path
  • Add image path to leginon.cfg on the Windows machine in Linux format as
    [Images]
    path:/your_data_path/leginon

Additional Software (Optional):

TightVNC (http://www.tightvnc.com) if you get tired of going into the microscope room just to open the column valves.

Gatan K2 Experimental support:


< Additional Database Server Setup | Steps needed for Installation Using Database Administration Tools >


Updated by Anchi Cheng about 11 years ago · 1 revisions