@@ -0,0 +1,2212 @@
+package edu.emory.cellbio.ijbat.dm;%0A%0Aimport edu.emory.cellbio.ijbat.SlideSet;%0Aimport edu.emory.cellbio.ijbat.ex.ImgLinkException;%0Aimport edu.emory.cellbio.ijbat.ex.LinkNotFoundException;%0Aimport edu.emory.cellbio.ijbat.ex.SlideSetException;%0Aimport imagej.ImageJ;%0Aimport imagej.data.Dataset;%0Aimport imagej.data.DatasetService;%0Aimport imagej.io.IOService;%0Aimport imagej.io.event.FileSavedEvent;%0Aimport io.scif.io.img.ImgSaver;%0Aimport java.io.File;%0Aimport net.imglib2.img.ImgPlus;%0Aimport org.scijava.event.EventService;%0A%0A/**%0A *%0A * @author Benjamin Nanes%0A */%0A@LinkerInfo( underlying = %22java.lang.String%22, processed = %22imagej.data.Dataset%22, %0A        typeCode = %22tiff%22, name = %22Image File (Tiff)%22)%0Apublic class SaveTiffLinker extends LinkLinker%3CDataset%3E %7B%0A    %0A    private IOService ios;%0A    private DatasetService dss;%0A    %0A    // -- Constructors --%0A    %0A    public SaveTiffLinker() %7B%0A        super();%0A    %7D%0A%0A    public SaveTiffLinker(ImageJ context, SlideSet owner) %7B%0A        super(context, owner);%0A        ios = context.io();%0A        dss = context.dataset();%0A    %7D%0A    %0A    // -- Methods --%0A%0A    @Override%0A    public Dataset process(String underlying) throws SlideSetException %7B%0A        throw new UnsupportedOperationException(%22Not supported yet.%22);%0A    %7D%0A%0A    @Override%0A    public Class%3CDataset%3E getProcessedClass(Object underlying) %7B%0A        return Dataset.class;%0A    %7D%0A%0A    @Override%0A    public void write(String path, Dataset data) throws SlideSetException %7B%0A        final ImgPlus imp = data.getImgPlus();%0A        String wd = owner.getWorkingDirectory();%0A        wd = wd == null ? %22%22 : wd;%0A        if(!(new File(path)).isAbsolute())%0A             path = wd + File.separator + path;%0A        if(!(new File(path).exists()))%0A            throw new LinkNotFoundException(path + %22 does not exist!%22);%0A        final ImgSaver iSave = new ImgSaver();  // This changes to a DatasetService method by 7.5%0A        iSave.setContext(dss.getContext());%0A        try %7B%0A            iSave.saveImg(path, imp);%0A            dss.getContext().getService(EventService.class)%0A                 .publish(new FileSavedEvent(data.getSource()));%0A        %7D catch(Exception e) %7B%0A            throw new ImgLinkException(e);%0A        %7D%0A    %7D%0A        %0A%7D%0A

Add Linker for saving Tiff images