|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectome.formats.importer.ImportLibrary
public class ImportLibrary
support class for the proper usage of OMEROMetadataStoreClient
and
FormatReader
instances. This library was factored out of
ImportHandler to support ImportFixture The general workflow
for this class (as seen in ImportFixture
is:
ImportLibrary library = new ImportLibrary(store,reader,files);
for (File file : files) {
String fileName = file.getAbsolutePath();
library.open(fileName);
int count = library.calculateImageCount(fileName);
long pixId = library.importMetadata();
library.importData(pixId, fileName, new ImportLibrary.Step(){
public void step(int i) {}});
}
FormatReader
,
OMEROMetadataStoreClient
,
ImportFixture
,
IObservable
,
IObserver
Field Summary | |
---|---|
static int |
DEFAULT_ARRAYBUF_SIZE
Default arraybuf size for planar data transfer. (1MB) |
Constructor Summary | |
---|---|
ImportLibrary(OMEROMetadataStoreClient client,
OMEROWrapper reader)
The library will not close the client instance. |
Method Summary | |
---|---|
boolean |
addObserver(IObserver object)
Add observer for notification |
void |
clear()
|
boolean |
deleteObserver(IObserver object)
Delete observer |
long |
getExperimenterID()
|
InstanceProvider |
getInstanceProvider()
|
boolean |
importCandidates(ImportConfig config,
ImportCandidates candidates)
Primary user method for importing a number |
MessageDigest |
importData(Long pixId,
String fileName,
int series,
ImportSize size)
saves the binary data to the server. |
List<omero.model.Pixels> |
importImage(ImportContainer container,
int index,
int numDone,
int total)
Perform an image import. |
boolean |
isMetadataOnly()
Retrieves the metadata only flag. |
void |
notifyObservers(ImportEvent event)
Notify observers of event |
void |
prepare(Map<Integer,omero.model.Image> existingMetadata)
Prepares the metadata store using existing metadata that has been pre-registered by OMERO.fs. |
void |
setMetadataOnly(boolean isMetadataOnly)
Sets the metadata only flag. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_ARRAYBUF_SIZE
Constructor Detail |
---|
public ImportLibrary(OMEROMetadataStoreClient client, OMEROWrapper reader)
store
- not nullreader
- not nullMethod Detail |
---|
public void setMetadataOnly(boolean isMetadataOnly)
isMetadataOnly
- Whether or not to perform metadata only imports
with this import library.public boolean isMetadataOnly()
public long getExperimenterID()
public InstanceProvider getInstanceProvider()
public void prepare(Map<Integer,omero.model.Image> existingMetadata)
existingMetadata
- Map of imageIndex or series vs. populated Image
source graph with the fetched objects defined above.public boolean addObserver(IObserver object)
IObservable
addObserver
in interface IObservable
object
- - observer object
public boolean deleteObserver(IObserver object)
IObservable
deleteObserver
in interface IObservable
object
- - observer to delete
public void notifyObservers(ImportEvent event)
IObservable
notifyObservers
in interface IObservable
event
- - event that happenedpublic boolean importCandidates(ImportConfig config, ImportCandidates candidates)
public List<omero.model.Pixels> importImage(ImportContainer container, int index, int numDone, int total) throws loci.formats.FormatException, IOException, Throwable
observers
of error states AND throws the exception to cancel
processing.
importCandidates(ImportConfig, ImportCandidates)
uses ImportConfig.contOnError
to act on these exceptions.
container
- The import container which houses all the configuration
values and target for the import.index
- Index of the import in a set. 0
is safe if
this is a singular import.numDone
- Number of imports completed in a set. 0
is
safe if this is a singular import.total
- Total number of imports in a set. 1
is safe
if this is a singular import.
loci.formats.FormatException
- If there is a Bio-Formats image file format
error during import.
IOException
- If there is an I/O error.
omero.ServerError
- If there is an error communicating with the OMERO
server we're importing into.
Throwable
public MessageDigest importData(Long pixId, String fileName, int series, ImportSize size) throws loci.formats.FormatException, IOException, omero.ServerError
ImportEvent.IMPORT_STEP
is raised with the number of the
iteration just completed.
series
-
loci.formats.FormatException
IOException
omero.ServerError
public void clear()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Version: 4.3.4-dbcbce5a-b4
Copyright © 2009 The University of Dundee. All Rights Reserved.