| import
ij.plugin.filter.PlugInFilter; |
| import
ij.ImagePlus; |
| import
ij.process.ImageProcessor; |
| import
org.python.util.PythonInterpreter; |
| public
class Invert_Filter
implements PlugInFilter { |
|
public int setup(String arg, ImagePlus imp) { |
| //Паведаміць ImageJ, што гэты плягін фільтр апрацоўвае толькі 8 біт выявы ў градацыях шэрага |
|
return DOES_8G; |
|
} |
|
public void run(ImageProcessor ip) { |
| //
create a Python interpreter |
|
PythonInterpreter py = new PythonInterpreter(); |
| //Перадаць працэсарам апрацоўкі выяваў бягучага малюнка на перакладчыка Python
|
|
py.set("ip", ip); |
| //Выкананне файлаў Python, які змяшчае зыходны код для гэтай ImageJ плягін фільтр |
|
py.execfile("C:\\ImageJ\\plugins\\Invert_Filter.py"); |
|
} |
| } |