We're Hiring!

OIB -> TIFF-OME conversion in Matlab

Historical discussions about the Bio-Formats library. Please look for and ask new questions at https://forum.image.sc/tags/bio-formats
Please note:
Historical discussions about the Bio-Formats library. Please look for and ask new questions at https://forum.image.sc/tags/bio-formats

If you are having trouble with image files, there is information about reporting bugs in the Bio-Formats documentation. Please send us the data and let us know what version of Bio-Formats you are using. For issues with your code, please provide a link to a public repository, ideally GitHub.

OIB -> TIFF-OME conversion in Matlab

Postby pieterTee » Wed May 20, 2015 3:18 pm

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
pieterTee
 
Posts: 2
Joined: Wed May 20, 2015 2:38 pm

Re: OIB -> TIFF-OME conversion in Matlab

Postby sbesson » Wed May 20, 2015 3:52 pm

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
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm

Re: OIB -> TIFF-OME conversion in Matlab

Postby pieterTee » Wed May 20, 2015 4:25 pm

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?
pieterTee
 
Posts: 2
Joined: Wed May 20, 2015 2:38 pm

Re: OIB -> TIFF-OME conversion in Matlab

Postby sbesson » Wed May 20, 2015 7:03 pm

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
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm


Return to User Discussion [Legacy]

Who is online

Users browsing this forum: No registered users and 1 guest