Class HTPcalib

java.lang.Object
  extended by HTPcalib
All Implemented Interfaces:
ij.ImageListener, ij.plugin.PlugIn, java.awt.event.KeyListener, java.awt.event.MouseListener, java.util.EventListener

public class HTPcalib
extends java.lang.Object
implements ij.plugin.PlugIn, java.awt.event.MouseListener, java.awt.event.KeyListener, ij.ImageListener

ImageJ Plugin: HTPcalib (high-throughput phenotyping calibration)
Allows to obtain colour ranges for each class from images, implemented as Plugin for ImageJ.


Field Summary
 java.lang.String path
           
 
Constructor Summary
HTPcalib()
           
 
Method Summary
 void htpCalibDisplayGeneralInstructions()
          Displays the general instructions how to use the function HTPcalib.
 void htpCalibDisplayInstructions()
          Displays which class is being processed next and explains the functions of the keys ESCAPE, TAB and ENTER.
 void htpcalibWriteCurrentRange()
          Writes the current minimum and maximum ranges of the current class to the color2class calibration files.
 void imageClosed(ij.ImagePlus imp)
          ImageListener: Detects abortion of the calibration if the image has been closed.
 void imageOpened(ij.ImagePlus imp)
          Not being used (empty abstract override).
 void imageUpdated(ij.ImagePlus imp)
          Not being used (empty abstract override).
 void keyPressed(java.awt.event.KeyEvent e)
          KeyListener: Processes the key events.
 void keyReleased(java.awt.event.KeyEvent e)
          KeyListener: Processes the key events.
 void keyTyped(java.awt.event.KeyEvent e)
          not being used (empty abstract override)
 void markOtherDataSets(java.lang.String className)
          Marks all previous colour ranges selected for this class.
 void mouseClicked(java.awt.event.MouseEvent e)
          MouseListener: Handles clicking events.
 void mouseEntered(java.awt.event.MouseEvent e)
          Not being used (empty abstract override).
 void mouseExited(java.awt.event.MouseEvent e)
          Not being used (empty abstract override).
 void mousePressed(java.awt.event.MouseEvent e)
          Not being used (empty abstract override).
 void mouseReleased(java.awt.event.MouseEvent e)
          Not being used (empty abstract override).
 void processNextClass()
          Is called after the user finished the pixel sampling of a class.
 void run(java.lang.String arg)
          Initialization of the calibration process.
 void updateColorRange()
          Updates the maximum and minimum values for each colour channel based on the current sample array.
 void updateModifiedImage()
          Redraws the current image with markings based on the current minimum maximum colour range.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

path

public java.lang.String path
Constructor Detail

HTPcalib

public HTPcalib()
Method Detail

run

public void run(java.lang.String arg)
Initialization of the calibration process. Lets the user open on or more image(s) for the calibration and calls the methods to display the instructions.

Specified by:
run in interface ij.plugin.PlugIn
Parameters:
arg - A String passed as an argument to the plugin.

imageOpened

public void imageOpened(ij.ImagePlus imp)
Not being used (empty abstract override).

Specified by:
imageOpened in interface ij.ImageListener

imageUpdated

public void imageUpdated(ij.ImagePlus imp)
Not being used (empty abstract override).

Specified by:
imageUpdated in interface ij.ImageListener

imageClosed

public void imageClosed(ij.ImagePlus imp)
ImageListener: Detects abortion of the calibration if the image has been closed.

Specified by:
imageClosed in interface ij.ImageListener
Parameters:
imp - An ImagePlus object.

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Not being used (empty abstract override).

Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Not being used (empty abstract override).

Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Not being used (empty abstract override).

Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Not being used (empty abstract override).

Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
MouseListener: Handles clicking events.
Obtains a color sample from the clicked position and store it.
Updates the minimum and maximum colour range array accordingly.

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Parameters:
e - A MouseEvent object.

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
not being used (empty abstract override)

Specified by:
keyTyped in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
KeyListener: Processes the key events.
If TAB released switch the image view back to the selected pixel image.

Specified by:
keyReleased in interface java.awt.event.KeyListener
Parameters:
e - A KeyEvent object.

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
KeyListener: Processes the key events.
If ENTER pressed open the next image class.
If TAB pressed display the original image.
If ESC pressed take one step back and remove the last selected pixel.

Specified by:
keyPressed in interface java.awt.event.KeyListener

processNextClass

public void processNextClass()
Is called after the user finished the pixel sampling of a class. The current class calibration data is written to the color2class configuration files and the original image is restored. The user is asked whether to add another calibration set for this class or to go on with the next class.
If the whole calibration process is finished this method finally cleans up the {Key|Mouse}Listeners and displays the "Complete!" message.


markOtherDataSets

public void markOtherDataSets(java.lang.String className)
Marks all previous colour ranges selected for this class.

Parameters:
className - A String object containing the class name.

updateColorRange

public void updateColorRange()
Updates the maximum and minimum values for each colour channel based on the current sample array.


updateModifiedImage

public void updateModifiedImage()
Redraws the current image with markings based on the current minimum maximum colour range.


htpcalibWriteCurrentRange

public void htpcalibWriteCurrentRange()
Writes the current minimum and maximum ranges of the current class to the color2class calibration files.


htpCalibDisplayInstructions

public void htpCalibDisplayInstructions()
Displays which class is being processed next and explains the functions of the keys ESCAPE, TAB and ENTER.


htpCalibDisplayGeneralInstructions

public void htpCalibDisplayGeneralInstructions()
Displays the general instructions how to use the function HTPcalib.