Re: Threshold Segmentation in TrakEM2
Posted by
Albert Cardona-2 on
Dec 26, 2013; 1:45pm
URL: http://imagej.273.s1.nabble.com/Threshold-Segmentation-in-TrakEM2-tp5004623p5005989.html
2013/12/25 arjundayal <
[hidden email]>
> Hi Albert,
>
> Thank you very much for your help! I wrote Java code that creates an Area
> object out of the yellow areas. How do I proceed to add it to the active
> AreaList in TrakEM2? Is there anything simpler than using Jython to call my
> Java code?
>
> Thanks,
> Arjun
>
Arjun,
from java itself, or from jython: it doesn't matter.
From java you'd do, to add a specific Area to a Layer with id layer_id, to
all AreaList existing in the project:
import ini.trakem2.Project;
import ini.trakem2.display.*;
Project p = Project.getProjects().get(0);
LayerSet ls = p.getRootLayerSet();
Area a = ... ; // in world coordinates
long layer_id = ...;
for (AreaList ali : ls.getAll(AreaList.class)) {
Area local = new Area(a);
local.transform(ali.getAffineTransform());
ali.addArea(layer_id, local);
}
Hope the above helps.
Albert
--
http://albert.rierol.nethttp://www.ini.uzh.ch/~acardona/--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html