We're Hiring!

Anyone used Bio-formats in GNU Octave

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.

Anyone used Bio-formats in GNU Octave

Postby philworth » Mon Jun 02, 2014 10:53 am

Hi,

I'm trying to load Aperio SVS images into Octave. It's worked fine in the past using Matlab, but for deployment reasons I need to use Octave this time.

The initial problem is lack of inputParser in Octave, but that's fairly easy to get around by reducing the flexibility of the argument parsing in a couple of places. But then I hit problems with it failing to find 'loci' where the code tries to call version = char(loci.formats.FormatTools.VERSION); (but the latest version of Bio-formats isn't meant to require loci_tools.jar, not that downloading them makes any difference).

Comment that out, I hit problems with loci.common.DebugTools.enableLogging('INFO'). Again, commenting this out, I then hit:

error: 'java' undefined near line 36 column 11
error: called from:
error: C:\Temp\INSERM\bfmatlab\bfCheckJavaMemory.m at
error: C:\Temp\INSERM\bfmatlab\bfGetReader.m at line 5
error: C:\Temp\INSERM\bfmatlab\bfopen.m at line 114, c

which is runtime = java.lang.Runtime.getRuntime();

Java is definitely installed, so not sure where to go from here, any suggestions gratefully received.

Thanks
Phil
philworth
 
Posts: 3
Joined: Mon Jun 02, 2014 10:05 am

Re: Anyone used Bio-formats in GNU Octave

Postby sbesson » Mon Jun 02, 2014 6:52 pm

Hi Phil,

the code may indeed be a MATLAB specific implementation to retrieve the JVM memory settings. Browsing various pieces of code, could you try something like:

Code: Select all
runTime = javaMethod("getRuntime", "java.lang.Runtime");
maxMemory = runTime.maxMemory();


Best,
Sebastien
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm

Re: Anyone used Bio-formats in GNU Octave

Postby philworth » Tue Jun 03, 2014 12:02 pm

Hi Sebastien,

Thanks for the suggestion. That gets me a bit further, but now I'm hitting errors with the following:

r = loci.formats.ChannelFiller();
r = loci.formats.ChannelSeparator(r);
if stitchFiles
r = loci.formats.FileStitcher(r);
end

OMEXMLService = loci.formats.services.OMEXMLServiceImpl();

The error is:
error: 'loci' undefined near line 79 column 5

Any further suggestions?

Many thanks
Phil
philworth
 
Posts: 3
Joined: Mon Jun 02, 2014 10:05 am

Re: Anyone used Bio-formats in GNU Octave

Postby sbesson » Mon Jun 09, 2014 12:28 pm

Hi Phil,

at this point, it would be useful to know the following so that we can try to reproduce your steps:
- the OS you are using
- the version of Octave you installed
- the javaclasspath as returned by Octave when you receive these errors
- the modified scripts you use.

In all cases, bear in mind the bfmatlab zip file was not produced with Octave in mind and we don't have any infrastructure in place to test it. It might be compatible to a certain extent but it is hard to predict how much is required to adapt it fully to Octave.

Best regards,
Sebastien
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm

Re: Anyone used Bio-formats in GNU Octave

Postby philworth » Tue Jun 10, 2014 10:56 am

Hi Sebastien,

Completely appreciate it's not produced with Octave in mind, just keen to get it working if turns out to be fairly straightforwards.

OS is Windows 7, Octave version is 3.8.1.

Javaclasspath returns:

STATIC JAVA PATH

- empty -

DYNAMIC JAVA PATH

C:\Temp\bfmatlab\bioformats_package.jar

That is the correct path to the jar file and I've double checked the file is there.

I've attached a zip of the scripts. I call it using Coloc('<path to test svs file>'). I've obviously deleted the jar file from bfmatlab subdirectory to reduce the attachment size.

Thanks for your help

Phil
Attachments
Coloc.zip
(15.28 KiB) Downloaded 195 times
philworth
 
Posts: 3
Joined: Mon Jun 02, 2014 10:05 am

Re: Anyone used Bio-formats in GNU Octave

Postby sbesson » Wed Jun 11, 2014 11:56 am

Hi Phil,

first of all can you confirm this method:

Code: Select all
r = loci.formats.ChannelFiller();


returns without error but the following:

Code: Select all
OMEXMLService = loci.formats.services.OMEXMLServiceImpl();


generates an exception.

If this is the case, it may be that some JARs included in MATLAB are missing in Octave (since your static path is empty).

Apart from Bio-Formats classes, the following classes are imported in OMEXMLServiceImpl.java. Is there a way for you to check whether these classes are defined under Octave?

Code: Select all
import java.io.IOException;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.List;
import java.util.Set;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.Templates;
import javax.xml.transform.TransformerConfigurationException;
import javax.xml.transform.TransformerException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;


Best,
Sebastien
User avatar
sbesson
Team Member
 
Posts: 421
Joined: Tue Feb 28, 2012 7:20 pm

Re: Anyone used Bio-formats in GNU Octave

Postby carandraug » Wed Jan 20, 2016 4:21 pm

For what is worth, there is a bioformats Octave package since version 5.1.4.

There was an announcement on the octave mailing list

https://lists.gnu.org/archive/html/help ... 00136.html

with the main captchas:

1. it is not an octave forge release so the -forge flag won't work
2. you need to install the jar file separately and add it to the static javaclasspath
carandraug
 
Posts: 15
Joined: Mon Sep 06, 2010 8:50 pm


Return to User Discussion [Legacy]

Who is online

Users browsing this forum: No registered users and 1 guest