Home

PyCA Wiki

Welcome to the PyCA wiki!

Required / Optional Dependencies

Operating Systems

The build system uses CMake. The current required prerequisites are:

  • C++ Compiler (gcc preferred: see this commit if you have version 4.7+)
  • CMake 2.8+
  • SWIG 2.x
  • CUDA (any version)
  • Python (version 2.7 or lower: see Python/numpy Issues)
  • FFTW
  • boost headers and runtime
  • numpy (development version including headers required)

The following are optional:

  • matplotlib 1.1.1+ (for full functionality in PyCA.Display and reading / writing png images)
  • scipy (some additional image/linear algebra functionality)
  • ITK (for reading/writing image formats other than png)
  • Doxygen (for generating html documentation and python docstrings)

Building the library:

Clone the git repository:

git clone git@bitbucket.org:scicompanat/pyca.git [local directory to create]

If you omit the [local directory to create] it will just be cloned into a directory named 'pyca'. By default you will be on the latest development version. To check out a stable version, enter the source directory (cd pyca) and run git tag -l to see available versions, and check out the latest one. For example:

> cd pyca
> git tag -l
v0.00
v0.01
> git checkout v0.01
[some output here]
> cd ..

Next create a build directory and use cmake to configure the build:

mkdir pyca-bin
cd pyca-bin
ccmake ../pyca

Hit 'c' to perform initial configuration. The default install location (PYTHON_INSTALL_DIR) is ~/python/site-python. You can change this value if desired. If you want ITK support for reading / writing file formats and you've built ITK yourself (Note that ITK should be built with BUILD_SHARED_LIBS ON in order to enable the -fPIC flag), you may have to enter the build directory in the ITK_DIR entry. It's okay if CUDA_SDK_ROOT_DIR is not found. Press 'c' a few times until you get the 'g' (generate) option, then press 'g' to generate the build. You'll be dropped back to the shell, where you can build and install the project

make
make docstring
make install

Note that make docstring is optional and required Doxygen (this command inserts Doxygen documentation into python docstrings). Make sure your python path is set to your installation directory by running the following or adding it to your ~/.bashrc script

export PYTHONPATH=~/python/site-packages:${PYTHONPATH}

You can then run the examples in the Examples directory, e.g.

python ROFTV.py

Running testing:

From the Testing directory, all tests can be automatically discovered and run using unittest:

python -m unittest discover -v -p '*UnitTest.py'

This will just give a pass/fail status on each test. To run an individual test with graphical results, the tests can be run individually from within IPython, for example to run the test_Exp test from CpuGpuUnitTest:

import CpuGpuUnitTest as cgtest
cgtc = cgtest.CpuGpuTestCase()
cgtc.test_Exp(disp=True)

which will display the output of the test in matplotlib. For setup issues see the IPython notes page and matplotlib setup page

Tutorials and Web Documentation

We have web tutorials that are IPython notebooks

  • Introduction to Image3D and Field3D types (view / download)
  • Standard numerical operations (view / download)
  • Displaying (no tutorial yet)
  • I/O (no tutorial yet)
  • Difference operations/Gradients (no tutorial yet)
  • Applying deformations (no tutorial yet)
  • Memory Manager (no tutorial yet)
  • Multiscale Operations (no tutorial yet)
  • Filtering (no tutorial yet)

If you download the ipython, simply run

ipython notebook _TutorialName_.ipynb

on the downloaded tutorial and it will open an interactive session in your browser.

Running Examples

The examples in the Examples directory can be run simply as (for example running ROFTV.py):

python ROFTV.py

or from IPython:

%run  ROFTV.py

Note that these examples require matplotlib. For setup issues see the matplotlib setup page

Matplotlib Setup

See this page

IPython Notes

See this page

Changelog

v0.02

Developer Information

Windows support

Preliminary windows support is being actively developed. Check this wiki page for the latest status of PyCA on Windows.

Updated

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.