Diferencia entre revisiones de «Tutorial Python Alex 19-10-12»

De Grupo de Inteligencia Computacional (GIC)
Sin resumen de edición
 
(No se muestran 49 ediciones intermedias de 2 usuarios)
Línea 1: Línea 1:
<nowiki>
<div id="Python Tutorial" class="note">
<html xmlns:tomboy="http://beatniksoftware.com/tomboy" xmlns:link="http://beatniksoftware.com/tomboy/link" xmlns:size="http://beatniksoftware.com/tomboy/size"><head><META http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Python Tutorial</title><style type="text/css">
       
body {  }
h1 { font-size: xx-large;
        font-weight: bold;
        border-bottom: 1px solid black; }
div.note {
  position: relative;
  display: block;
  padding: 5pt;
  margin: 5pt;
  white-space: -moz-pre-wrap; /* Mozilla */
        white-space: -pre-wrap;    /* Opera 4 - 6 */
        white-space: -o-pre-wrap;  /* Opera 7 */
        white-space: pre-wrap;      /* CSS3 */
        word-wrap: break-word;      /* IE 5.5+ */ }
</style></head><body><div class="note" id="Python Tutorial"><a name="python tutorial"></a><h1>Python Tutorial</h1>
- Alexandre Savio, October 19th, 2012


<span style="font-family:monospace">sudo apt-get install ipython python-numpy python-scipy python-mvpa2 python-setuptools python-matplotlib python-mvpa2-tutorialdata git python-pip python-nibabel
= Python Tutorial =


sudo pip install -U scikit-image scikit-learn statsmodels</span>
Author: Alex, October 19th, 2012


<ul><li dir="ltr"><b>Python</b><strike>
* '''Install the software'''
</strike><ul><li dir="ltr"><b>Hello World!</b>
Base OS: [http://www.ubuntu.com/ Ubuntu 12.04.1]
</li><li dir="ltr">Tutorials:
<ul><li dir="ltr"><a style="color:#3465A4" href="http://docs.python.org/tutorial/index.html">http://docs.python.org/tutorial/index.html</a>
</li><li dir="ltr"><a style="color:#3465A4" href="http://docs.python.org/tutorial/controlflow.html">http://docs.python.org/tutorial/controlflow.html</a>
</li><li dir="ltr"><a style="color:#3465A4" href="http://docs.python.org/tutorial/datastructures.html">http://docs.python.org/tutorial/datastructures.html</a>
</li><li dir="ltr"><a style="color:#3465A4" href="http://docs.python.org/tutorial/datastructures.html#looping-techniques">http://docs.python.org/tutorial/datastructures.html#looping-techniques</a>
</li><li dir="ltr"><a style="color:#3465A4" href="http://docs.python.org/tutorial/datastructures.html#dictionaries">http://docs.python.org/tutorial/datastructures.html#dictionaries</a></li></ul></li></ul></li></ul>


<ul><li dir="ltr"><b>IDEs</b>
For Ubuntu repository versions:
<ul><li dir="ltr"><a style="color:#3465A4" href="http://ipython.org">http://ipython.org</a>
<font face="monospace">
</li><li dir="ltr"><a style="color:#3465A4" href="http://code.google.com/p/pythonxy/">http://code.google.com/p/pythonxy/</a>
sudo apt-get install ipython python-numpy python-scipy python-mvpa2 python-matplotlib git python-pip python-nibabel cython python-statsmodels python-sklearn python-skimage
</li><li dir="ltr"><a style="color:#3465A4" href="http://spyder-ide.blogspot.com.es/">http://spyder-ide.blogspot.com.es/</a>
</font>
</li></ul></li><li dir="ltr">
</li><li dir="ltr"><b>Installing libraries</b>
<ul><li dir="ltr">Ubuntu repositories
</li><li dir="ltr"><a style="color:#3465A4" href="http://pypi.python.org/pypi">http://pypi.python.org/pypi</a></li></ul></li></ul>


<ul><li dir="ltr"><b>Numpy</b><strike>
For updated versions we can use [http://pypi.python.org/pypi Python Package Index (PyPI)]:
</strike><ul><li dir="ltr"><a style="color:#3465A4" href="http://numpy.scipy.org/">http://numpy.scipy.org/</a>
<font face="monospace">
</li><li dir="ltr"><a style="color:#3465A4" href="http://www.scipy.org/Tentative_NumPy_Tutorial">http://www.scipy.org/Tentative_NumPy_Tutorial</a>
sudo apt-get install python-pip python-dev build-essential
</li><li dir="ltr">Numpy for Matlab users
sudo pip install -U pip
<ul><li dir="ltr"><a style="color:#3465A4" href="http://www.scipy.org/NumPy_for_Matlab_Users">http://www.scipy.org/NumPy_for_Matlab_Users</a>
sudo pip install -U ipython
</li></ul></li><li dir="ltr">Tutorials:
sudo pip install -U cython
<ul><li dir="ltr"><a style="color:#3465A4" href="http://www.scipy.org/Tentative_NumPy_Tutorial#head-864862d3f2bb4c32f04260fac61eb4ef34788c4c">http://www.scipy.org/Tentative_NumPy_Tutorial#head-864862d3f2bb4c32f04260fac61eb4ef34788c4c</a>
sudo pip install -U numpy
</li><li dir="ltr"><a style="color:#3465A4" href="http://www.scipy.org/Tentative_NumPy_Tutorial#head-d55e594d46b4f347c20efe1b4c65c92779f06268">http://www.scipy.org/Tentative_NumPy_Tutorial#head-d55e594d46b4f347c20efe1b4c65c92779f06268</a>
sudo apt-get install build-essential gfortran libblas-dev liblapack-dev libumfpack5.4.0
</li><li dir="ltr"><a style="color:#3465A4" href="http://www.scipy.org/Tentative_NumPy_Tutorial#head-aa75ec76530ff51a2e98071adb7224a4b793519e">http://www.scipy.org/Tentative_NumPy_Tutorial#head-aa75ec76530ff51a2e98071adb7224a4b793519e</a></li></ul></li></ul></li></ul>
sudo pip install -U scipy  
sudo pip install -U pandas
sudo pip install -U scikit-image scikit-learn statsmodels
</font>


<ul><li dir="ltr"><b>Scipy</b>
Neuroimaging:
<ul><li dir="ltr"><a style="color:#3465A4" href="http://www.scipy.org/Cookbook">http://www.scipy.org/Cookbook</a>
[http://nipy.sourceforge.net/ Nipy]
</li><li dir="ltr"><a style="color:#3465A4" href="http://scipy-central.org/">http://scipy-central.org/</a>
<font face="monospace">
</li><li dir="ltr"><a style="color:#3465A4" href="http://docs.scipy.org/doc/scipy/reference/index.html">http://docs.scipy.org/doc/scipy/reference/index.html</a>
sudo pip install -U sympy
</li><li dir="ltr">Tutorials:
sudo pip install -U nibabel nipype nipy
<ul><li dir="ltr"><a style="color:#3465A4" href="http://www.scipy.org/Cookbook/Interpolation">http://www.scipy.org/Cookbook/Interpolation</a>
sudo pip install -U dipy nitime
</li><li dir="ltr"><a style="color:#3465A4" href="http://www.scipy.org/Cookbook/Watershed">http://www.scipy.org/Cookbook/Watershed</a>
</font>
</li><li dir="ltr"><a style="color:#3465A4" href="http://www.scipy.org/Cookbook/RadialBasisFunctions">http://www.scipy.org/Cookbook/RadialBasisFunctions</a>
</li><li dir="ltr"><a style="color:#3465A4" href="http://www.scipy.org/Cookbook/LinearRegression">http://www.scipy.org/Cookbook/LinearRegression</a></li></ul></li></ul></li></ul>


<ul><li dir="ltr"><b>Statistics and Pattern analysis</b>
<ul><li dir="ltr"><a style="color:#3465A4" href="http://pypi.python.org/pypi/statsmodels">http://pypi.python.org/pypi/statsmodels</a>
</li><li dir="ltr"><a style="color:#3465A4" href="http://docs.scipy.org/doc/scipy/reference/tutorial/stats.html">http://docs.scipy.org/doc/scipy/reference/tutorial/stats.html</a>
</li><li dir="ltr"><a style="color:#3465A4" href="http://www.pymvpa.org/">http://www.pymvpa.org/</a>
</li><li dir="ltr"><a style="color:#3465A4" href="http://www.shogun-toolbox.org/">http://www.shogun-toolbox.org/</a>
<ul><li dir="ltr"><a style="color:#3465A4" href="http://www.shogun-toolbox.org/doc/en/current/methods.html">http://www.shogun-toolbox.org/doc/en/current/methods.html</a>
</li></ul></li><li dir="ltr"><a style="color:#3465A4" href="http://scikit-learn.org/stable/">http://scikit-learn.org/stable/</a>
</li><li dir="ltr"><a style="color:#3465A4" href="http://scikits.appspot.com/scikits">http://scikits.appspot.com/scikits</a>
</li><li dir="ltr">Tutorial scipy.stats:
<ul><li dir="ltr"><a style="color:#3465A4" href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.ttest_ind.html#scipy.stats.ttest_ind">http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.ttest_ind.html#scipy.stats.ttest_ind</a>
</li><li dir="ltr"><a style="color:#3465A4" href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.pearsonr.html#scipy.stats.pearsonr">http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.pearsonr.html#scipy.stats.pearsonr</a>
</li></ul></li><li dir="ltr">Tutorial scikit-learn:
<ul><li dir="ltr"><a style="color:#3465A4" href="http://nisl.github.com/introduction.html">http://nisl.github.com/introduction.html</a>
</li><li dir="ltr"><a style="color:#3465A4" href="http://www.ehu.es/ccwintco/index.php/Hyperspectral_Remote_Sensing_Scenes">http://www.ehu.es/ccwintco/index.php/Hyperspectral_Remote_Sensing_Scenes</a>
</li><li dir="ltr"><a style="color:#3465A4" href="http://www.ehu.es/ccwintco/uploads/a/a3/Salinas_corrected.mat">http://www.ehu.es/ccwintco/uploads/a/a3/Salinas_corrected.mat</a>
</li><li dir="ltr"><a style="color:#3465A4" href="http://www.ehu.es/ccwintco/uploads/f/fa/Salinas_gt.mat">http://www.ehu.es/ccwintco/uploads/f/fa/Salinas_gt.mat</a>
</li><li dir="ltr"><a style="color:#3465A4" href="/home/alexandre/Dropbox/Documents/phd/work/salinas/sklearn_on_salinas.py">/home/alexandre/Dropbox/Documents/phd/work/salinas/sklearn_on_salinas.py</a></li></ul></li></ul></li></ul>


<ul><li dir="ltr"><b>Neuroimaging with Scikit-learn</b>
* '''Download the data'''
<ul><li dir="ltr"><a style="color:#3465A4" href="http://nisl.github.com/index.html">http://nisl.github.com/index.html</a>
***  [[Media:Python alex docs.zip | docs]]
</li><li dir="ltr"><a style="color:#3465A4" href="http://nisl.github.com/auto_examples/index.html">http://nisl.github.com/auto_examples/index.html</a>
***  [http://www.ehu.es/ccwintco/groupware/webdav.php/apps/phpbrain/648/nisl_data.tar.gz nisl_data.tar.gz]
</li><li dir="ltr">Tutorial:
***  [http://db.tt/e4oouc2R nisl_data.tar.gz]
<ul><li dir="ltr">cd ~
</li><li dir="ltr">git clone <a style="color:#3465A4" href="https://github.com/nisl/tutorial.git">https://github.com/nisl/tutorial.git</a>
</li><li dir="ltr">cd tutorial
</li><li dir="ltr">sudo python setup.py install
</li><li dir="ltr">ipython
</li><li dir="ltr"><a style="color:#3465A4" href="http://nisl.github.com/auto_examples/plot_ica_resting_state.html#example-tutorial-plot-ica-resting-state-py">http://nisl.github.com/auto_examples/plot_ica_resting_state.html#example-tutorial-plot-ica-resting-state-py</a></li></ul></li></ul></li></ul><strike>
</strike>
<ul><li dir="ltr"><b>Imaging</b>
<ul><li dir="ltr"><a style="color:#3465A4" href="http://docs.scipy.org/doc/scipy/reference/ndimage.html">http://docs.scipy.org/doc/scipy/reference/ndimage.html</a>
</li><li dir="ltr"><a style="color:#3465A4" href="http://www.pythonware.com/products/pil/">http://www.pythonware.com/products/pil/</a>
</li><li dir="ltr"><a style="color:#3465A4" href="http://scikit-image.org/">http://scikit-image.org/</a>
</li><li dir="ltr"><a style="color:#3465A4" href="http://opencv.willowgarage.com/wiki/">http://opencv.willowgarage.com/wiki/</a>
</li><li dir="ltr">Imagemagick API
</li><li dir="ltr">Nifti images: <a style="color:#3465A4" href="http://nipy.sourceforge.net/nibabel/">http://nipy.sourceforge.net/nibabel/</a>
</li><li dir="ltr">Tutorials:
<ul><li dir="ltr"><a style="color:#3465A4" href="http://scikit-image.org/docs/dev/auto_examples/plot_gabors_from_lena.html">http://scikit-image.org/docs/dev/auto_examples/plot_gabors_from_lena.html</a>
</li><li dir="ltr"><a style="color:#3465A4" href="http://scikit-image.org/docs/dev/auto_examples/plot_segmentations.html">http://scikit-image.org/docs/dev/auto_examples/plot_segmentations.html</a></li></ul></li></ul></li></ul>


<ul><li dir="ltr"><b>Hyperspectral Imaging</b>
* '''Python'''<strike> </strike>
<ul><li dir="ltr"><a style="color:#3465A4" href="http://www.orfeo-toolbox.org/otb/">http://www.orfeo-toolbox.org/otb/</a>
** [http://python.about.com/od/gettingstarted/ss/helloworld_all.htm '''Hello World!''']
</li><li dir="ltr"><a style="color:#3465A4" href="http://spectralpython.sourceforge.net/">http://spectralpython.sourceforge.net/</a></li></ul></li></ul>
** Tutorials:
*** [http://docs.python.org/tutorial/index.html <font color="#3465A4">http://docs.python.org/tutorial/index.html</font>]
*** [http://docs.python.org/tutorial/controlflow.html <font color="#3465A4">http://docs.python.org/tutorial/controlflow.html</font>]
*** [http://docs.python.org/tutorial/datastructures.html <font color="#3465A4">http://docs.python.org/tutorial/datastructures.html</font>]
*** [http://docs.python.org/tutorial/datastructures.html#looping-techniques <font color="#3465A4">http://docs.python.org/tutorial/datastructures.html#looping-techniques</font>]
*** [http://docs.python.org/tutorial/datastructures.html#dictionaries <font color="#3465A4">http://docs.python.org/tutorial/datastructures.html#dictionaries</font>]


<ul><li dir="ltr"><b>Interfaces with other softwares</b>
* '''IDEs'''
<ul><li dir="ltr"><a style="color:#3465A4" href="http://docs.scipy.org/doc/scipy/reference/io.html">http://docs.scipy.org/doc/scipy/reference/io.html</a>
** [http://ipython.org <font color="#3465A4">http://ipython.org</font>]
</li><li dir="ltr"><a style="color:#3465A4" href="http://forge.scilab.org/index.php/p/sciscipy/">http://forge.scilab.org/index.php/p/sciscipy/</a>
** [http://www.sagemath.org/ <font color="#3465A4">Sage</font>]
</li><li dir="ltr"><a style="color:#3465A4" href="http://rpy.sourceforge.net/rpy2.html">http://rpy.sourceforge.net/rpy2.html</a></li></ul></li></ul>
** [http://code.google.com/p/pythonxy/ <font color="#3465A4">http://code.google.com/p/pythonxy/</font>]
** [http://spyder-ide.blogspot.com.es/ <font color="#3465A4">http://spyder-ide.blogspot.com.es</font>]
** [http://eric-ide.python-projects.org/ Eric Python IDE]
** [http://www.reinteract.org/addons.html Reinteract]


<ul><li dir="ltr"><b>Plotting</b>
How to install a few of them:
<ul><li dir="ltr"><a style="color:#3465A4" href="http://matplotlib.org/">http://matplotlib.org/</a>
<font face="monospace">
</li><li dir="ltr"><a style="color:#3465A4" href="http://code.enthought.com/projects/mayavi/">http://code.enthought.com/projects/mayavi/</a>
sudo apt-get install ipython
</li><li dir="ltr"><a style="color:#3465A4" href="http://cairoplot.sourceforge.net">http://cairoplot.sourceforge.net</a>
sudo apt-get install ipython-qtconsole
</li><li dir="ltr"><a style="color:#3465A4" href="http://luke.campagnola.me/code/pyqtgraph/">http://luke.campagnola.me/code/pyqtgraph/</a></li></ul></li></ul>
sudo apt-get install spyder
sudo apt-get install eric
sudo apt-get install reinteract
</font>


<ul><li dir="ltr"><b>Others</b>
* '''Installing libraries'''
<ul><li dir="ltr"><a style="color:#3465A4" href="http://igraph.sourceforge.net/">http://igraph.sourceforge.net/</a>
** Ubuntu repositories
</li><li dir="ltr"><a style="color:#3465A4" href="http://networkx.lanl.gov/">http://networkx.lanl.gov/</a>
** [http://pypi.python.org/pypi <font color="#3465A4">http://pypi.python.org/pypi</font>]
</li><li dir="ltr"><a style="color:#3465A4" href="http://nltk.org/">http://nltk.org/</a>
</li><li dir="ltr"><a style="color:#3465A4" href="http://sympy.org/en/index.html">http://sympy.org/en/index.html</a></li></ul></li></ul>


<ul><li dir="ltr"><b>Cleanup before leaving... ?</b></li></ul>
* '''Numpy'''<strike> </strike>
sudo pip uninstall nisl
** [http://numpy.scipy.org/ <font color="#3465A4">http://numpy.scipy.org/</font>]
rm -r <a style="color:#3465A4" href="~/tutorial">~/tutorial</a>
** [http://www.scipy.org/Tentative_NumPy_Tutorial <font color="#3465A4">http://www.scipy.org/Tentative_NumPy_Tutorial</font>]
** Numpy for Matlab users
*** [http://www.scipy.org/NumPy_for_Matlab_Users <font color="#3465A4">http://www.scipy.org/NumPy_for_Matlab_Users</font>]
** Tutorials:
*** [http://www.scipy.org/Tentative_NumPy_Tutorial#head-864862d3f2bb4c32f04260fac61eb4ef34788c4c <font color="#3465A4">http://www.scipy.org/Tentative_NumPy_Tutorial#head-864862d3f2bb4c32f04260fac61eb4ef34788c4c</font>]
*** [http://www.scipy.org/Tentative_NumPy_Tutorial#head-d55e594d46b4f347c20efe1b4c65c92779f06268 <font color="#3465A4">http://www.scipy.org/Tentative_NumPy_Tutorial#head-d55e594d46b4f347c20efe1b4c65c92779f06268</font>]
*** [http://www.scipy.org/Tentative_NumPy_Tutorial#head-aa75ec76530ff51a2e98071adb7224a4b793519e <font color="#3465A4">http://www.scipy.org/Tentative_NumPy_Tutorial#head-aa75ec76530ff51a2e98071adb7224a4b793519e</font>]


</div></body></html>
* '''Scipy'''
</nowiki>
** [http://www.scipy.org/Cookbook <font color="#3465A4">http://www.scipy.org/Cookbook</font>]
** [http://scipy-central.org/ <font color="#3465A4">http://scipy-central.org/</font>]
** [http://docs.scipy.org/doc/scipy/reference/index.html <font color="#3465A4">http://docs.scipy.org/doc/scipy/reference/index.html</font>]
** Tutorials:
*** [http://www.scipy.org/Cookbook/Interpolation <font color="#3465A4">http://www.scipy.org/Cookbook/Interpolation</font>]
*** [http://www.scipy.org/Cookbook/Watershed <font color="#3465A4">http://www.scipy.org/Cookbook/Watershed</font>]
*** [http://www.scipy.org/Cookbook/RadialBasisFunctions <font color="#3465A4">http://www.scipy.org/Cookbook/RadialBasisFunctions</font>]
*** [http://www.scipy.org/Cookbook/LinearRegression <font color="#3465A4">http://www.scipy.org/Cookbook/LinearRegression</font>]
 
* '''Statistics and Pattern analysis'''
** [http://pypi.python.org/pypi/statsmodels <font color="#3465A4">http://pypi.python.org/pypi/statsmodels</font>]
** [http://docs.scipy.org/doc/scipy/reference/tutorial/stats.html <font color="#3465A4">http://docs.scipy.org/doc/scipy/reference/tutorial/stats.html</font>]
** [http://www.pymvpa.org/ <font color="#3465A4">http://www.pymvpa.org/</font>]
** [http://www.shogun-toolbox.org/ <font color="#3465A4">http://www.shogun-toolbox.org/</font>]
*** [http://www.shogun-toolbox.org/doc/en/current/methods.html <font color="#3465A4">http://www.shogun-toolbox.org/doc/en/current/methods.html</font>]
** [http://scikit-learn.org/stable/ <font color="#3465A4">http://scikit-learn.org/stable/</font>]
** [http://scikits.appspot.com/scikits <font color="#3465A4">http://scikits.appspot.com/scikits</font>]
** Tutorial scipy.stats:
*** [http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.ttest_ind.html#scipy.stats.ttest_ind <font color="#3465A4">http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.ttest_ind.html#scipy.stats.ttest_ind</font>]
*** [http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.pearsonr.html#scipy.stats.pearsonr <font color="#3465A4">http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.pearsonr.html#scipy.stats.pearsonr</font>]
** Tutorial scikit-learn:
'''Download data:'''
[http://www.ehu.es/ccwintco/index.php/Hyperspectral_Remote_Sensing_Scenes <font color="#3465A4">http://www.ehu.es/ccwintco/index.php/Hyperspectral_Remote_Sensing_Scenes</font>]
[http://www.ehu.es/ccwintco/uploads/a/a3/Salinas_corrected.mat <font color="#3465A4">http://www.ehu.es/ccwintco/uploads/a/a3/Salinas_corrected.mat</font>]
[http://www.ehu.es/ccwintco/uploads/f/fa/Salinas_gt.mat <font color="#3465A4">http://www.ehu.es/ccwintco/uploads/f/fa/Salinas_gt.mat</font>]
sklearn_on_salinas.py in zip file
 
* '''Neuroimaging with Scikit-learn'''
** [http://nisl.github.com/index.html <font color="#3465A4">http://nisl.github.com/index.html</font>]
** [http://nisl.github.com/auto_examples/index.html <font color="#3465A4">http://nisl.github.com/auto_examples/index.html</font>]
** Tutorial:
<font face="monospace">
  $ git clone [https://github.com/nisl/tutorial.git <font color="#3465A4">https://github.com/nisl/tutorial.git</font>]
  $ cd tutorial
  $ sudo python setup.py install
  $ ipython
  [http://nisl.github.com/auto_examples/plot_ica_resting_state.html#example-tutorial-plot-ica-resting-state-py <font color="#3465A4">http://nisl.github.com/auto_examples/plot_ica_resting_state.html#example-tutorial-plot-ica-resting-state-py</font>]
</font>
 
<strike> </strike>
 
* '''Imaging'''
** [http://docs.scipy.org/doc/scipy/reference/ndimage.html <font color="#3465A4">http://docs.scipy.org/doc/scipy/reference/ndimage.html</font>]
** [http://www.pythonware.com/products/pil/ <font color="#3465A4">http://www.pythonware.com/products/pil/</font>]
** [http://scikit-image.org/ <font color="#3465A4">http://scikit-image.org/</font>]
** [http://opencv.willowgarage.com/wiki/ <font color="#3465A4">http://opencv.willowgarage.com/wiki/</font>]
** Imagemagick API
** Nifti images: [http://nipy.sourceforge.net/nibabel/ <font color="#3465A4">http://nipy.sourceforge.net/nibabel/</font>]
** Tutorials:
*** [http://scikit-image.org/docs/dev/auto_examples/plot_gabors_from_lena.html <font color="#3465A4">http://scikit-image.org/docs/dev/auto_examples/plot_gabors_from_lena.html</font>]
*** [http://scikit-image.org/docs/dev/auto_examples/plot_segmentations.html <font color="#3465A4">http://scikit-image.org/docs/dev/auto_examples/plot_segmentations.html</font>]
 
* '''Hyperspectral Imaging'''
** [http://www.orfeo-toolbox.org/otb/ <font color="#3465A4">http://www.orfeo-toolbox.org/otb/</font>]
** [http://spectralpython.sourceforge.net/ <font color="#3465A4">http://spectralpython.sourceforge.net/</font>]
 
* '''Interfaces with other softwares'''
** [http://docs.scipy.org/doc/scipy/reference/io.html <font color="#3465A4">http://docs.scipy.org/doc/scipy/reference/io.html</font>]
** [http://forge.scilab.org/index.php/p/sciscipy/ <font color="#3465A4">http://forge.scilab.org/index.php/p/sciscipy/</font>]
** [http://rpy.sourceforge.net/rpy2.html <font color="#3465A4">http://rpy.sourceforge.net/rpy2.html</font>]
** [http://www.boost.org/doc/libs/1_51_0/libs/python/doc/index.html Boost.python]
** [http://cython.org/ <font color="#3465A4">http://cython.org/</font>]
 
* '''Plotting'''
** [http://matplotlib.org/ <font color="#3465A4">http://matplotlib.org/</font>]
** [http://code.enthought.com/projects/mayavi/ <font color="#3465A4">http://code.enthought.com/projects/mayavi/</font>]
** [http://cairoplot.sourceforge.net <font color="#3465A4">http://cairoplot.sourceforge.net</font>]
** [http://luke.campagnola.me/code/pyqtgraph/ <font color="#3465A4">http://luke.campagnola.me/code/pyqtgraph/</font>]
 
* '''Others'''
** [http://igraph.sourceforge.net/ <font color="#3465A4">http://igraph.sourceforge.net/</font>]
** [http://networkx.lanl.gov/ <font color="#3465A4">http://networkx.lanl.gov/</font>]
** [http://nltk.org/ <font color="#3465A4">http://nltk.org/</font>]
** [http://sympy.org/en/index.html <font color="#3465A4">http://sympy.org/en/index.html</font>]
** Machine Learning, Stephen Marsland: link, book, python source code
 
* '''Added later'''
** [http://www.pymvpa.org/ PyMVPA]
** [http://scikit-learn.org/stable/ scikit-learn]
** [http://statsmodels.sourceforge.net/ scikit-statsmodels]
** [http://scikit-image.org/ scikit-image]
** [http://pybrain.org/pages/features PyBrain]
** [http://mlpy.sourceforge.net/ mlpy]
** [http://pyml.sourceforge.net/index.html PyML]
** [http://luispedro.org/software/pymorph pymorph]
** [http://luispedro.org/software/mahotas mahotas]
 
 
* '''Cleanup before leaving... ?'''
<font face="monospace">
sudo pip uninstall nisl
rm -r tutorial
</font>

Revisión actual - 17:06 21 nov 2012

Python Tutorial

Author: Alex, October 19th, 2012

  • Install the software
Base OS: Ubuntu 12.04.1

For Ubuntu repository versions:


sudo apt-get install ipython python-numpy python-scipy python-mvpa2 python-matplotlib git python-pip python-nibabel cython python-statsmodels python-sklearn python-skimage

For updated versions we can use Python Package Index (PyPI):


sudo apt-get install python-pip python-dev build-essential 
sudo pip install -U pip
sudo pip install -U ipython
sudo pip install -U cython
sudo pip install -U numpy 
sudo apt-get install build-essential gfortran libblas-dev liblapack-dev libumfpack5.4.0
sudo pip install -U scipy 
sudo pip install -U pandas
sudo pip install -U scikit-image scikit-learn statsmodels

Neuroimaging:

Nipy

sudo pip install -U sympy
sudo pip install -U nibabel nipype nipy
sudo pip install -U dipy nitime


How to install a few of them:


sudo apt-get install ipython
sudo apt-get install ipython-qtconsole
sudo apt-get install spyder
sudo apt-get install eric
sudo apt-get install reinteract

Download data:

http://www.ehu.es/ccwintco/index.php/Hyperspectral_Remote_Sensing_Scenes
http://www.ehu.es/ccwintco/uploads/a/a3/Salinas_corrected.mat
http://www.ehu.es/ccwintco/uploads/f/fa/Salinas_gt.mat
sklearn_on_salinas.py in zip file

 $ git clone https://github.com/nisl/tutorial.git
 $ cd tutorial
 $ sudo python setup.py install
 $ ipython
 http://nisl.github.com/auto_examples/plot_ica_resting_state.html#example-tutorial-plot-ica-resting-state-py


  • Cleanup before leaving... ?

sudo pip uninstall nisl 
rm -r tutorial