Page 1 of 1

OIB -> TIFF-OME conversion in Matlab

PostPosted: Wed May 20, 2015 3:18 pm
by pieterTee
Hi all,

I ran into a problem when trying to add the OIB -> OME-TIFF converter (https://www.openmicroscopy.org/site/sup ... rsion.html) to my workflow in Matlab (R2013 in Ubuntu 14.04) as a new user to OME.

I managed to get the FileConvert.java finally compiled (by downgrading my default JDK) so that it was accessible by Matlab without the
Code: Select all
"java.lang.UnsupportedClassVersionError: FileConvert: Unsupported major.minor version 51.0"
error due to my default JDK being 1.7.xx in Ubuntu while the Matlab still wanted the 1.6.xx (Major version 51.0).

However now I got the following error which I do not understand really as I am not that familiar with Java (and using Java files in Matlab) when I try to create an instance to the FileConvert

Code: Select all
>> i = FileConvert()
No constructor 'FileConvert' with matching signature found.


Which according to this (http://undocumentedmatlab.com/blog/java ... s-pitfalls) would be due to non-public class but this does not seem to be the case with FileConvert.java, so any idea of how to get the converter working in Matlab?

Thanks

Re: OIB -> TIFF-OME conversion in Matlab

PostPosted: Wed May 20, 2015 3:52 pm
by sbesson
Hi,

the default constructor of the FileConvert class assuming you didn't modify it is:

Code: Select all
  public FileConvert(String inputFile, String outputFile) {


So you are likely missing the input and output arguments to construct the object. Could you try something like:
Code: Select all
converted = FileConvert('/path/to/input_file' ,'/path/to/output_file');
converter.convert()


If that does not work out of the box, you may try to cast the MATLAB strings as Java strings, e.g.

Code: Select all
converted = FileConvert(java.lang.String('/path/to/input_file'), java.lang.String('/path/to/output_file'));


Let us know if the solution above does not work.
Best,
Sebastien

Re: OIB -> TIFF-OME conversion in Matlab

PostPosted: Wed May 20, 2015 4:25 pm
by pieterTee
Thank you Sebastian for your quick reply,

That indeed did the trick of getting the system of doing something, as this:

Code: Select all
filenameFull = '~/Desktop/CP-20150323-TR70-mouse2-1-son.oib'
filenameFullTIF = '~/Desktop/CP-20150323-TR70-mouse2-1-son.tif'

converted = FileConvert(java.lang.String(filenameFull), java.lang.String(filenameFullTIF))


Returns me this:

Code: Select all
converted = FileConvert@6c4bc43a


with no conversion taking place, as no TIF file was saved?

Re: OIB -> TIFF-OME conversion in Matlab

PostPosted: Wed May 20, 2015 7:03 pm
by sbesson
Hi,

thanks for the update. Indeed

Code: Select all
converted = FileConvert(java.lang.String(filenameFull), java.lang.String(filenameFullTIF))


solely initializes a FileConvert object. To perform the conversion operation, you will need to invoke the convert method:

Code: Select all
converted.convert()


Best,
Sebastien