[Insight-users] Python ITK, minimum and maximum computation : Get a fish and learn to fish

Gaetan Lehmann gaetan.lehmann at jouy.inra.fr
Wed Apr 12 11:15:29 EDT 2006


Hi,

WrapITK comes with some functions to make common task like this one easier:

1> import itk

2> reader =  
itk.ImageFileReader.IUC3.New(FileName="/home/glehmann/analyse/granex/emb-01ZOOM.tif")

3> itk.range(reader)
3> (0, 255)


If you have applied the optional patches, you can use the "print" command  
on an ITK object. Without the optional patch, you can use itk.echo()  
function (print is a reserved word in python)

4> print reader
<snip>

5> itk.echo(reader)
<snip>


For more info, with ipython, the class name followed by "?" will display  
you the man page of the class

6> itk.ImageFileReader?

Or you can found more doc in the ITK doxygen pages:  
http://www.itk.org/Doxygen/html/hierarchy.html

Gaetan



On Wed, 12 Apr 2006 12:48:48 +0200, Vincent Page <vpage at univ-ag.fr> wrote:

> Hi,
> I would like to print the minimum and maximum
> of an image. It looks like
> "MinimumMaximumImageCalculator" would help.
>
> What I did is (whith a little help of the TAB with the interpreter)
>
> ------------------------------
>
> affiche = itk.MinimumMaximumImageCalculator.IF2.New(myFilter)
> affiche.Compute()
> affiche.Print()
> ------------------------------
>
> This doesn't work because of the Print method which takes two (?)  
> arguments
> (or one, the other probably being the name of the method....)
>
> So I had a look into the sources and found no Print method in the  
> MinimumMax... class.
> I guess it is inherited from elsewhere....
>
> So my questions :
> - How can I use this ?
> - Where can I find some docs, specially when playing with WrapITK and  
> python ?
>
> The Itk software Guide did not talk about the last 3 filters I needed,
> and I would like to find another solution than email constantly
> the insight-users list...
>
> Best regards,
>     Vincent.
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users



-- 
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66    fax: 01 34 65 29 09
http://voxel.jouy.inra.fr


More information about the Insight-users mailing list