@ALDAOperator(genericExecutionMode=ALL, level=APPLICATION) public class ImageWriterMTB extends MTBOperator implements loci.common.StatusReporter
ImageWriterMTB.runOp(..)
throws a special OverwriteException
in case that
the specified file already exists, but the overwrite-flag is set to false
.Modifier and Type | Field and Description |
---|---|
private Integer |
codec |
private String |
compression |
private de.unihalle.informatik.Alida.datatypes.ALDFileString |
fileName |
private Integer |
fps |
private boolean |
ignoreInvalidStackSpec |
private ij.ImagePlus |
inputImagePlus |
private MTBImage |
inputMTBImage |
private boolean |
overwrite |
private Integer |
quality |
private Vector<loci.common.StatusListener> |
statusListeners |
Constructor and Description |
---|
ImageWriterMTB() |
ImageWriterMTB(ij.ImagePlus imp,
String filename)
Image file output operator for ImagePlus objects.
|
ImageWriterMTB(MTBImage img,
String filename)
Image file output operator for MTBImage objects.
|
Modifier and Type | Method and Description |
---|---|
void |
addStatusListener(loci.common.StatusListener listener) |
HashMap<Integer,String> |
getAvailableCodecs()
Return available codecs for movie writers (see Bio-Formats package loci.formats.out.QTWriter)
represented by a hashmap.
|
String[] |
getAvailableCompression()
Get the available compression methods for the specified file format.
|
HashMap<Integer,String> |
getAvailableQualities()
Return available qualities for quicktime movie writers (see Bio-Formats package loci.formats.out.QTWriter)
represented by a hashmap.
|
Integer |
getCodec()
Get the codec (quicktime only)
|
String |
getCompression()
Get the compression type
|
String |
getFileName()
Get image filename
|
Integer |
getFps()
Get the frames per second for movie writers (*.avi,*.mov).
|
boolean |
getIgnoreInvalidStackSpecification()
Get the flag to ignore an invalid stack specification.
|
ij.ImagePlus |
getInputImagePlus()
Get ImagePlus that has to be stored to disk
|
MTBImage |
getInputMTBImage()
Get MTBImage that has to be stored to disk
|
boolean |
getOverwrite()
Get the overwrite permission flag
|
Integer |
getQuality()
Get the quality (quicktime only)
|
void |
notifyListeners(loci.common.StatusEvent event) |
protected void |
operate() |
protected Object |
readResolve()
Init function for deserialized objects.
|
void |
removeStatusListener(loci.common.StatusListener listener) |
void |
setCodec(Integer codec)
Set the codec (quicktime only).
|
void |
setCompression(String compression)
Set the compression type
|
void |
setFileName(String filename)
Set image filename
|
void |
setFps(Integer fps)
Set the frames per second for movie writers (*.avi,*.mov).
|
void |
setIgnoreInvalidStackSpecification(boolean ignore)
Set the flag to ignore an invalid stack specification.
|
void |
setInputImagePlus(ij.ImagePlus imp)
Set ImagePlus to store to disk
|
void |
setInputMTBImage(MTBImage img)
Set MTBImage to store to disk
|
void |
setOverwrite(boolean overwrite)
Set the overwrite permission flag
|
void |
setQuality(Integer quality)
Set the quality (quicktime only).
|
void |
validateCustom() |
protected void |
writeImagePlus(String filename,
ij.ImagePlus imp)
Write ImagePlus to disk
|
protected void |
writeMTBImage(String filename,
MTBImage img)
Write an MTBImage to disk
|
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, validateGeneric, writeHistory, writeHistory, writeHistory
private transient Vector<loci.common.StatusListener> statusListeners
@Parameter(label="Image compression", required=false, direction=IN, mode=ADVANCED, dataIOOrder=6, description="Image compression") private String compression
@Parameter(label="overwrite", required=true, direction=IN, mode=STANDARD, dataIOOrder=4, description="Overwrite permission flag") private boolean overwrite
@Parameter(label="Video codec", required=false, direction=IN, mode=ADVANCED, dataIOOrder=8, description="Video codec (quicktime only)") private Integer codec
@Parameter(label="Fps", required=false, direction=IN, mode=ADVANCED, dataIOOrder=7, description="Frames per second for movies") private Integer fps
@Parameter(label="Ignore stack specifications", required=true, direction=IN, mode=ADVANCED, dataIOOrder=5, description="Flag to ignore an invalid specification of the stack") private boolean ignoreInvalidStackSpec
@Parameter(label="Video quality", required=false, direction=IN, mode=ADVANCED, dataIOOrder=9, description="Video quality (quicktime only)") private Integer quality
@Parameter(label="Filename", required=true, direction=IN, mode=STANDARD, dataIOOrder=3, description="Image filename") private de.unihalle.informatik.Alida.datatypes.ALDFileString fileName
@Parameter(label="Input MTBImage", required=false, direction=IN, mode=STANDARD, dataIOOrder=1, description="MTBImage to save") private transient MTBImage inputMTBImage
@Parameter(label="Input ImagePlus", required=false, direction=IN, mode=STANDARD, dataIOOrder=2, description="ImagePlus to save") private transient ij.ImagePlus inputImagePlus
public ImageWriterMTB() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public ImageWriterMTB(MTBImage img, String filename) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
img
- image to write to diskfilename
- filename to write the image to. The extension specifies the output format.de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public ImageWriterMTB(ij.ImagePlus imp, String filename) throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
imp
- image to write to diskfilename
- filename to write the image to. The extension specifies the output format.de.unihalle.informatik.Alida.exceptions.ALDOperatorException
protected void operate() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException, OverwriteException
operate
in class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
OverwriteException
public void validateCustom() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
validateCustom
in class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
protected void writeMTBImage(String filename, MTBImage img) throws loci.common.services.DependencyException, loci.common.services.ServiceException, de.unihalle.informatik.Alida.exceptions.ALDOperatorException, RuntimeException, loci.formats.FormatException, IOException, ome.xml.model.enums.EnumerationException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
loci.common.services.DependencyException
loci.common.services.ServiceException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
RuntimeException
loci.formats.FormatException
IOException
ome.xml.model.enums.EnumerationException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
protected void writeImagePlus(String filename, ij.ImagePlus imp) throws RuntimeException, loci.formats.FormatException, IOException, loci.common.services.DependencyException, loci.common.services.ServiceException, ome.xml.model.enums.EnumerationException, de.unihalle.informatik.Alida.exceptions.ALDOperatorException, de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
RuntimeException
loci.formats.FormatException
IOException
loci.common.services.DependencyException
loci.common.services.ServiceException
ome.xml.model.enums.EnumerationException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDProcessingDAGException
public String[] getAvailableCompression() throws loci.formats.FormatException
loci.formats.FormatException
public HashMap<Integer,String> getAvailableCodecs() throws loci.formats.FormatException
loci.formats.FormatException
public HashMap<Integer,String> getAvailableQualities() throws loci.formats.FormatException
loci.formats.FormatException
public void setInputMTBImage(MTBImage img)
public MTBImage getInputMTBImage()
public void setInputImagePlus(ij.ImagePlus imp)
public ij.ImagePlus getInputImagePlus()
public void setFileName(String filename)
public String getFileName()
public void setCompression(String compression)
public String getCompression() throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
public void setQuality(Integer quality) throws loci.formats.FormatException
quality
- quicktime movie quality ID (see Bio-Formats package loci.formats.out.QTWriter)loci.formats.FormatException
public Integer getQuality()
public void setCodec(Integer codec) throws loci.formats.FormatException
codec
- the quicktime codec ID (see Bio-Formats package loci.formats.out.QTWriter)loci.formats.FormatException
public Integer getCodec()
public void setFps(Integer fps) throws loci.formats.FormatException
fps
- frames per second of the written movie file (fps must be larger 0, otherwise validation fails)loci.formats.FormatException
public Integer getFps()
public void setOverwrite(boolean overwrite)
public boolean getOverwrite()
public void setIgnoreInvalidStackSpecification(boolean ignore)
public boolean getIgnoreInvalidStackSpecification()
setIgnoreInvalidStackSpecification(.)
-method
for more explanationpublic void addStatusListener(loci.common.StatusListener listener)
addStatusListener
in interface loci.common.StatusReporter
public void notifyListeners(loci.common.StatusEvent event)
notifyListeners
in interface loci.common.StatusReporter
public void removeStatusListener(loci.common.StatusListener listener)
removeStatusListener
in interface loci.common.StatusReporter
protected Object readResolve()
MTBOperator
This function is called on an instance of this class being deserialized from file, prior to handing the instance over to the user. It takes care of a proper initialization of transient member variables as they are not initialized to the default values during deserialization.
readResolve
in class MTBOperator
Copyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.