@@ -0,0 +1,1617 @@
+package org.nanes.slideset.dm.write;%0A%0Aimport ij.IJ;%0Aimport ij.ImagePlus;%0Aimport org.nanes.slideset.dm.FileLinkElement;%0Aimport org.nanes.slideset.dm.MIME;%0Aimport org.nanes.slideset.ex.ImgLinkException;%0Aimport org.nanes.slideset.ex.LinkNotFoundException;%0Aimport org.nanes.slideset.ex.SlideSetException;%0Aimport net.imagej.Dataset;%0Aimport java.io.File;%0Aimport org.scijava.Context;%0Aimport org.scijava.convert.ConvertService;%0A%0A/**%0A *%0A * @author Benjamin Nanes%0A */%0A@ElementWriterMetadata(%0A        name = %22PNG image file%22,%0A        elementType = FileLinkElement.class,%0A        mimeType = MIME.IMAGE,%0A        processedType = Dataset.class,%0A        linkExt = %22png%22 )%0Apublic class DatasetToPngFileWriter implements%0A        ElementWriter%3CFileLinkElement, Dataset%3E %7B%0A    %0A     public void write(Dataset data, FileLinkElement elementToWrite)%0A            throws SlideSetException %7B%0A        final Context context = data.getContext();%0A        String path = elementToWrite.getUnderlying();%0A        path = elementToWrite.getOwner().resolvePath(path);%0A        final File pathF = new File(path);%0A        if(!pathF.getParentFile().exists())%0A            try %7B%0A                pathF.getParentFile().mkdirs();%0A            %7D catch(Exception ex) %7B%0A                throw new LinkNotFoundException(%0A                        path + %22 could not be created.%22, ex);%0A            %7D%0A        ConvertService cs = context.getService(ConvertService.class);%0A        ImagePlus imp = cs.convert(data, ImagePlus.class);%0A        try %7B%0A            IJ.save(imp, path);%0A        %7D catch(Exception e) %7B%0A            throw new ImgLinkException(e);%0A        %7D%0A    %7D%0A    %0A%7D%0A

Add PNG file writer