regular expression in ImageJ

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

regular expression in ImageJ

chen li
Hi all,

Is it possible to use regular expression in ImageJ
macro?

What I try to do is to read a file in txt format line
by line and split a line if it contains  a word such
as "Count", then put the second column into a new
array.


Thanks,

Li


      ____________________________________________________________________________________
Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  http://tools.search.yahoo.com/newsearch/category.php?category=shopping
Reply | Threaded
Open this post in threaded view
|

Re: regular expression in ImageJ

Albert Cardona
Chen,

You can do regular expressions from a jython script instead.
See the jython interpreter and utilities for ImageJ:

http://www.mcdb.ucla.edu/research/hartenstein/acardona/software.html#ImageJ%20Jython%20Interpreter


To get it running, you need to:
- install Jython somewhere in your system
- put the jython.jar into ImageJ's classpath
- create a "Jython" folder under plugins folder.


See also the jython language, which is essentially Python with access to
all java classes and methods:

http://www.jython.org


Specifically for regular expression, you can either use python-like
style (as built in into jython) or directly the java classes to do it.


Albert

--
Albert Cardona
http://www.mcdb.ucla.edu/Research/Hartenstein/acardona
Reply | Threaded
Open this post in threaded view
|

Re: regular expression in ImageJ

chen li
Hi Albert,

I am not familiar with Jpythod script. I would like to
sovle it using Ruby.

LI
--- Albert Cardona <[hidden email]> wrote:

> Chen,
>
> You can do regular expressions from a jython script
> instead.
> See the jython interpreter and utilities for ImageJ:
>
>
http://www.mcdb.ucla.edu/research/hartenstein/acardona/software.html#ImageJ%20Jython%20Interpreter

>
>
> To get it running, you need to:
> - install Jython somewhere in your system
> - put the jython.jar into ImageJ's classpath
> - create a "Jython" folder under plugins folder.
>
>
> See also the jython language, which is essentially
> Python with access to
> all java classes and methods:
>
> http://www.jython.org
>
>
> Specifically for regular expression, you can either
> use python-like
> style (as built in into jython) or directly the java
> classes to do it.
>
>
> Albert
>
> --
> Albert Cardona
>
http://www.mcdb.ucla.edu/Research/Hartenstein/acardona
>



      ____________________________________________________________________________________
Never miss a thing.  Make Yahoo your home page.
http://www.yahoo.com/r/hs
Reply | Threaded
Open this post in threaded view
|

Re: regular expression in ImageJ

vischer
v1.39r supports regex:

matches(string, regex)
Returns true if string matches the specified regular expression.
Norbert
Reply | Threaded
Open this post in threaded view
|

Re: regular expression in ImageJ

chen li
Thank you,

Li
--- norbert <[hidden email]> wrote:

> v1.39r supports regex:
>
> matches(string, regex)
> Returns true if string matches the specified regular
> expression.
> Norbert
>



      ____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ