Page 1 of 1

Anyone used Bio-formats in GNU Octave

PostPosted: Mon Jun 02, 2014 10:53 am
by philworth
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

Re: Anyone used Bio-formats in GNU Octave

PostPosted: Mon Jun 02, 2014 6:52 pm
by sbesson
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

Re: Anyone used Bio-formats in GNU Octave

PostPosted: Tue Jun 03, 2014 12:02 pm
by philworth
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

Re: Anyone used Bio-formats in GNU Octave

PostPosted: Mon Jun 09, 2014 12:28 pm
by sbesson
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

Re: Anyone used Bio-formats in GNU Octave

PostPosted: Tue Jun 10, 2014 10:56 am
by philworth
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

Re: Anyone used Bio-formats in GNU Octave

PostPosted: Wed Jun 11, 2014 11:56 am
by sbesson
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

Re: Anyone used Bio-formats in GNU Octave

PostPosted: Wed Jan 20, 2016 4:21 pm
by carandraug
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