Need help or advice ? Come to the Icy club ! - Every Wenesday morning from 9h30 to 12h30 - Francois Jacob Building - Main hall - Pasteur
Register

User reviews

This plugin is not rated yet


Please log-in to post a review

EvaFE In Python

by Wei Ouyang

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

Publication Id
ICY-P6O6A1
See technical details
View complete changelog

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