[ome-users] Writing conventional TIFF through BioFormats exporter

simon andrews simon.andrews at babraham.ac.uk
Tue Jun 18 08:58:10 BST 2013



-----Original Message-----
From: simon andrews
Sent: 18 June 2013 08:52
To: 'Curtis Rueden'
Subject: RE: [ome-users] Writing conventional TIFF through BioFormats exporter



> From: Curtis Rueden
> Sent: 17 June 2013 19:30
> Subject: Re: [ome-users] Writing conventional TIFF through BioFormats
> exporter
>
> Hi Simon,
>
> > I need to be able to replicate this in conventional java within my
> > program.
>
> Did you try a simple conversion of the macro code using IJ.runPlugin? This would be simpler than trying to invoke a lower-level Bio-Formats export API.

Yes, I've tried a few variations of doing this directly.  In this scenario I have an ImagePlus object in sourceImp and an output filename in fn_out.  I've tried a few variations on the naming in the output filename (forward slashes, reverse slashes and double reverse slashes.  In every test the transformed.tif file doesn't get created and I get no exception thrown and nothing but null returned from the plugin.  The exception is thrown from the next stage in the processing which can't find the output file.

       String command = "save=["+fn_out+"] compression=Uncompressed";
       IJ.log("Command for exporter is "+command);
       Object o = IJ.runPlugIn(sourceImp,"Bio-Formats Exporter",command);
       IJ.log("Returned object is "+o);

Command for exporter is save=[D:\\Images\\Test\\Registration\\Small Example\\Well A01\\transformed.tif] compression=Uncompressed Returned object is null
java.io.IOException: No sign of transformed.tif after conversion

If there's something obvious I'm missing here I'd be grateful for a heads up.  I was kind of assuming that the simple plugin option might not be available since I'm only working off the API inside ij.jar, so although the loci_tools.jar is in the classpath I wasn't sure ImageJ would find the plugin correctly given that the normal plugin folder structure isn't there.  I'd be very glad to hear that I'm doing something else wrong though!

Cheers

Simon.

On Mon, Jun 17, 2013 at 9:54 AM, simon andrews <simon.andrews at babraham.ac.uk> wrote:
I am writing a small application to automate the processing of some data we've generated.  The processing works fine but I've found that the TIFFs which are written my the native FileSave in ImageJ cannot be opened by the proprietary application we need to use later in the pipeline.  I've also found that TIFFs written using the BioFormats exporter do work so I want to use this instead of the ImageJ exporter.

The application I'm using uses the ImageJ API but there isn't a full ImageJ install.  I can do the export manually in ImageJ to see a macro command like this:

run("Bio-Formats Exporter", "save=[D:\\Images\\Test\\Registration\\bio_formats.tif] compression=Uncompressed");

..but I need to be able to replicate this in conventional java within my program.  I have a simple (non-stacked) ImagePlus object with the data in it and I know the location of the file I want to save.  I need a conventional (rather than OME) and uncompressed TIFF.

I've tried playing around with the options under IJ.runPlugin and with using ImageWriter directly but can't seem to make this work in my environment.  I also suspect there may be a better way to do this within the bioformats API but couldn't find an example which did this.

Can anyone suggest a small snippet of code to show how this should work please?

Many thanks

Simon.
_______________________________________________
ome-users mailing list
ome-users at lists.openmicroscopy.org.uk
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users

The Babraham Institute, Babraham Research Campus, Cambridge CB22 3AT Registered Charity No. 1053902.
The information transmitted in this email is directed only to the addressee. If you received this in error, please contact the sender and delete this email from your system. The contents of this e-mail are the views of the sender and do not necessarily represent the views of the Babraham Institute. Full conditions at: www.babraham.ac.uk<http://www.babraham.ac.uk/email_disclaimer.html>



More information about the ome-users mailing list