@ElementWriterMetadata(name="SVG file", elementType=FileLinkElement.class, mimeType="image/svg+xml", processedType=RoisAlias.class, linkExt="svg") public class IJ1ROIsToSVGFileWriter extends Object implements ElementWriter<FileLinkElement,ij.gui.Roi[]>
Not compatible with TextRoi
or EllipseRoi
Modifier and Type | Field and Description |
---|---|
private String |
errorMessages |
private FileOutputStream |
fos |
Constructor and Description |
---|
IJ1ROIsToSVGFileWriter() |
Modifier and Type | Method and Description |
---|---|
private void |
applyDefaultStyles(XMLStreamWriter xsw)
Default SVG styling attributes for overlays
|
private void |
closeFile(XMLStreamWriter xsw)
End the SVG file and do cleanup
|
private XMLStreamWriter |
setupFile(String path,
int width,
int height,
String img)
Start the SVG file
|
void |
write(ij.gui.Roi[] data,
FileLinkElement elementToWrite)
Convert "processed" data to "underlying" data.
|
void |
write(ij.gui.Roi[] data,
String path) |
void |
write(ij.gui.Roi[] data,
String path,
int width,
int height) |
void |
write(ij.gui.Roi[] data,
String path,
int width,
int height,
String imgPath) |
private void |
writeFile(String path,
ij.gui.Roi[] rois,
int width,
int height,
String img)
Write the SVG file to
path |
private void |
writeLine(XMLStreamWriter xsw,
ij.gui.Line roi)
Write a Line ROI
|
private void |
writeOvalRoi(XMLStreamWriter xsw,
ij.gui.OvalRoi roi)
Write an OvalRoi
|
private void |
writeOverlay(XMLStreamWriter xsw,
ij.gui.Roi roi)
Write an overlay, if supported
|
private void |
writePointRoi(XMLStreamWriter xsw,
ij.gui.PointRoi roi)
Write a PointRoi
|
private void |
writePolygonRoi(XMLStreamWriter xsw,
ij.gui.PolygonRoi roi)
Write a PolygonRoi
|
private void |
writeRectangle(XMLStreamWriter xsw,
ij.gui.Roi roi)
Write a rectangular Roi
|
private void |
writeShapeRoi(XMLStreamWriter xsw,
ij.gui.ShapeRoi roi)
Write a ShapeRoi
|
private FileOutputStream fos
private String errorMessages
public void write(ij.gui.Roi[] data, FileLinkElement elementToWrite) throws SlideSetException
ElementWriter
write
in interface ElementWriter<FileLinkElement,ij.gui.Roi[]>
data
- The "processed" data.elementToWrite
- The DataElement
to
to which the data will be written.SlideSetException
public void write(ij.gui.Roi[] data, String path) throws SlideSetException
SlideSetException
public void write(ij.gui.Roi[] data, String path, int width, int height) throws SlideSetException
SlideSetException
public void write(ij.gui.Roi[] data, String path, int width, int height, String imgPath) throws SlideSetException
SlideSetException
private void writeFile(String path, ij.gui.Roi[] rois, int width, int height, String img) throws SlideSetException
path
SlideSetException
private XMLStreamWriter setupFile(String path, int width, int height, String img) throws SlideSetException
SlideSetException
private void closeFile(XMLStreamWriter xsw) throws SlideSetException
SlideSetException
private void writeOverlay(XMLStreamWriter xsw, ij.gui.Roi roi) throws SlideSetException
SlideSetException
private void writeLine(XMLStreamWriter xsw, ij.gui.Line roi) throws SlideSetException
SlideSetException
private void writeOvalRoi(XMLStreamWriter xsw, ij.gui.OvalRoi roi) throws SlideSetException
SlideSetException
private void writePointRoi(XMLStreamWriter xsw, ij.gui.PointRoi roi) throws SlideSetException
SlideSetException
private void writePolygonRoi(XMLStreamWriter xsw, ij.gui.PolygonRoi roi) throws SlideSetException
SlideSetException
private void writeShapeRoi(XMLStreamWriter xsw, ij.gui.ShapeRoi roi) throws SlideSetException
SlideSetException
private void writeRectangle(XMLStreamWriter xsw, ij.gui.Roi roi) throws SlideSetException
SlideSetException
private void applyDefaultStyles(XMLStreamWriter xsw) throws SlideSetException
SlideSetException
Copyright © 2023. All rights reserved.