End User Documentation

How to install LSMReader

Do in a terminal (as root):

#python setup.py install

to uninstall, delete the directory (e.g if you have python 2.5):

#rm -r /usr/lib/python2.5/site-packages/pyLSM

How to use LSMReader with the Graphical User Interface

To invoke the gui, you have to go in the folder where python istalled the module (on linux, with python version 2.5, it’s on /usr/lib/python2.5/site-packages/pyLSM) and do:

%python guiLSM.py

You will have a very simple user interface. To open a file, go to the file menu and choose open. Your file will be displayed. If you have several channel in your image, you can select to display one or the other with the buttons at the bottom of the image. If your image has several stacks, you can navigate throug the stacks with the scroll bar at the right to the image.

How to use LSMReader in command line

Invoke python in interactive mode with pylab to enable graphical output:

%ipython -pylab

To load an image, simply points the file you want to load.

>>> from pylsm import lsmreader
>>> imageFile = lsmreader.Lsmimage('lsmfile.lsm')
>>> imageFile.open()

To get the image data of the first channel :

>>> imageData=imageFile.get_image(stack=0,channel=0)

Of the second channel (if any) :

>>> imageData=imageFile.get_image(stack=0,channel=1)

To display the image :

>>> imshow(imageData)
>>> show()

If you have several stacks in the image, you access them with getImage method:

>>> imshow(imageFile.get_image(stack=4,channel=0))

To get the histogram of the image :

>>> [x,y]=imageFile.get_hist()
>>> plot(x,y)

To avoid all the pixels that have a value below than 1000 (for example).

>>> imageThresh=imageFile.getThreshold(1000)

This command will produce the same matrix as the one from get_image, but with a mask that prevent pixels below the threshold to be considered.

To get the size of each voxel :

>>> VX = imageFile.header['CZ LSM info']['Voxel Size X']
>>> VY = imageFile.header['CZ LSM info']['Voxel Size Y']
>>> VZ = imageFile.header['CZ LSM info']['Voxel Size Z']

And the image size (in pixel) :

>>> X = imageFile.header['CZ LSM info']['Dimension X']
>>> Y = imageFile.header['CZ LSM info']['Dimension Y']
>>> Z = imageFile.header['CZ LSM info']['Dimension Z']