Class ObjectCollectionReader
Object
ObjectCollectionReader
Reads an
ObjectCollection
from the filesystem- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectCollection
createFromPath
(Path path, OperationContext context) Reads an object-collection from a path (or path prefix) trying different methods to read the objects.static boolean
hasHdf5Extension
(Path path) Whether a path has a suitable extension to be considered a HDF5 file?
-
Method Details
-
createFromPath
public static ObjectCollection createFromPath(Path path, OperationContext context) throws DeserializationFailedException Reads an object-collection from a path (or path prefix) trying different methods to read the objects.The following order is used to look for an object-mask collection:
- If path ends in
.h5
it is read as a HDF5 object-mask collection. - Otherwise,
.h5
is suffixed, and if this path exists, it is read as a HDF5 object-mask collection.
In the case of 3, if the path does not exist, but it is the subpath of an
ObjectCollection
directory which does then a special case occurs. An emptyObjectCollection
is returned.- Parameters:
path
- path or (or path missing a.h5
extension) used to search for an object-collection using the rules abovecontext
- context for reading a stack from the file-system.- Returns:
- the object-collection read from this path.
- Throws:
DeserializationFailedException
- if no objects are found at this path, or anything else prevents their deserialization.
- If path ends in
-
hasHdf5Extension
Whether a path has a suitable extension to be considered a HDF5 file?- Parameters:
path
- the path whose extension is checked.- Returns:
- true if the path ends with an extension that is considered HDF5.
-