Can't create OMEXMLService Instance in MATLAB

ServiceFactory=loci.common.services.ServiceFactory;
OMEXMLService=ServiceFactory.getInstance(loci.formats.services.OMEXMLService.class);

This is adapted from FileConvert.java. MATLAB says the getInstance call has wrong arguments???
As a workaround can I directly call loci.formats.services.OMEXMLServiceImpl constructor?

Can you try with factory.getInstance(OMEXMLService.class);. Does that resolve the issue?
If not then calling the OMEXMLServiceImpl constructor should also do the exact same thing.

MATLAB can’t recognize the name OMEXMLService without the prefix loci.formats.services

Another option would be the below, which is what we use in the MATLAB helper functions:

OMEXMLService = javaObject('loci.formats.services.OMEXMLServiceImpl');
metadata = OMEXMLService.createOMEXMLMetadata();