@ALDAOperator(genericExecutionMode=NONE, level=STANDARD, allowBatchMode=false) public class RoiWriter extends MTBOperator
Note that only objects can be saved which implement the interface
MTBDataExportableToImageJROI
. Since the MiToBo data types
are converted to ImageJ data types it is not guaranteed that all
properties are preserved, but some information might get lost.
However, objects saved with this writer can be opened in any ImageJ
installation without requiring MiToBo to be installed.
Modifier and Type | Field and Description |
---|---|
private MTBDataExportableToImageJROI |
data
Data to save to file.
|
static String |
operatorID
Identifier string for this operator.
|
private de.unihalle.informatik.Alida.datatypes.ALDFileString |
outFile
Output file name.
|
Constructor and Description |
---|
RoiWriter()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
operate() |
private void |
savePolygon(ij.gui.PolygonRoi pr)
Saves the given polygon to the specified output file.
|
private void |
savePolygonSet(ij.gui.PolygonRoi[] prs)
Saves the set of polygons to the specified output file.
|
void |
setData(MTBDataExportableToImageJROI d)
Specify the data to save.
|
void |
setOutputFile(String file)
Specify the file where to save the data.
|
readResolve
addOperatorExecutionProgressEventListener, addParameter, addParameter, addParameterUnconditioned, fieldContained, fireOperatorExecutionProgressEvent, getALDPortHashAccessKey, getConstructionMode, getDocumentation, getHidingMode, getInactiveParameterNames, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterDescriptorUnconditioned, getParameterNames, getParameterUnconditioned, getSupplementalNames, getVerbose, getVersion, handleOperatorExecutionProgressEvent, hasInOutParameters, hasParameter, isAnnotatedParameter, isConfigured, print, print, print, printInterface, printInterface, readHistory, reinitializeParameterDescriptors, removeOperatorExecutionProgressEventListener, removeParameter, runOp, runOp, runOp, setConstructionMode, setConstructionMode, setConstructionMode, setHidingMode, setName, setParameter, setParameterUnconditioned, setVerbose, toStringVerbose, unconfiguredItems, validate, validateCustom, validateGeneric, writeHistory, writeHistory, writeHistory
public static final String operatorID
@Parameter(label="Data to save", required=true, dataIOOrder=0, direction=IN, description="Data.") private MTBDataExportableToImageJROI data
@Parameter(label="Output file", required=true, dataIOOrder=1, direction=IN, description="Output ROI file.") private de.unihalle.informatik.Alida.datatypes.ALDFileString outFile
public RoiWriter() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
- Thrown in case of failure.public void setOutputFile(String file)
Note that the name might be modified to meet ImageJ conventions, i.e., an ending '.roi' or '.zip' might be added.
file
- Filename where to save the data.public void setData(MTBDataExportableToImageJROI d)
d
- Data object.protected void operate() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
operate
in class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
private void savePolygon(ij.gui.PolygonRoi pr)
The output file written by this method contains a single polygon.
The code of this method in parts origins from the ImageJ source
code, for details see the method save()
in
https://imagej.nih.gov/ij/developer/source/ij/plugin/frame/RoiManager.java.html
pr
- Polygon to save.private void savePolygonSet(ij.gui.PolygonRoi[] prs)
The output file is a zip archive containing a set of ROIs.
The code of this method in parts origins from the ImageJ source
code, for details see the method save()
in
https://imagej.nih.gov/ij/developer/source/ij/plugin/frame/RoiManager.java.html
prs
- Set of polygons to save.Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.