
Samuel Félix <sfelixjr@gmail.com> writes:
Hello Roland,
Hi,
It worked \o/ thx!!
You're welcome.
But, there is just a small problem...
trying to run the sps, I got:
samuel@beaver:/opt$ sps /usr/bin/python: can't open file '/lib/python2.6/dist-packages/sps.py': [Errno 2] No such file or directory
But I fixed that using a naive solution: I changed the /usr/local/bin/sps file by adding a prefix variable pointing to / usr/local like that:
prefix=/usr/local PYTHONPATH='${prefix}/lib/python2.6/dist-packages':"$PYTHONPATH" \ DYLD_LIBRARY_PATH='${prefix}/lib/python2.6/dist-packages:${exec_prefix}/lib' \ exec /usr/bin/python -i ${prefix}/lib/python2.6/dist-packages/sps.py "$@"
Yes, this is a bug, `prefix' is missing in sps. Sorry, I'll fix it.
well, after that I have swilena working :)
But, I got many other erros inside of swilena.. check that:
The Swilena Python Shell (sps). Type "help", "copyright", "credits" or "license" for more information on Python Type "example" for a short example. Type "quit()" or ^D (Ctrl-D) to quit.
import data Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.6/ihooks.py", line 406, in import_module q, tail = self.find_head_package(parent, str(name)) File "/usr/lib/python2.6/ihooks.py", line 442, in find_head_package q = self.import_it(head, qname, parent) File "/usr/lib/python2.6/ihooks.py", line 497, in import_it m = self.loader.load_module(fqname, stuff) File "/usr/lib/python2.6/ihooks.py", line 272, in load_module m = self.hooks.load_source(name, filename, file) File "/usr/lib/python2.6/ihooks.py", line 170, in load_source return imp.load_source(name, filename, file) File "/usr/local/lib/python2.6/dist-packages/data.py", line 24, in <module> top_srcdir = os.environ["top_srcdir"] File "/usr/lib/python2.6/UserDict.py", line 22, in __getitem__ raise KeyError(key) KeyError: 'top_srcdir'
You should not use module `data': it is wrongly installed by the current distribution (Olena 1.0); its sole purpose is to give access to data in the distribution (i.e., the file you extracted from the Olena tarball), not in the installed package, so that tests can use images from the distribution. You probably do not need it, by the way. `sps' imports the whole content of module `swilena', so you can use it directly: % ./sps The Swilena Python Shell (sps). Type "help", "copyright", "credits" or "license" for more information on Python Type "example" for a short example. Type "quit()" or ^D (Ctrl-D) to quit.
ima = image2d_int.image2d_int(3, 3) image2d_int.fill(ima, 42) image2d_int.println(ima) 42 42 42 42 42 42 42 42 42
Swilena is not stable.. is it?
Swilena is usable for a few things, but definitely not as stable as Milena. And its gives access to a very small part of Milena for the moment.
I was trying to find a CCT algorithm in olena... like Salambier, Winkinson, Berger, Menotti, Matas Najman... Do you know which of those I can find?
Milena (the core C++ library of Olena) provides routines to create min- and max-trees using a union-find-based algorithm. For instance, the following C++ code: ---------------------------------------------------------------------- #include <mln/core/image/image2d.hh> #include <mln/core/alias/neighb2d.hh> #include <mln/morpho/tree/max.hh> #include <mln/make/image2d.hh> #include <mln/debug/println.hh> int main() { using namespace mln; unsigned vals[] = { 5, 6, 6, 8, 9, 9, 8, 9, 9 }; image2d<unsigned> ima = make::image2d(vals); debug::println("ima =", ima); image2d<point2d> max_tree_parent = morpho::tree::max(ima, c4()); debug::println("max_tree_parent =", max_tree_parent); } ---------------------------------------------------------------------- gives: ---------------------------------------------------------------------- ima = 5 6 6 8 9 9 8 9 9 max_tree_parent = (0,0) (0,0) (0,1) (0,1) (1,0) (1,1) (1,0) (1,1) (1,1) ---------------------------------------------------------------------- However, Swilena wraps only very few data structures and algorithms at the moment, and the min- and max-tree are not part of it yet. I think wrapping them would not take a long time, so I'll give it a try ASAP. If you want, I can let you know when they're ready, either from the Git repository or as a snapshot tarball. Best regards, Roland -- Roland Levillain - LRDE/EPITA - A3SI/ESIEE/IGM/UMLV-Paris Est Laboratoire de Recherche et de Développement de l'EPITA (LRDE) 14-16, rue Voltaire - 94276 Le Kremlin-Bicêtre Cedex Tél. : 01 53 14 59 45 - Fax : 01 53 14 59 22 - www.lrde.epita.fr