use of loci.common.services.ServiceFactory in project bioformats by openmicroscopy.
the class CellH5Reader method initializeJHDFService.
// -- Helper methods --
private void initializeJHDFService(String id) throws IOException, MissingLibraryException {
try {
ServiceFactory factory = new ServiceFactory();
jhdf = factory.getInstance(JHDFService.class);
jhdf.setFile(id);
} catch (DependencyException e) {
throw new MissingLibraryException(JHDFServiceImpl.NO_JHDF_MSG, e);
}
}
use of loci.common.services.ServiceFactory in project bioformats by openmicroscopy.
the class Schema2011_06_Instrument_Upgrade_Test method setUp.
@BeforeClass
public void setUp() throws Exception {
InputStream source = this.getClass().getResourceAsStream(ref.FILE_LOCATION);
ServiceFactory sf = new ServiceFactory();
OMEXMLService service = sf.getInstance(OMEXMLService.class);
String xml = XMLTools.transformXML(new StreamSource(source), UPDATE_201106);
ome = (OME) service.createOMEXMLRoot(xml);
}
use of loci.common.services.ServiceFactory in project bioformats by openmicroscopy.
the class WriterUtilities method createMetadata.
public static IMetadata createMetadata(String pixelType, int rgbChannels, int seriesCount, boolean littleEndian, int sizeT) throws Exception {
IMetadata metadata;
try {
ServiceFactory factory = new ServiceFactory();
OMEXMLService service = factory.getInstance(OMEXMLService.class);
metadata = service.createOMEXMLMetadata();
} catch (DependencyException exc) {
throw new FormatException("Could not create OME-XML store.", exc);
} catch (ServiceException exc) {
throw new FormatException("Could not create OME-XML store.", exc);
}
for (int i = 0; i < seriesCount; i++) {
MetadataTools.populateMetadata(metadata, i, "image #" + i, littleEndian, "XYCZT", pixelType, 160, 160, 1, rgbChannels, sizeT, rgbChannels);
}
return metadata;
}
use of loci.common.services.ServiceFactory in project bioformats by openmicroscopy.
the class WriterUtilities method createMetadata.
public static IMetadata createMetadata() throws DependencyException, ServiceException {
ServiceFactory sf = new ServiceFactory();
OMEXMLService service = sf.getInstance(OMEXMLService.class);
IMetadata metadata = service.createOMEXMLMetadata();
metadata.setPixelsDimensionOrder(DimensionOrder.XYZCT, 0);
metadata.setPixelsSizeX(new PositiveInteger(SIZE_X), 0);
metadata.setPixelsSizeY(new PositiveInteger(SIZE_Y), 0);
metadata.setPixelsSizeT(new PositiveInteger(SIZE_T), 0);
metadata.setPixelsSizeZ(new PositiveInteger(SIZE_Z), 0);
metadata.setPixelsSizeC(new PositiveInteger(SIZE_C), 0);
metadata.setPixelsType(PixelType.UINT8, 0);
metadata.setPixelsBinDataBigEndian(true, 0, 0);
metadata.setImageID("Image:1", 0);
metadata.setPixelsID("Pixels:1", 0);
metadata.setChannelID("Channel:1", 0, 0);
metadata.setChannelSamplesPerPixel(new PositiveInteger(1), 0, 0);
return metadata;
}
use of loci.common.services.ServiceFactory in project bioformats by openmicroscopy.
the class FakeReaderTest method setUp.
@BeforeMethod
public void setUp() throws Exception {
wd = Files.createTempDirectory(this.getClass().getName());
reader = new FakeReader();
ServiceFactory sf = new ServiceFactory();
service = sf.getInstance(OMEXMLService.class);
reader.setMetadataStore(service.createOMEXMLMetadata());
}
Aggregations