Class CompareAnnotations<T extends org.anchoranalysis.annotation.io.assignment.Assignment<org.anchoranalysis.image.voxel.object.ObjectMask>>

Object
org.anchoranalysis.bean.AnchorBean<org.anchoranalysis.experiment.bean.task.Task<T,​S>>
org.anchoranalysis.experiment.bean.task.Task<AnnotationComparisonInput<org.anchoranalysis.image.io.stack.input.ProvidesStackInput>,​ComparisonSharedState<T>>
org.anchoranalysis.plugin.annotation.bean.comparison.CompareAnnotations<T>
Type Parameters:
T - assignment-type.

public class CompareAnnotations<T extends org.anchoranalysis.annotation.io.assignment.Assignment<org.anchoranalysis.image.voxel.object.ObjectMask>>
extends org.anchoranalysis.experiment.bean.task.Task<AnnotationComparisonInput<org.anchoranalysis.image.io.stack.input.ProvidesStackInput>,​ComparisonSharedState<T>>
Task to compare a set of annotations to a segmentation or another set of annotations.

The following outputs are produced:

Output NameDefault?Description
"byImage"yesa single CSV file showing summary statistics of matching for all images.
"byGroup"yesa single CSV file showing summary statistics of matching for all groups group of images.
"outline"yesa 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

    Fields 
    Modifier and Type Field Description
    static String OUTPUT_BY_GROUP
    Output name for the CSV file containing summary statistics for all groups of images.
  • Constructor Summary

    Constructors 
    Constructor Description
    CompareAnnotations()  
  • Method Summary

    Modifier and Type Method Description
    void afterAllJobsAreExecuted​(ComparisonSharedState<T> sharedState, org.anchoranalysis.io.output.outputter.InputOutputContext context)  
    ComparisonSharedState<T> beforeAnyJobIsExecuted​(org.anchoranalysis.io.output.outputter.Outputter outputter, org.anchoranalysis.inference.concurrency.ConcurrencyPlan concurrencyPlan, List<AnnotationComparisonInput<org.anchoranalysis.image.io.stack.input.ProvidesStackInput>> inputs, org.anchoranalysis.experiment.task.ParametersExperiment parameters)  
    org.anchoranalysis.io.output.enabled.OutputEnabledMutable defaultOutputs()  
    void doJobOnInput​(org.anchoranalysis.experiment.task.InputBound<AnnotationComparisonInput<org.anchoranalysis.image.io.stack.input.ProvidesStackInput>,​ComparisonSharedState<T>> input)  
    AnnotationComparisonAssigner<T> getAssigner()
    The assigner used for annotation comparison.
    String getBackground()
    The name of the stack to use as background to the annotations.
    org.anchoranalysis.bean.shared.color.scheme.ColorScheme getColorsUnpaired()
    The color scheme for unpaired objects.
    org.anchoranalysis.image.bean.displayer.StackDisplayer getDisplayer()
    How to convert an image to be displayed to the user.
    int getMaxSplitGroups()
    The maximum number of groups to split the identifier into.
    int getNumberLevelsGrouping()
    The number of levels for grouping.
    int getOutlineWidth()
    How many pixels should the outline be around objects.
    String getSplitIdentifierRegex()
    If non-empty, the string (a regular-expression) is used to split the file's identifier into groups.
    boolean hasVeryQuickPerInputExecution()  
    org.anchoranalysis.experiment.task.InputTypesExpected inputTypesExpected()  
    boolean isFlatten()
    If true, a maximum-intensity-projection is first applied to any 3D objects into a 2D plane, before comparison.
    boolean isReplaceMatchesWithSolids()
    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​(org.anchoranalysis.bean.shared.color.scheme.ColorScheme colorsUnpaired)
    The color scheme for unpaired objects.
    void setDisplayer​(org.anchoranalysis.image.bean.displayer.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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • beforeAnyJobIsExecuted

      public ComparisonSharedState<T> beforeAnyJobIsExecuted​(org.anchoranalysis.io.output.outputter.Outputter outputter, org.anchoranalysis.inference.concurrency.ConcurrencyPlan concurrencyPlan, List<AnnotationComparisonInput<org.anchoranalysis.image.io.stack.input.ProvidesStackInput>> inputs, org.anchoranalysis.experiment.task.ParametersExperiment parameters) throws org.anchoranalysis.experiment.ExperimentExecutionException
      Specified by:
      beforeAnyJobIsExecuted in class org.anchoranalysis.experiment.bean.task.Task<AnnotationComparisonInput<org.anchoranalysis.image.io.stack.input.ProvidesStackInput>,​ComparisonSharedState<T extends org.anchoranalysis.annotation.io.assignment.Assignment<org.anchoranalysis.image.voxel.object.ObjectMask>>>
      Throws:
      org.anchoranalysis.experiment.ExperimentExecutionException
    • doJobOnInput

      public void doJobOnInput​(org.anchoranalysis.experiment.task.InputBound<AnnotationComparisonInput<org.anchoranalysis.image.io.stack.input.ProvidesStackInput>,​ComparisonSharedState<T>> input) throws org.anchoranalysis.experiment.JobExecutionException
      Specified by:
      doJobOnInput in class org.anchoranalysis.experiment.bean.task.Task<AnnotationComparisonInput<org.anchoranalysis.image.io.stack.input.ProvidesStackInput>,​ComparisonSharedState<T extends org.anchoranalysis.annotation.io.assignment.Assignment<org.anchoranalysis.image.voxel.object.ObjectMask>>>
      Throws:
      org.anchoranalysis.experiment.JobExecutionException
    • inputTypesExpected

      public org.anchoranalysis.experiment.task.InputTypesExpected inputTypesExpected()
      Specified by:
      inputTypesExpected in class org.anchoranalysis.experiment.bean.task.Task<AnnotationComparisonInput<org.anchoranalysis.image.io.stack.input.ProvidesStackInput>,​ComparisonSharedState<T extends org.anchoranalysis.annotation.io.assignment.Assignment<org.anchoranalysis.image.voxel.object.ObjectMask>>>
    • afterAllJobsAreExecuted

      public void afterAllJobsAreExecuted​(ComparisonSharedState<T> sharedState, org.anchoranalysis.io.output.outputter.InputOutputContext context) throws org.anchoranalysis.experiment.ExperimentExecutionException
      Specified by:
      afterAllJobsAreExecuted in class org.anchoranalysis.experiment.bean.task.Task<AnnotationComparisonInput<org.anchoranalysis.image.io.stack.input.ProvidesStackInput>,​ComparisonSharedState<T extends org.anchoranalysis.annotation.io.assignment.Assignment<org.anchoranalysis.image.voxel.object.ObjectMask>>>
      Throws:
      org.anchoranalysis.experiment.ExperimentExecutionException
    • hasVeryQuickPerInputExecution

      public boolean hasVeryQuickPerInputExecution()
      Specified by:
      hasVeryQuickPerInputExecution in class org.anchoranalysis.experiment.bean.task.Task<AnnotationComparisonInput<org.anchoranalysis.image.io.stack.input.ProvidesStackInput>,​ComparisonSharedState<T extends org.anchoranalysis.annotation.io.assignment.Assignment<org.anchoranalysis.image.voxel.object.ObjectMask>>>
    • defaultOutputs

      public org.anchoranalysis.io.output.enabled.OutputEnabledMutable defaultOutputs()
      Overrides:
      defaultOutputs in class org.anchoranalysis.experiment.bean.task.Task<AnnotationComparisonInput<org.anchoranalysis.image.io.stack.input.ProvidesStackInput>,​ComparisonSharedState<T extends org.anchoranalysis.annotation.io.assignment.Assignment<org.anchoranalysis.image.voxel.object.ObjectMask>>>
    • getBackground

      public String getBackground()
      The name of the stack to use as background to the annotations.
    • setBackground

      public void setBackground​(String background)
      The name of the stack to use as background to the annotations.
    • getSplitIdentifierRegex

      public String getSplitIdentifierRegex()
      If non-empty, the string (a regular-expression) is used to split the file's identifier into groups.
    • setSplitIdentifierRegex

      public void setSplitIdentifierRegex​(String splitIdentifierRegex)
      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

      public AnnotationComparisonAssigner<T> getAssigner()
      The assigner used for annotation comparison.
    • setAssigner

      public void setAssigner​(AnnotationComparisonAssigner<T> assigner)
      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

      public org.anchoranalysis.bean.shared.color.scheme.ColorScheme getColorsUnpaired()
      The color scheme for unpaired objects.
    • setColorsUnpaired

      public void setColorsUnpaired​(org.anchoranalysis.bean.shared.color.scheme.ColorScheme colorsUnpaired)
      The color scheme for unpaired objects.
    • getDisplayer

      public org.anchoranalysis.image.bean.displayer.StackDisplayer getDisplayer()
      How to convert an image to be displayed to the user.
    • setDisplayer

      public void setDisplayer​(org.anchoranalysis.image.bean.displayer.StackDisplayer displayer)
      How to convert an image to be displayed to the user.