Re: Sample Code Questions: \cytoseg\load_stack.py

7 views
Skip to first unread message

Rick Giuly

unread,
May 2, 2009, 10:13:29 PM5/2/09
to Tim Lu, Dave Deriso, cyt...@googlegroups.com
Hi Tim

Tim Lu wrote:
> Hey Rick,
>
> I started looking at a simple piece load_stack.py. I have a few questions.
>
> I can see that load_stack imports and uses stuff in
> cytoseg_classify.py. cytoseg_classify also imports things from a bunch
> of other files in the same directory (eg. statistics.py, cs.py,
> geometry.py, imod_tools.py, tree.py, etc...)...
>
> Q1: I see imports from "Image", "WX", "cPickle", etc. from cs.py. What
> are these these things? I don't see their py files in the directory.
> Are they libraries?

yes,

Image is the PIL python image processing library

wx is the wxpython library - sort of like Java's Swing library

cPickle is a module for saving python objects to disk

>
> Q2: I can find function definitions in most of these files. Is there a
> more systematic way to understand them? Right now I just search for
> definitions when I run into them. It's very slow and inefficient. Any
> higher-level documentation will be nice. (unless they are all
> user-defined, in which case there will naturally be none....)

eclipse has tools for finding definitions more easily I think - there's
a version of eclipse with pydev installed that comes with pythonxy -
this is what you want to use probably

>
> Q3: What are the libraries/sets that we use most often? Any "native
> functions?" I will go online to look for references. The Python book I
> checked out from the school library is not helping me right now....

numpy, itk, and opencv

check out "dive into python" ... it's an online book, pretty much

cheers

-rick

Rick Giuly

unread,
May 2, 2009, 10:24:40 PM5/2/09
to Tim Lu, Dave Deriso, cyt...@googlegroups.com

The python example scripts (which both itk and opencv have many of) are
a good place to start.

For itk you can download the whole thing and then look for a folder
called wrapitk to find the examples.

-rick

Reply all
Reply to author
Forward
0 new messages