blogtng:2010-08-11:python_installation_notes_win32_xp
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
blogtng:2010-08-11:python_installation_notes_win32_xp [2010/08/11 15:35] – kota | blogtng:2010-08-11:python_installation_notes_win32_xp [2016/05/24 12:46] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 173: | Line 173: | ||
---> this does work as well. Shows a new window with plot. | ---> this does work as well. Shows a new window with plot. | ||
- | === Testing Command line interface in Python === | + | === Testing Command line interface |
In the bottom console, select “Pydev console” from “Open Console” icon. This will start up interactive python interpreter. | In the bottom console, select “Pydev console” from “Open Console” icon. This will start up interactive python interpreter. | ||
- | ==== Further trials | + | ==== 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. | ||
+ | * [[http:// | ||
+ | * [[https:// | ||
+ | * see also [[http:// | ||
+ | |||
+ | - Basic setting: In eclipse, [Window > Preference], | ||
+ | - Make a new pydev project by [File > New > Pydev project], Fill " | ||
+ | - 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 (" | ||
+ | - Right click the newly created project folder again, and select " | ||
+ | - 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(" | ||
+ | imp = blobs.createImagePlus() | ||
+ | ip = blobs.getProcessor().duplicate() | ||
+ | imp.setProcessor(" | ||
+ | imp.show() | ||
+ | ip.setThreshold(147, | ||
+ | IJ.run(imp, " | ||
+ | IJ.run(imp, " | ||
+ | </ | ||
+ | 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. | ||
- | Next Trials would be to use ImageJ from Eclipse-jython environment to see if it would be possible to interactively access IJ API. |
blogtng/2010-08-11/python_installation_notes_win32_xp.1281540906.txt.gz · Last modified: 2016/05/24 12:46 (external edit)