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

Convert ROI to Detection and export to swimming pool

by stef / Stephane Dallongeville

This script converts the ROIs of the active Sequence in a set of detection (DetectionResults) and export it in the swimming pool so it can be used by the Spot Tracking plugin.

version 1 (last version):

download to use and modify in Icy. How do I use scripts ? A Problem ? ask the community.
Changelog for this version: initial version
importClass(Packages.icy.type.point.Point5D)
importClass(Packages.icy.swimmingPool.SwimmingObject)
importClass(Packages.icy.roi.ROI)
importClass(Packages.plugins.nchenouard.spot.DetectionResult)
importClass(Packages.plugins.nchenouard.spot.Spot)

seq = getSequence()

if (seq != null)
{
    dr = new DetectionResult()
    rois = seq.getROIs()
    
    for (i = 0; i < rois.size(); i++)
    {
    	roi = rois.get(i)
        pos = roi.getPosition5D()
        t = pos.getT()
        z = pos.getZ()

        if ((t < 0) || (t >= seq.getSizeT()))
            t = 0;
        if ((z < 0) || (z >= seq.getSizeZ()))
            z = 0;

	spot = new Spot(pos.getX(), pos.getY(), z)
        dr.addDetection(t, spot)
    }

    obj = new SwimmingObject(dr, "Detection results")
    gui.getSwimmingPool().add(obj)
}

This script has no documentation. A Problem ? ask the community.



Icy script publication Id : D3E4N2