Class CompareAnnotations<T extends Assignment<ObjectMask>>
- Type Parameters:
T
- assignment-type.
public class CompareAnnotations<T extends Assignment<ObjectMask>>
extends Task<AnnotationComparisonInput<ProvidesStackInput>,ComparisonSharedState<T>>
Task to compare a set of annotations to a segmentation or another set of annotations.
The following outputs are produced:
Output Name | Default? | Description |
---|---|---|
"byImage" | yes | a single CSV file showing summary statistics of matching for all images. |
"byGroup"<T extends Assignment<ObjectMask>> | yes | a single CSV file showing summary statistics of matching for all groups group of images. |
"outline" | yes | a file per image showing a colored representation of which annotations matched (or didn't) for each image. |
outputs from the AnnotationComparisonAssigner in assign | ||
outputs from Task |
- Author:
- Owen Feehan
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Output name for the CSV file containing summary statistics for all groups of images. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterAllJobsAreExecuted
(ComparisonSharedState<T> sharedState, InputOutputContext context) Called once after all calls toTask.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>)
.beforeAnyJobIsExecuted
(Outputter outputter, ConcurrencyPlan concurrencyPlan, List<AnnotationComparisonInput<ProvidesStackInput>> inputs, ParametersExperiment parameters) Called once before all calls toTask.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>)
.If specified, default rules for determine which outputs are enabled or not.void
doJobOnInput
(InputBound<AnnotationComparisonInput<ProvidesStackInput>, ComparisonSharedState<T>> input) Performs the task on a particular input.The assigner used for annotation comparison.The name of the stack to use as background to the annotations.The color scheme for unpaired objects.How to convert an image to be displayed to the user.int
The maximum number of groups to split the identifier into.int
The number of levels for grouping.int
How many pixels should the outline be around objects.If non-empty, the string (a regular-expression) is used to split the file's identifier into groups.boolean
Is the execution-time of the task per-input expected to be very quick to execute?Highest class(es) that will function as a valid input.boolean
If true, a maximum-intensity-projection is first applied to any 3D objects into a 2D plane, before comparison.boolean
If true, matched objects are replaced with solid colors.void
setAssigner
(AnnotationComparisonAssigner<T> assigner) The assigner used for annotation comparison.void
setBackground
(String background) The name of the stack to use as background to the annotations.void
setColorsUnpaired
(ColorScheme colorsUnpaired) The color scheme for unpaired objects.void
setDisplayer
(StackDisplayer displayer) How to convert an image to be displayed to the user.void
setFlatten
(boolean flatten) If true, a maximum-intensity-projection is first applied to any 3D objects into a 2D plane, before comparison.void
setMaxSplitGroups
(int maxSplitGroups) The maximum number of groups to split the identifier into.void
setNumberLevelsGrouping
(int numberLevelsGrouping) The number of levels for grouping.void
setOutlineWidth
(int outlineWidth) How many pixels should the outline be around objects.void
setReplaceMatchesWithSolids
(boolean replaceMatchesWithSolids) If true, matched objects are replaced with solid colors.void
setSplitIdentifierRegex
(String splitIdentifierRegex) If non-empty, the string (a regular-expression) is used to split the file's identifier into groups.Methods inherited from class org.anchoranalysis.experiment.bean.task.Task
executeJob, isInputCompatibleWith
Methods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Field Details
-
OUTPUT_BY_GROUP
Output name for the CSV file containing summary statistics for all groups of images.- See Also:
-
-
Constructor Details
-
CompareAnnotations
public CompareAnnotations()
-
-
Method Details
-
beforeAnyJobIsExecuted
public ComparisonSharedState<T> beforeAnyJobIsExecuted(Outputter outputter, ConcurrencyPlan concurrencyPlan, List<AnnotationComparisonInput<ProvidesStackInput>> inputs, ParametersExperiment parameters) throws ExperimentExecutionException Description copied from class:Task
Called once before all calls toTask.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>)
.- Specified by:
beforeAnyJobIsExecuted
in classTask<AnnotationComparisonInput<ProvidesStackInput>,
ComparisonSharedState<T extends Assignment<ObjectMask>>> - Parameters:
outputter
- the output-manager for the experiment (not for an individual job)concurrencyPlan
- available numbers of processors that can callTask.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>)
inputs
- a list of inputs, each will result in at least one call toTask.executeJob(ParametersUnbound)
.parameters
- the experiment-parameters.- Returns:
- the shared-state that is passed to each call to
Task.executeJob(org.anchoranalysis.experiment.task.ParametersUnbound<T, S>)
and toTask.afterAllJobsAreExecuted(S, org.anchoranalysis.io.output.outputter.InputOutputContext)
. - Throws:
ExperimentExecutionException
- if a fatal error occurs executing this step of the experiment.
-
doJobOnInput
public void doJobOnInput(InputBound<AnnotationComparisonInput<ProvidesStackInput>, ComparisonSharedState<T>> input) throws JobExecutionExceptionDescription copied from class:Task
Performs the task on a particular input.- Specified by:
doJobOnInput
in classTask<AnnotationComparisonInput<ProvidesStackInput>,
ComparisonSharedState<T extends Assignment<ObjectMask>>> - Parameters:
input
- the input for the job.- Throws:
JobExecutionException
- if an error occurs executing a particular job, that is not otherwise suppressed.
-
inputTypesExpected
Description copied from class:Task
Highest class(es) that will function as a valid input.This is usually the class of T (or sometimes the absolute base class InputFromManager).
- Specified by:
inputTypesExpected
in classTask<AnnotationComparisonInput<ProvidesStackInput>,
ComparisonSharedState<T extends Assignment<ObjectMask>>> - Returns:
- the input-types that a task expects.
-
hasVeryQuickPerInputExecution
public boolean hasVeryQuickPerInputExecution()Description copied from class:Task
Is the execution-time of the task per-input expected to be very quick to execute?- Specified by:
hasVeryQuickPerInputExecution
in classTask<AnnotationComparisonInput<ProvidesStackInput>,
ComparisonSharedState<T extends Assignment<ObjectMask>>> - Returns:
- true iff the execution is expected to be very quick, false otherwise.
-
defaultOutputs
Description copied from class:Task
If specified, default rules for determine which outputs are enabled or not.- Overrides:
defaultOutputs
in classTask<AnnotationComparisonInput<ProvidesStackInput>,
ComparisonSharedState<T extends Assignment<ObjectMask>>> - Returns:
- the default rules if they exist.
-
getBackground
The name of the stack to use as background to the annotations. -
setBackground
The name of the stack to use as background to the annotations. -
getSplitIdentifierRegex
If non-empty, the string (a regular-expression) is used to split the file's identifier into groups. -
setSplitIdentifierRegex
If non-empty, the string (a regular-expression) is used to split the file's identifier into groups. -
getMaxSplitGroups
public int getMaxSplitGroups()The maximum number of groups to split the identifier into. -
setMaxSplitGroups
public void setMaxSplitGroups(int maxSplitGroups) The maximum number of groups to split the identifier into. -
getNumberLevelsGrouping
public int getNumberLevelsGrouping()The number of levels for grouping. -
setNumberLevelsGrouping
public void setNumberLevelsGrouping(int numberLevelsGrouping) The number of levels for grouping. -
isFlatten
public boolean isFlatten()If true, a maximum-intensity-projection is first applied to any 3D objects into a 2D plane, before comparison. -
setFlatten
public void setFlatten(boolean flatten) If true, a maximum-intensity-projection is first applied to any 3D objects into a 2D plane, before comparison. -
getOutlineWidth
public int getOutlineWidth()How many pixels should the outline be around objects. -
setOutlineWidth
public void setOutlineWidth(int outlineWidth) How many pixels should the outline be around objects. -
getAssigner
The assigner used for annotation comparison. -
setAssigner
The assigner used for annotation comparison. -
isReplaceMatchesWithSolids
public boolean isReplaceMatchesWithSolids()If true, matched objects are replaced with solid colors. -
setReplaceMatchesWithSolids
public void setReplaceMatchesWithSolids(boolean replaceMatchesWithSolids) If true, matched objects are replaced with solid colors. -
getColorsUnpaired
The color scheme for unpaired objects. -
getDisplayer
How to convert an image to be displayed to the user. -
setDisplayer
How to convert an image to be displayed to the user.
-