Short Description

Define feature extraction function in Jython or CPython (through Exenet)

Documentation

Feature Extraction Function in python

Update: Support CPython

By using "Jython execnet for Icy", we now can write CPython code to do feature extraction. To using this feature,

you should install python and numpy.

 

To define a usable feature extraction function, you need to define a function named "process".
It should be defined like this:

def process(input, position):

output = input
# do something here with output

return output

 

FFT Example

from org.python.modules import jarray
from edu.emory.mathcs.jtransforms.fft import DoubleFFT_1D
from java.lang import Math
import copy

def process(input, position):
    size = len(input)
    output = copy.deepcopy(input)
    fft = DoubleFFT_1D(size)
    fft.realForward(output)
    for j in range(size/2):
        output[j]= Math.sqrt(Math.pow(output[2*j],2)+Math.pow(output[2*j+1],2));
    return output[:len(input)/2]

 

Template Library

In order to show the scripts in the library, you need to name the file with the pattern "CPython_XXXXXX.py" or "Jython_XXXXXX.py",
replace XXXXXX with your own name.

if your code is Jython code, you should use "Jython_XXXXXX.py" a naming rule, otherwise, you should use "CPython_XXXXXX.py".

 

Examples

https://github.com/evaimg/Icy-App/tree/master/scripts

Leave a Review

Leave a review
Cancel review
View full changelog
Close changelog

Changelog

  • Version 1.6.3.0 • Released on: 2014-08-27 16:25:48
    Download
    Description:

    * add coding string for cpython

  • Version 1.6.2.0 • Released on: 2014-08-26 07:01:45
    Download
    Description:

    * character '' escape

  • Version 1.6.0.0 • Released on: 2014-08-26 06:43:48
    Download
    Description:

    * Fixed bug in python code loading
    * shift work directory to ICY/scripts

  • Version 1.5.0.0 • Released on: 2014-08-22 11:03:27
    Download
    Description:

    * sync by swimming pool

  • Version 1.4.0.0 • Released on: 2014-08-21 16:53:38
    Download
    Description:

    * add traceback information display

  • Version 1.3.3.0 • Released on: 2014-08-21 15:01:38
    Download
    Description:

    * fixed initialization bug

  • Version 1.3.0.0 • Released on: 2014-08-21 13:50:37
    Download
    Description:

    * support CPython code through Execnet

  • Version 1.2.0.0 • Released on: 2014-08-20 11:38:11
    Download
    Description:

    * now we can load template from library located in ICY_ROOT/scripts, naming with the pattern "eva_XXXXX.py"

  • Version 1.1.0.0 • Released on: 2014-08-20 04:13:59
    Download
    Description:

    * add options to the engine

  • Version 0.0.1.0 • Released on: 2014-08-19 15:06:38
    Download