Commit c7a37911 authored by Stephane Dallongeville's avatar Stephane Dallongeville
Browse files

Updated for changes in Icy 2.1 (new exceptions on some methods)

parent d77abdbe
bin
pluginfile-roi-blocks*.jar
/*.jar
<?xml version="1.0" encoding="WINDOWS-1252" standalone="no"?>
<jardesc>
<jar path="RoiBlocks/RoiBlocks.jar"/>
<options buildIfNeeded="true" compress="true" descriptionLocation="/RoiBlocks/export.jardesc" exportErrors="false" exportWarnings="true" includeDirectoryEntries="true" overwrite="true" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
<storedRefactorings deprecationInfo="true" structuralOnly="false"/>
<selectedProjects/>
<manifest generateManifest="true" manifestLocation="/Icy-Kernel/META-INF/MANIFEST.MF" manifestVersion="1.0" reuseManifest="false" saveManifest="false" usesManifest="true">
<sealing sealJar="false">
<packagesToSeal/>
<packagesToUnSeal/>
</sealing>
</manifest>
<selectedElements exportClassFiles="true" exportJavaFiles="true" exportOutputFolder="false">
<javaElement handleIdentifier="=RoiBlocks/src"/>
</selectedElements>
</jardesc>
<?xml version="1.0" encoding="WINDOWS-1252" standalone="no"?>
<jardesc>
<jar path="RoiBlocks/RoiBlocks.jar"/>
<options buildIfNeeded="true" compress="true" descriptionLocation="/RoiBlocks/export.jardesc" exportErrors="false" exportWarnings="true" includeDirectoryEntries="true" overwrite="true" saveDescription="true" storeRefactorings="false" useSourceFolders="false"/>
<storedRefactorings deprecationInfo="true" structuralOnly="false"/>
<selectedProjects/>
<manifest generateManifest="true" manifestLocation="/Icy-Kernel/META-INF/MANIFEST.MF" manifestVersion="1.0" reuseManifest="false" saveManifest="false" usesManifest="true">
<sealing sealJar="false">
<packagesToSeal/>
<packagesToUnSeal/>
</sealing>
</manifest>
<selectedElements exportClassFiles="true" exportJavaFiles="true" exportOutputFolder="false">
<javaElement handleIdentifier="=RoiBlocks/src"/>
</selectedElements>
</jardesc>
/**
*
*/
package plugins.stef.roi.bloc.convert;
import icy.plugin.abstract_.Plugin;
import icy.plugin.interface_.PluginBundled;
import icy.plugin.interface_.PluginLibrary;
import icy.roi.ROI;
import icy.roi.ROIUtil;
import plugins.adufour.blocks.tools.roi.ROIBlock;
import plugins.adufour.blocks.util.VarList;
import plugins.adufour.vars.lang.VarDouble;
import plugins.adufour.vars.lang.VarROIArray;
import plugins.stef.roi.bloc.RoiBlocks;
/**
* Block to convert input ROI(s) to 2D ellipse type ROI(s) centered on the mass center.<br>
*
* @author Stephane
*/
public class ROIToEllipse extends Plugin implements ROIBlock, PluginLibrary, PluginBundled
{
protected final VarROIArray input;
protected final VarDouble radiusX;
protected final VarDouble radiusY;
protected final VarROIArray output;
public ROIToEllipse()
{
super();
input = new VarROIArray("Roi(s)");
radiusX = new VarDouble("Radius X", 1d);
radiusY = new VarDouble("Radius Y", 1d);
output = new VarROIArray("Ellipse roi(s)");
}
@Override
public void run()
{
final ROI[] rois = input.getValue();
final ROI[] result = new ROI[(rois != null) ? rois.length : 0];
final double rx = radiusX.getValue().doubleValue();
final double ry = radiusY.getValue().doubleValue();
if (rois != null)
{
for (int r = 0; r < rois.length; r++)
result[r] = ROIUtil.convertToEllipse(rois[r], rx, ry);
}
output.setValue(result);
}
@Override
public void declareInput(VarList inputMap)
{
inputMap.add("input", input);
inputMap.add("radiusX", radiusX);
inputMap.add("radiuxY", radiusY);
}
@Override
public void declareOutput(VarList outputMap)
{
outputMap.add("output", output);
}
@Override
public String getMainPluginClassName()
{
return RoiBlocks.class.getName();
}
}
/**
*
*/
package plugins.stef.roi.bloc.convert;
import icy.plugin.abstract_.Plugin;
import icy.plugin.interface_.PluginBundled;
import icy.plugin.interface_.PluginLibrary;
import icy.roi.ROI;
import icy.roi.ROIUtil;
import plugins.adufour.blocks.tools.roi.ROIBlock;
import plugins.adufour.blocks.util.VarList;
import plugins.adufour.vars.lang.VarDouble;
import plugins.adufour.vars.lang.VarROIArray;
import plugins.stef.roi.bloc.RoiBlocks;
/**
* Block to convert input ROI(s) to 2D ellipse type ROI(s) centered on the mass center.<br>
*
* @author Stephane
*/
public class ROIToEllipse extends Plugin implements ROIBlock, PluginLibrary, PluginBundled
{
protected final VarROIArray input;
protected final VarDouble radiusX;
protected final VarDouble radiusY;
protected final VarROIArray output;
public ROIToEllipse()
{
super();
input = new VarROIArray("Roi(s)");
radiusX = new VarDouble("Radius X", 1d);
radiusY = new VarDouble("Radius Y", 1d);
output = new VarROIArray("Ellipse roi(s)");
}
@Override
public void run()
{
final ROI[] rois = input.getValue();
final ROI[] result = new ROI[(rois != null) ? rois.length : 0];
final double rx = radiusX.getValue().doubleValue();
final double ry = radiusY.getValue().doubleValue();
try
{
if (rois != null)
{
for (int r = 0; r < rois.length; r++)
result[r] = ROIUtil.convertToEllipse(rois[r], rx, ry);
}
}
catch (InterruptedException e)
{
System.err.println("ROIToEllipse process interrupted !");
output.setValue(null);
return;
}
output.setValue(result);
}
@Override
public void declareInput(VarList inputMap)
{
inputMap.add("input", input);
inputMap.add("radiusX", radiusX);
inputMap.add("radiuxY", radiusY);
}
@Override
public void declareOutput(VarList outputMap)
{
outputMap.add("output", output);
}
@Override
public String getMainPluginClassName()
{
return RoiBlocks.class.getName();
}
}
/**
*
*/
package plugins.stef.roi.bloc.convert;
import java.util.ArrayList;
import java.util.List;
import icy.plugin.abstract_.Plugin;
import icy.plugin.interface_.PluginBundled;
import icy.plugin.interface_.PluginLibrary;
import icy.roi.ROI;
import icy.roi.ROIUtil;
import plugins.adufour.blocks.tools.roi.ROIBlock;
import plugins.adufour.blocks.util.VarList;
import plugins.adufour.vars.lang.VarROIArray;
import plugins.stef.roi.bloc.RoiBlocks;
/**
* Block to convert input ROI(s) to single point type ROI(s) representing the mass center.
*
* @author Stephane
*/
public class ROIToPoint extends Plugin implements ROIBlock, PluginLibrary, PluginBundled
{
protected final VarROIArray input;
protected final VarROIArray output;
public ROIToPoint()
{
super();
input = new VarROIArray("Roi(s)");
output = new VarROIArray("Point roi(s)");
}
@Override
public void run()
{
final ROI[] rois = input.getValue();
final List<ROI> result = new ArrayList<ROI>();
if (rois != null)
{
for (ROI roi : rois)
result.add(ROIUtil.convertToPoint(roi));
}
output.setValue(result.toArray(new ROI[result.size()]));
}
@Override
public void declareInput(VarList inputMap)
{
inputMap.add("input", input);
}
@Override
public void declareOutput(VarList outputMap)
{
outputMap.add("output", output);
}
@Override
public String getMainPluginClassName()
{
return RoiBlocks.class.getName();
}
}
/**
*
*/
package plugins.stef.roi.bloc.convert;
import java.util.ArrayList;
import java.util.List;
import icy.plugin.abstract_.Plugin;
import icy.plugin.interface_.PluginBundled;
import icy.plugin.interface_.PluginLibrary;
import icy.roi.ROI;
import icy.roi.ROIUtil;
import plugins.adufour.blocks.tools.roi.ROIBlock;
import plugins.adufour.blocks.util.VarList;
import plugins.adufour.vars.lang.VarROIArray;
import plugins.stef.roi.bloc.RoiBlocks;
/**
* Block to convert input ROI(s) to single point type ROI(s) representing the mass center.
*
* @author Stephane
*/
public class ROIToPoint extends Plugin implements ROIBlock, PluginLibrary, PluginBundled
{
protected final VarROIArray input;
protected final VarROIArray output;
public ROIToPoint()
{
super();
input = new VarROIArray("Roi(s)");
output = new VarROIArray("Point roi(s)");
}
@Override
public void run()
{
final ROI[] rois = input.getValue();
final List<ROI> result = new ArrayList<ROI>();
try
{
if (rois != null)
{
for (ROI roi : rois)
result.add(ROIUtil.convertToPoint(roi));
}
}
catch (InterruptedException e)
{
System.err.println("ROIToPoint process interrupted !");
output.setValue(null);
return;
}
output.setValue(result.toArray(new ROI[result.size()]));
}
@Override
public void declareInput(VarList inputMap)
{
inputMap.add("input", input);
}
@Override
public void declareOutput(VarList outputMap)
{
outputMap.add("output", output);
}
@Override
public String getMainPluginClassName()
{
return RoiBlocks.class.getName();
}
}
/**
*
*/
package plugins.stef.roi.bloc.convert;
import icy.plugin.abstract_.Plugin;
import icy.plugin.interface_.PluginBundled;
import icy.plugin.interface_.PluginLibrary;
import icy.roi.ROI;
import icy.roi.ROIUtil;
import plugins.adufour.blocks.tools.roi.ROIBlock;
import plugins.adufour.blocks.util.VarList;
import plugins.adufour.vars.lang.VarDouble;
import plugins.adufour.vars.lang.VarROIArray;
import plugins.stef.roi.bloc.RoiBlocks;
/**
* Block to convert input ROI(s) to 2D rectangle type ROI(s) centered on the mass center.<br>
*
* @author Stephane
*/
public class ROIToRectangle extends Plugin implements ROIBlock, PluginLibrary, PluginBundled
{
protected final VarROIArray input;
protected final VarDouble width;
protected final VarDouble height;
protected final VarROIArray output;
public ROIToRectangle()
{
super();
input = new VarROIArray("Roi(s)");
width = new VarDouble("Width", 1d);
height = new VarDouble("Height", 1d);
output = new VarROIArray("Rectangle roi(s)");
}
@Override
public void run()
{
final ROI[] rois = input.getValue();
final ROI[] result = new ROI[(rois != null) ? rois.length : 0];
final double w = width.getValue().doubleValue();
final double h = height.getValue().doubleValue();
if (rois != null)
{
for (int r = 0; r < rois.length; r++)
result[r] = ROIUtil.convertToRectangle(rois[r], w, h);
}
output.setValue(result);
}
@Override
public void declareInput(VarList inputMap)
{
inputMap.add("input", input);
inputMap.add("width", width);
inputMap.add("height", height);
}
@Override
public void declareOutput(VarList outputMap)
{
outputMap.add("output", output);
}
@Override
public String getMainPluginClassName()
{
return RoiBlocks.class.getName();
}
}
/**
*
*/
package plugins.stef.roi.bloc.convert;
import icy.plugin.abstract_.Plugin;
import icy.plugin.interface_.PluginBundled;
import icy.plugin.interface_.PluginLibrary;
import icy.roi.ROI;
import icy.roi.ROIUtil;
import plugins.adufour.blocks.tools.roi.ROIBlock;
import plugins.adufour.blocks.util.VarList;
import plugins.adufour.vars.lang.VarDouble;
import plugins.adufour.vars.lang.VarROIArray;
import plugins.stef.roi.bloc.RoiBlocks;
/**
* Block to convert input ROI(s) to 2D rectangle type ROI(s) centered on the mass center.<br>
*
* @author Stephane
*/
public class ROIToRectangle extends Plugin implements ROIBlock, PluginLibrary, PluginBundled
{
protected final VarROIArray input;
protected final VarDouble width;
protected final VarDouble height;
protected final VarROIArray output;
public ROIToRectangle()
{
super();
input = new VarROIArray("Roi(s)");
width = new VarDouble("Width", 1d);
height = new VarDouble("Height", 1d);
output = new VarROIArray("Rectangle roi(s)");
}
@Override
public void run()
{
final ROI[] rois = input.getValue();
final ROI[] result = new ROI[(rois != null) ? rois.length : 0];
final double w = width.getValue().doubleValue();
final double h = height.getValue().doubleValue();
try
{
if (rois != null)
{
for (int r = 0; r < rois.length; r++)
result[r] = ROIUtil.convertToRectangle(rois[r], w, h);
}
}
catch (InterruptedException e)
{
System.err.println("ROIToRectangle process interrupted !");
output.setValue(null);
return;
}
output.setValue(result);
}
@Override
public void declareInput(VarList inputMap)
{
inputMap.add("input", input);
inputMap.add("width", width);
inputMap.add("height", height);
}
@Override
public void declareOutput(VarList outputMap)
{
outputMap.add("output", output);
}
@Override
public String getMainPluginClassName()
{
return RoiBlocks.class.getName();
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment