Class IndividualImageSegmentationLayerWriter

    • Field Detail

      • m_SkipEmptyLayers

        protected boolean m_SkipEmptyLayers
        whether to skip images with only background.
    • Constructor Detail

      • IndividualImageSegmentationLayerWriter

        public IndividualImageSegmentationLayerWriter()
    • Method Detail

      • getFormatDescription

        public String getFormatDescription()
        Returns a string describing the format (used in the file chooser).
        Returns:
        a description suitable for displaying in the file chooser
      • getFormatExtensions

        public String[] getFormatExtensions()
        Returns the extension(s) of the format.
        Returns:
        the extension (without the dot!)
      • getDefaultFormatExtension

        public String getDefaultFormatExtension()
        Returns the default extension of the format.
        Returns:
        the default extension (without the dot!)
      • setSkipEmptyLayers

        public void setSkipEmptyLayers​(boolean value)
        Sets whether to skip writing empty layers (ie only background).
        Parameters:
        value - true if to skip
      • getSkipEmptyLayers

        public boolean getSkipEmptyLayers()
        Returns whether to skip writing empty layers (ie only background).
        Returns:
        true if to skip
      • skipEmptyLayersTipText

        public String skipEmptyLayersTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • writeFile

        protected String writeFile​(BufferedImage image,
                                   PlaceholderFile file)
        Writes the file to disk.
        Parameters:
        image - the image to write
        file - the file to write to
        Returns:
        null if successful, otherwise error message
      • countColors

        protected int countColors​(BufferedImage image)
        Counts the distinct colors in the image.
        Parameters:
        image - the image to process
        Returns:
        the count