I have images with 10000+ frames that I need to save from commands. I was using
import io.scif.img.ImgSaver; new ImgSaver().saveImg(...);
This worked fine when I ran from a ‘test’ ImageJ from eclipse. However when I ran my plugin from Fiji I got
java.lang.UnsupportedOperationException: Cannot instantiate more than one LegacyService
So I switched to…
@Parameter DatasetService ds; @Parameter DatasetIOService io; ... io.save(ds.create(im), imName);
Which works in Fiji. However it takes 20 minutes to save, as opposed to seconds the first way. (as I mentioned the image has 10000 frames, the second call seems to be slowly saving the image frame by frame).
So what is the proper way to save the output of a Command??