Class HTPcalculator

java.lang.Object
  extended by HTPcalculator

public class HTPcalculator
extends java.lang.Object

HTPcalculator
Contains functions related to retrieving image parameters from the image after the current classification took place.


Constructor Summary
HTPcalculator()
           
 
Method Summary
 ij.ImagePlus convertClassificationData(int[][] CLASSES, java.util.Hashtable<java.lang.Integer,java.lang.Integer> number2color, java.lang.String title)
          Converts the current classification data contained in the CLASSES array into an image for all classes.
 ij.ImagePlus convertClassificationData(int[][] CLASSES, java.util.Hashtable<java.lang.Integer,java.lang.Integer> number2color, java.lang.String title, int classNumber)
          Converts the current classification data contained in the CLASSES array into an image for the specified class number only.
 int countPixelsOfClass(int[][] CLASSES, int classNumber)
          Counts the pixel of a given object class in the given object CLASSES-map of the image.
 ij.ImagePlus displayClassificationData(int[][] CLASSES, java.util.Hashtable<java.lang.Integer,java.lang.Integer> number2color, java.lang.String title)
          Displays the classification data for all classes according to the specified colours.
 ij.ImagePlus displayClassificationData(int[][] CLASSES, java.util.Hashtable<java.lang.Integer,java.lang.Integer> number2color, java.lang.String title, int classNumber)
          Displays the CLASSES classification data, but only for the chosen class.
 void drawContour(int[][] CLASSES, ij.ImagePlus img, int classNumber)
          Draws the outline around all areas of a specified class into the specified image.
 void drawImageScaling(ij.ImagePlus img, double pixelPerMM)
          Sets the scaling according to the given pixel-per-millimeter calibration and draws a calibration bar into the given image of 100mm length.
 void drawRegions(ij.ImagePlus img, java.util.ArrayList<java.util.Hashtable<java.lang.String,java.lang.String>> regions)
          Visualises the regions by drawing them as rectangular or oval shapes into the specified image.
 int morphologyTransform(int[][] CLASSES, int classNumber)
          Counts the pixel of a given object class.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTPcalculator

public HTPcalculator()
Method Detail

countPixelsOfClass

public int countPixelsOfClass(int[][] CLASSES,
                              int classNumber)
Counts the pixel of a given object class in the given object CLASSES-map of the image.

Parameters:
CLASSES - A 2-dimensional Array containing the colour classification information for each pixel in the image.
classNumber - An Integer to count all pixel belonging to one object class.
Returns:
An Integer containing all pixel of the specified colour identified in the image.

morphologyTransform

public int morphologyTransform(int[][] CLASSES,
                               int classNumber)
Counts the pixel of a given object class. Also applies the morphological operation "opening" to lower the noise level.

Parameters:
CLASSES - A 2-dimensional Array containing the colour classification information for each pixel in the image.
classNumber - An Integer to count all pixel belonging to one object class.
Returns:
An Integer containing all pixel of the specified colour identified in the image.

drawImageScaling

public void drawImageScaling(ij.ImagePlus img,
                             double pixelPerMM)
Sets the scaling according to the given pixel-per-millimeter calibration and draws a calibration bar into the given image of 100mm length.

Parameters:
img - An ImagePlus object containing the analysed image.
pixelPerMM - An Integer to define how many pixel correspond to how many millimetre in the image.

drawContour

public void drawContour(int[][] CLASSES,
                        ij.ImagePlus img,
                        int classNumber)
Draws the outline around all areas of a specified class into the specified image. This is achieved by edge detection on a binary mask image of the given class, and by transferring those edges into the original image.

Parameters:
CLASSES - A 2-dimensional Array containing the colour classification information for each pixel in the image.
img - An ImagePlus object containing the analysed image.
classNumber - An Integer to count all pixel belonging to one object class.

drawRegions

public void drawRegions(ij.ImagePlus img,
                        java.util.ArrayList<java.util.Hashtable<java.lang.String,java.lang.String>> regions)
Visualises the regions by drawing them as rectangular or oval shapes into the specified image.

Parameters:
img - An ImagePlus object containing the analysed image.
regions - An ArrayList containing the region parameters in a Hashtable.

displayClassificationData

public ij.ImagePlus displayClassificationData(int[][] CLASSES,
                                              java.util.Hashtable<java.lang.Integer,java.lang.Integer> number2color,
                                              java.lang.String title,
                                              int classNumber)
Displays the CLASSES classification data, but only for the chosen class.

Parameters:
CLASSES - A 2-dimensional Array containing the colour classification information for each pixel in the image.
number2color - A Hashtable containing the mapping of an object class to the colour value.
title - The image title.
classNumber - An Integer to count all pixel belonging to one object class.
Returns:
An ImagePlus object containing the colour classification.

convertClassificationData

public ij.ImagePlus convertClassificationData(int[][] CLASSES,
                                              java.util.Hashtable<java.lang.Integer,java.lang.Integer> number2color,
                                              java.lang.String title,
                                              int classNumber)
Converts the current classification data contained in the CLASSES array into an image for the specified class number only.

Parameters:
CLASSES - A 2-dimensional Array containing the colour classification information for each pixel in the image.
number2color - A Hashtable containing the mapping of an object class to the colour value.
title - The image title.
classNumber - An Integer to count all pixel belonging to one object class.
Returns:
An ImagePlus object containing the colour classification.

displayClassificationData

public ij.ImagePlus displayClassificationData(int[][] CLASSES,
                                              java.util.Hashtable<java.lang.Integer,java.lang.Integer> number2color,
                                              java.lang.String title)
Displays the classification data for all classes according to the specified colours.

Parameters:
CLASSES - A 2-dimensional Array containing the colour classification information for each pixel in the image.
number2color - A Hashtable containing the mapping of an object class to the colour value.
title - The image title.
Returns:
An ImagePlus object containing the colour classification.

convertClassificationData

public ij.ImagePlus convertClassificationData(int[][] CLASSES,
                                              java.util.Hashtable<java.lang.Integer,java.lang.Integer> number2color,
                                              java.lang.String title)
Converts the current classification data contained in the CLASSES array into an image for all classes.

Parameters:
CLASSES - A 2-dimensional Array containing the colour classification information for each pixel in the image.
number2color - A Hashtable containing the mapping of an object class to the colour value.
title - The image title.
Returns:
An ImagePlus object containing the colour classification.