User Tools

Site Tools


blogtng:2010-08-11:python_installation_notes_win32_xp

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
blogtng:2010-08-11:python_installation_notes_win32_xp [2010/08/11 15:30] – created kotablogtng:2010-08-11:python_installation_notes_win32_xp [2016/05/24 12:46] (current) – external edit 127.0.0.1
Line 43: Line 43:
  
 From the program menue, select IPython -> Pylab starts up a command line tool that shows From the program menue, select IPython -> Pylab starts up a command line tool that shows
-<quote>+<code>
 ********************************************************************** **********************************************************************
 Welcome to IPython. I will try to create a personal configuration directory Welcome to IPython. I will try to create a personal configuration directory
Line 67: Line 67:
 Please press <RETURN> to start IPython. Please press <RETURN> to start IPython.
  
-</quote>+</code>
  
 ==== Set up environmental variables in Win ==== ==== Set up environmental variables in Win ====
Line 82: Line 82:
 </code> </code>
 ... then get **errors**: ... then get **errors**:
-<quote>+<code>
 Running unit tests for numpy Running unit tests for numpy
  
Line 95: Line 95:
     raise ImportError(msg)     raise ImportError(msg)
 ImportError: Need nose >= 0.10.0 for tests - see http://somethingaboutorange.com/mrl/projects/nose ImportError: Need nose >= 0.10.0 for tests - see http://somethingaboutorange.com/mrl/projects/nose
-<<+</code>
 [[http://somethingaboutorange.com/mrl/projects/nose/0.11.2/|seems that I need to install another module called nose]] [[http://somethingaboutorange.com/mrl/projects/nose/0.11.2/|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 so download the file, unzip. From DOS prompt go into the folder \nose-0.11.2. Then
Line 104: Line 104:
 according to  according to 
   * http://answerpot.com/showthread.php?708617-%231550:+Memmap+test+failure   * http://answerpot.com/showthread.php?708617-%231550:+Memmap+test+failure
-<quote>+<code>
 I get the following test failure on all msvc9 builds of numpy 1.5.0.dev I get the following test failure on all msvc9 builds of numpy 1.5.0.dev
 for Windows. A patch is attached. for Windows. A patch is attached.
Line 119: Line 119:
 because it is being used by another process: because it is being used by another process:
 }}} }}}
-</quote>+</code>
  
 This seems to be already reported.  This seems to be already reported. 
-<quote>+<code>
 #1550: Memmap test failure #1550: Memmap test failure
 ----------------------+----------------------------------------------------- ----------------------+-----------------------------------------------------
Line 141: Line 141:
 Thanks, applied in r8606, r8607. Thanks, applied in r8606, r8607.
  
-</quote>+</code>
  
 for this error, some people say its not really problem: for this error, some people say its not really problem:
Line 147: Line 147:
 ... so maybe ignore for now and wait for the new release to include the fix above.   ... so maybe ignore for now and wait for the new release to include the fix above.  
  
-===== Test wiith matplotlib =====+==== Test wiith matplotlib ====
  
 http://matplotlib.sourceforge.net/ http://matplotlib.sourceforge.net/
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 (console) in Python ===
  
 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://math.nist.gov/javanumerics/jama/|JaMa]] (Java Matrix Package) 
 +  * [[https://java3d.dev.java.net/|Java3D]]  
 +  * see also [[http://math.nist.gov/javanumerics/#libraries|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: 
 +<code> 
 +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", ""
 +</code> 
 +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.1281540645.txt.gz · Last modified: 2016/05/24 12:46 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki