Thanks! I had the exact same problem, adding the ITK_AUTOLOAD_PATH worked,
Anders


On Monday, 17 June 2013 06:10:40 UTC-7, Andy wrote:
>
> Hello,
>
> I just started to get into Python. As I want to create a small Python 
> script, which performs several calculation steps which are based on the 
> step before, I thought chaining some Modules like Connected Component 
> Segmentation should do the job.
>
> I tried to use the example code snippet from:
> http://www.orfeo-toolbox.org/CookBook/CookBooksu108.html
>
>
> import otbApplication 
>  
>
> ConnectedComponentSegmentation = otbApplication.Registry.CreateApplication
> ("ConnectedComponentSegmentation") 
> ConnectedComponentSegmentation.SetParameterString("in", "input.tif") 
> ConnectedComponentSegmentation.SetParameterString("mask", "b4<80 and 
> b5>0.05") 
> ConnectedComponentSegmentation.SetParameterString("expr", 
> "spectralAngle<0.1") 
> ConnectedComponentSegmentation.SetParameterInt("minsize", 1000) 
> #ConnectedComponentSegmentation.SetParameterString("obia", "") 
> ConnectedComponentSegmentation.SetParameterString("out", "output.shp") 
> ConnectedComponentSegmentation.ExecuteAndWriteOutput()
>
>
> which gives me the following error message:
>
> Traceback (most recent call last):
>   File "path/to/file/test.py", line 10, in <module>
>     ConnectedComponentSegmentation.SetParameterString("in", "input.tif") 
> AttributeError: 'NoneType' object has no attribute 'SetParameterString'
>
> I get the very same error message for every example I try which is 
> provided within the documentation. Therefore I suppose that there is some 
> configuration/installation error with the packages or I missed something. 
> Or did maybe the syntax change?
> (when i use the CLI with the defined parameters everything works just fine)
>
>
> *System:*
> Ubuntu 12.04 LTS 64bit
> eclipse 4.2.2 with PyDev
> Python 2.7.3
>
> *installed Packages from ubuntugis-unstable repository:*
> libotb3-dev
> libotb3.16
> otb-bin (3.16.0-0ppa~precise1)
> otb-bin-common (3.16.0-0ppa~precise1)
> otb-wrapping-common (1.12.0-0ppa~precise1)
> otb-wrapping-python (1.12.0-0ppa~precise1)
> (monteverdi) (1.14.0-0ppa~precise1)
> python-otb (3.16.0-0ppa~precise1)
>
> *Added following Paths:*
> /usr/lib/otb-wrapping/python
> /usr/lib/otb-wrapping/lib
> /usr/lib/otb/python
>
>
> Looking forward to feedback from you!
>
> Regards, 
> Andy
>

-- 
-- 
Check the OTB FAQ at
http://www.orfeo-toolbox.org/FAQ.html

You received this message because you are subscribed to the Google
Groups "otb-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/otb-users?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"otb-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to