case Opener.BMP:
return new FileSaver(ip).saveAsBmp(outputFile.getPath());
case Opener.PNG:
ImagePlus tempImage = WindowManager.getTempCurrentImage();
WindowManager.setTempCurrentImage(ip);
PlugIn p =null;
try {
p = (PlugIn) Class.forName("ij.plugin.PNG_Writer").newInstance();
} catch (InstantiationException e) {
logger.error(e.getMessage(), e);
} catch (IllegalAccessException e) {
logger.error(e.getMessage(), e);
} catch (ClassNotFoundException e) {
logger.error(e.getMessage(), e);
}
p.run(outputFile.getPath());
WindowManager.setTempCurrentImage(tempImage);
return true;
case Opener.PGM:
return new FileSaver(ip).saveAsPgm(outputFile.getPath());
}