Class ImageInitialization
Object
org.anchoranalysis.image.bean.nonbean.init.ImageInitialization
- All Implemented Interfaces:
BeanInitialization
public class ImageInitialization extends Object implements BeanInitialization
The state used to initialize a
ImageBean.
It contains several NamedProviderStores for particular types of entities.
- Author:
- Owen
-
Field Summary
Fields Modifier and Type Field Description static StringDICTIONARY_IDENTIFIER -
Constructor Summary
Constructors Constructor Description ImageInitialization(SharedObjects sharedObjects)Create with shared-objects.ImageInitialization(SharedObjects sharedObjects, Optional<ImageSizeSuggestion> suggestedSize)Create with shared-objects and a resizing suggestion. -
Method Summary
Modifier and Type Method Description voidaddDictionary(String identifier, Dictionary toAdd)Adds aDictionaryto the corresponding named-collection of dictionaries.voidaddObjectsFrom(NamedProvider<org.anchoranalysis.image.voxel.object.ObjectCollection> source)Adds all theObjectCollections available in aNamedProviderusing the corresponding identifiers.voidaddSharedObjectsDictionary(Optional<SharedObjects> sharedObjects, Optional<Dictionary> dictionary)Adds stacks and object-collections from aSharedObjectsusing the respective identifiers, and also adds aDictionary.voidaddStack(String identifier, Stack toAdd)Adds aStackto the corresponding named-collection of stacks.voidaddStacksFrom(NamedProvider<Stack> source)Adds all theStacks available in aNamedProviderusing the corresponding identifiers.NamedProviderStore<BinarySegmentation>binarySegmentations()A collection ofBinarySegmentations, indexed by name.NamedProviderStore<Channel>channels()A collection ofChannels, indexed by name.NamedProvider<Stack>combinedStacks()Exposes several entities that have naturalStackrepresentations as a unifiedNamedProvider.NamedProviderStore<Dictionary>dictionaries()Named-store ofDictionarys.DictionaryInitializationdictionaryInitialization()The associated initialization for aDictionaryBean.FeatureRelatedInitializationfeaturesInitialization()The associated initialization for aFeatureRelatedBean.NamedProviderStore<Path>filePaths()Named-store of file-paths.NamedProviderStore<org.anchoranalysis.math.histogram.Histogram>histograms()A collection ofHistograms, indexed by name.NamedProviderStore<Mask>masks()A collection ofMasks, indexed by name.PathmodelDirectory()Directory where machine-learning models can be found.NamedProviderStore<org.anchoranalysis.image.voxel.object.ObjectCollection>objects()A collection ofObjectCollections, indexed by name.voidpopulate(BeanInitializer<?> propertyInitializer, Define define, Logger logger)Adds diverse entities from aDefineinto the corresponding name-collections.SharedObjectssharedObjects()Objects shared between different components, a form of shared memory between them.NamedProviderStore<Stack>stacks()A collection ofStacks, indexed by name.Optional<ImageSizeSuggestion>suggestedSize()A suggested input on how to resize an image, if one is provided.
-
Field Details
-
Constructor Details
-
ImageInitialization
Create with shared-objects.- Parameters:
sharedObjects- objects shared between different components, a form of shared memory between them.
-
ImageInitialization
public ImageInitialization(SharedObjects sharedObjects, Optional<ImageSizeSuggestion> suggestedSize)Create with shared-objects and a resizing suggestion.- Parameters:
sharedObjects- objects shared between different components, a form of shared memory between them.suggestedSize- a suggested input on how to resize an image, if one is provided.
-
-
Method Details
-
filePaths
Named-store of file-paths.- Returns:
- the store.
-
dictionaries
Named-store ofDictionarys.- Returns:
- the store.
-
modelDirectory
Directory where machine-learning models can be found.- Returns:
- the path.
-
dictionaryInitialization
The associated initialization for aDictionaryBean.- Returns:
- the associated initialization.
-
featuresInitialization
The associated initialization for aFeatureRelatedBean.- Returns:
- the associated initialization.
-
combinedStacks
Exposes several entities that have naturalStackrepresentations as a unifiedNamedProvider.These are the:
If multiple sources have the same identifier, only one identifier (arbitrarily selected) will exist in the unified
NamedProvider.- Returns:
- a newly created
NamedProvidercombining the above entities asStacks.
-
addDictionary
Adds aDictionaryto the corresponding named-collection of dictionaries.- Parameters:
identifier- the unique name of the dictionary.toAdd- the dictionary to add.- Throws:
OperationFailedException- if the identifier already exists, or otherwise the add operation fails.
-
addStack
Adds aStackto the corresponding named-collection of stacks.- Parameters:
identifier- the unique name of the stack.toAdd- the stack to add.- Throws:
OperationFailedException- if the identifier already exists, or otherwise the add operation fails.
-
addStacksFrom
Adds all theStacks available in aNamedProviderusing the corresponding identifiers.- Parameters:
source- theNamedProviderto add from.- Throws:
OperationFailedException- if an identifier already exists, or otherwise the add operation fails.
-
addObjectsFrom
public void addObjectsFrom(NamedProvider<org.anchoranalysis.image.voxel.object.ObjectCollection> source) throws OperationFailedExceptionAdds all theObjectCollections available in aNamedProviderusing the corresponding identifiers.- Parameters:
source- theNamedProviderto add from.- Throws:
OperationFailedException- if an identifier already exists, or otherwise the add operation fails.
-
populate
public void populate(BeanInitializer<?> propertyInitializer, Define define, Logger logger) throws OperationFailedExceptionAdds diverse entities from aDefineinto the corresponding name-collections.- Parameters:
propertyInitializer- initializes the properties of objects, where initialization is required.define- theDefinefrom which entities are added.logger- a logger to report messages or errors.- Throws:
OperationFailedException- if the identifier for an entity already exists, or otherwise the add operation fails.
-
addSharedObjectsDictionary
public void addSharedObjectsDictionary(Optional<SharedObjects> sharedObjects, Optional<Dictionary> dictionary) throws OperationFailedExceptionAdds stacks and object-collections from aSharedObjectsusing the respective identifiers, and also adds aDictionary.The dictionary is assigned the identifier "input_dictionary".
- Parameters:
sharedObjects- the shared-objects to add entities from, if it exists.dictionary- the dictionary to add, if it exists.- Throws:
OperationFailedException- if the identifier for an entity already exists, or otherwise the add operation fails.
-
sharedObjects
Objects shared between different components, a form of shared memory between them. -
suggestedSize
A suggested input on how to resize an image, if one is provided. -
stacks
A collection ofStacks, indexed by name. -
histograms
A collection ofHistograms, indexed by name. -
objects
A collection ofObjectCollections, indexed by name. -
channels
A collection ofChannels, indexed by name. -
masks
A collection ofMasks, indexed by name. -
binarySegmentations
A collection ofBinarySegmentations, indexed by name.
-