CMCI weblog
IJ macro syntax highlighter
ImageJ macro syntax highlighter is available with IJ_ED and Fiji Scripting Editor. Both are plugins for ImageJ. I have not seen IJ macro syntax highlighter with other available editors around, so I made one for Notepad++, a now famous text editor for Windows. Here is the download link for the configuration file.
http://cmci.embl.de/downloads/npp_syntaxhighlighter
I think it should be great also with Vim. I might prepare one as well later.
Running Fiji in EMBL Cluster
… seems to be currently not possible if downloadable Fiji linux-64 version is used. Building from source may be helpful, but Git is not available so building is not successful as well. So another trial would be (1) Install Git somewhere (2) then Build Fiji, with path to locally installed Git (3) then uses headless Fiji.
sub-master 18% ./fiji-linux64 ./fiji-linux64: /lib64/tls/libc.so.6: version `GLIBC_2.4' not found (required by ./fiji-linux64)
–> Solved, after installing Git and compiling using new server with CentOS5.5
Python Installation and Test Notes (Win32, XP)
Install Python.
- python-2.6.5.msi
downloaded from
by default, installed under C:\Python26
Then installing site-packages.
Install Numpy and Scipy
- numpy-1.5.0b1-win32-superpack-python2.6.exe
- scipy-0.8.0-win32-superpack-python2.6.exe
Both downloaded from the link in
Just clicking and executing.
Install matpotlib.
matplotlib-1.0.0.win32-py2.6.exe downloaded from link in http://matplotlib.sourceforge.net/
Install IPython
downloaded
- ipython-0.10.win32-setup.exe
from
and click to install.
check from IDLE:
IDLE 2.6.5 >>> import IPython >>> print IPython.__version__ 0.10 >>>
From the program menue, select IPython → Pylab starts up a command line tool that shows
********************************************************************** Welcome to IPython. I will try to create a personal configuration directory where you can customize many aspects of IPython's functionality in: C:\Documents and Settings\Miura\_ipython Initializing from configuration: C:\Python26\Lib\site-packages\IPython\UserConfi g Successful installation! Please read the sections 'Initial Configuration' and 'Quick Tips' in the IPython manual (there are both HTML and PDF versions supplied with the distribution) to make sure that your system environment is properly configured to take advantage of IPython's features. Important note: the configuration system has changed! The old system is still in place, but its setting may be partly overridden by the settings in "~/.ipython/ipy_user_conf.py" config file. Please take a look at the file if some of the new settings bother you. Please press <RETURN> to start IPython.
Set up environmental variables in Win
- new environmental variable “PYTHONPATH” and
C:\Python26;C:\Python26\Lib;C:\Python26\Lib\site-packages
- add follwoing path to PATH (for commandine)
C:\Python26
Test with the following code:
>>> import numpy, scipy >>> numpy.test()
… then get errors:
Running unit tests for numpy Traceback (most recent call last): File "<pyshell#1>", line 1, in <module> numpy.test() File "C:\Python26\Lib\site-packages\numpy\testing\nosetester.py", line 321, in test self._show_system_info() File "C:\Python26\Lib\site-packages\numpy\testing\nosetester.py", line 187, in _show_system_info nose = import_nose() File "C:\Python26\Lib\site-packages\numpy\testing\nosetester.py", line 69, in import_nose raise ImportError(msg) ImportError: Need nose >= 0.10.0 for tests - see http://somethingaboutorange.com/mrl/projects/nose
seems that I need to install another module called nose so download the file, unzip. From DOS prompt go into the folder \nose-0.11.2. Then
>C:\temp\nose-0.11.2>python setup.py install
according to
I get the following test failure on all msvc9 builds of numpy 1.5.0.dev for Windows. A patch is attached. {{{ ERROR: test_filename (test_memmap.TestMemmap) ---------------------------------------------------------------------- Traceback (most recent call last): File "X:\Python26-x64\lib\site- packages\numpy\core\tests\test_memmap.py", line 60, in test_filename os.unlink(tmpname) WindowsError: [Error 32] The process cannot access the file because it is being used by another process: }}}
This seems to be already reported.
#1550: Memmap test failure ----------------------+----------------------------------------------------- Reporter: cgohlke | Owner: somebody Type: defect | Status: closed Priority: normal | Milestone: 1.5.0 Component: Other | Version: devel Resolution: fixed | Keywords: ----------------------+----------------------------------------------------- Changes (by rgommers): * status: new => closed * resolution: => fixed Comment: Thanks, applied in r8606, r8607.
for this error, some people say its not really problem:
… so maybe ignore for now and wait for the new release to include the fix above.
Test wiith matplotlib
http://matplotlib.sourceforge.net/
from DOS command prompt
from pylab import * plot([1,2,3]) show()
this does work. Shows a new window with plot.
Using Pydev in Eclipse (helios)
Install Pydev
- Install using Help → Install new software.
Settings
set path to the python interpreter in C:\Python26. Then make a new project, and inside create a new python module.
using the same code as above, run the script
—> this does work as well. Shows a new window with plot.
Testing Command line interface (console) in Python
In the bottom console, select “Pydev console” from “Open Console” icon. This will start up interactive python interpreter.
Accessing ImageJ as Image Processing Library
Jython interpreter must be used instead of Python interpreter for accessing Java. For this, pydev installed in eclipse do the job. This is quite useful but the drawback is that one cannot use numpy and scipy. Instead, one should use java numerical libraries as recommended by Albert Cardona.
- JaMa (Java Matrix Package)
- see also a list of libraries
- Basic setting: In eclipse, [Window > Preference], collapse Pydev-Interpreter-Jython tee. If you see nothing listed in “Jython interpreter” field, then you need to set path to a jython interpreter. If you do not have one, you could download the latest from Jython project page (http://www.jython.org/). In my case, I pointed the reference to jython.jar within FIJI jar folder. Since FIJI has automatic updating function, this jar should be the latest one (Python2.5 comparable).
- Make a new pydev project by [File > New > Pydev project], Fill “Project name”, choose project type as Jython, and Grammer version 2.5, choose jython (this name is what you gave when you set the library path in 1.) from Interpreter drop down menu.
- Right click the newly created project folder and [new > pydev module]. In the creation panel, choose whatever the project name (could also be blank), fill Name of the module (“testjy” in this example) and Finish.
- Right click the newly created project folder again, and select “prpoperties”. Select Pydev-PYTHONPATH, select “external libraries” tab, and “Add zip/jar/egg” to set ij.jar as an external library.
- optional: to access lugins in ImageJ plugin folder, add that plugin class file or jar file in the library path as well.
Double clicking test.py will open the file in the editor window. COpy and paste the following:
from ij import IJ import ij.process.ImageProcessor as IP blobs = IJ.openImage("http://rsb.info.nih.gov/ij/images/blobs.gif") imp = blobs.createImagePlus() ip = blobs.getProcessor().duplicate() imp.setProcessor("blobs copy", ip) imp.show() ip.setThreshold(147, 147, IP.NO_LUT_UPDATE) IJ.run(imp, "Convert to Mask", "") IJ.run(imp, "Watershed", "")
save the file, right click the file in Pydeve Package view and select [Run as > Jython Run]. If segmented blob appears, then the setup is working.
To dynamically access jython-ij, set external library path in [window > preferences] interpreter-Jyton pane. Adding ij.jar in the library path will enable you to access jython just like in IDLE by clicking open console icon and selecting pydev console.
jsMath plugin installed
Installed jsMath plugin, for using tex code directly in this wiki. Some problems seems to appear with previous text with .htaccess codes, but will fix later.
further notes: 2010 Apr. 21
I initially used jsMath to show math equations but then realized that mathJax is more up-to-date module for doing this (mathJax actually is de facto jsMath2.0). I then switched to mathJax.
MathJax works well with Chrome when you view this page. But then soon I found out that this is possible with only Chrome, not with Firefox nor IE. Since most of people visiting this site use Firefox, I started to try configuring but did not work with many different trials… then finally I found a solution for Firefox; upgrade it. The problem I had in viewing math equation was occurring with version 3.0x (on win32), and this does not happen and works well when version 3.6.3 is used. It was as simple as that. without thoughts, I was thinking that “My Firefox should be pretty new”.
The problem I encountered seems to be due to difference in the web-font loading settings. With IE, one better try to use at least IE9. I have not tired this yet, and probably will not because I have not seen any visitor using IE these days.
By the way, if you want to test if your browser is enabled with viewing math equation in cmci.embl.de, click the link below to test if it is possible.
http://cmci.embl.de/mathjax/test/
note:20110526
a disadvantage after installing jsMath plugin is that the page loading became significantly slower than before.
FRAP manual updated
There is always some confusion when deriving Diffusion coefficient after Soumpasis fitting in FRAP, whether to use radius or diameter for the parameter “w”. As manual has been saying, this “w” is indeed radius, not diameter. I made a bit of stress on this part.