stereodisk
Class StereoDiskConventions

java.lang.Object
  |
  +--stereodisk.StereoDiskConventions

public class StereoDiskConventions
extends java.lang.Object

Class with defaults and conventions for stereo disk file size, names, directories, etc. Copyright (c) 1999-2004, Michael Abramoff. All rights reserved.


Constructor Summary
StereoDiskConventions()
           
 
Method Summary
static byte[] convertImageToResult(ij.process.ColorProcessor ip)
          Convert a colorprocessor with an image containing different colors for different classes into an array with 0...number of classes for each pixel.
static java.lang.String getBasename(java.lang.String cname)
          Get the name of the original file that was observed for name.
static java.lang.String[] getBasenames(java.lang.String directory)
          Return a list of all unique basenames in directory.
static java.lang.String[] getBasenamesFromFile(java.lang.String directory, java.lang.String fileName)
          Return a list of basenames coming from a file in TEXT format.
static java.lang.String getBaseNoExtension(java.lang.String basename)
          Get the name of the original file that was observed for name,.
static java.lang.String[] getFeaturenames(java.lang.String directory)
          Return a list of all feature files in directory.
static java.lang.String[] getFilenames(java.lang.String directory)
           
static ij.ImagePlus getGroundTruthImagePlus(java.lang.String directory, java.lang.String basename, int observer)
          Get the image that is the observation by observer of the images basename.
static int getGroundTruthObserverIndex(java.lang.String name)
          Get the index of the observer that observed file name.
static ij.ImagePlus getImagePlus(java.lang.String directory, java.lang.String name)
          Get the image in directory with name name that is an image.
static ij.process.ImageProcessor getLeftProcessor(ij.process.ImageProcessor ip)
          Get the left half of an image that contains a stereo pair.
static int getNumberOfObservers(java.lang.String directory)
          Get the number of observers that made ground truth files in directory.
static java.lang.String[] getObservationnames(java.lang.String directory)
          Return a list of all observation stack files in directory.
static ij.process.ImageProcessor getRightProcessor(ij.process.ImageProcessor ip)
          Get the left half of an image that contains a stereo pair.
static boolean isGroundTruthBackground(java.awt.Color pixel)
           
static boolean isGroundTruthCup(java.awt.Color pixel)
          Cups are somewhat *&%$&^ yellowish, i.e., G >= 253 and B < = 5.
static boolean isGroundTruthDisk(java.awt.Color pixel)
          Disks are somewhat *&%$&^ red, i.e..
static java.lang.String makeFeaturesName(java.lang.String basename)
          Make a features filename for basename.
static java.lang.String makeGroundTruthName(java.lang.String basename)
          Make a ground truth filename for basename.
static java.lang.String makeStereoPairName(java.lang.String basename)
          Make a stereopair filename for basename.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StereoDiskConventions

public StereoDiskConventions()
Method Detail

getFilenames

public static java.lang.String[] getFilenames(java.lang.String directory)

getBasenamesFromFile

public static java.lang.String[] getBasenamesFromFile(java.lang.String directory,
                                                      java.lang.String fileName)
                                               throws java.lang.Exception
Return a list of basenames coming from a file in TEXT format.
Returns:
a String[] with the s.

getBasenames

public static java.lang.String[] getBasenames(java.lang.String directory)
Return a list of all unique basenames in directory. In the directory there can be multiple variations on , for example observations and ground truth files, which all have the same
Returns:
a String[] with the s.

getFeaturenames

public static java.lang.String[] getFeaturenames(java.lang.String directory)
Return a list of all feature files in directory. Chop off the fts- part.
Returns:
a String[] with the s.

getObservationnames

public static java.lang.String[] getObservationnames(java.lang.String directory)
Return a list of all observation stack files in directory. The observation files have the format obs-.
Returns:
a String[] with all obs-.

isGroundTruthCup

public static boolean isGroundTruthCup(java.awt.Color pixel)
Cups are somewhat *&%$&^ yellowish, i.e., G >= 253 and B < = 5.

isGroundTruthDisk

public static boolean isGroundTruthDisk(java.awt.Color pixel)
Disks are somewhat *&%$&^ red, i.e..

isGroundTruthBackground

public static boolean isGroundTruthBackground(java.awt.Color pixel)

getNumberOfObservers

public static int getNumberOfObservers(java.lang.String directory)
Get the number of observers that made ground truth files in directory.
Returns:
the number of observers.

convertImageToResult

public static byte[] convertImageToResult(ij.process.ColorProcessor ip)
Convert a colorprocessor with an image containing different colors for different classes into an array with 0...number of classes for each pixel. In this case, hardwired for three classes.
Returns:
a byte array with the class index for each pixel.

getGroundTruthObserverIndex

public static int getGroundTruthObserverIndex(java.lang.String name)
Get the index of the observer that observed file name. The format is -. where n is the number of the observer.
Returns:
n, -1 if no observer.

getBasename

public static java.lang.String getBasename(java.lang.String cname)
Get the name of the original file that was observed for name. The format is -. where n is the number of the observer, and a possible prefix "gt-".
Returns:
the base-name.

getBaseNoExtension

public static java.lang.String getBaseNoExtension(java.lang.String basename)
Get the name of the original file that was observed for name,. without extension. The format is -. where n is the number of the observer, and a possible prefix "gt-".
Returns:
the base-name.

getLeftProcessor

public static ij.process.ImageProcessor getLeftProcessor(ij.process.ImageProcessor ip)
Get the left half of an image that contains a stereo pair.

getRightProcessor

public static ij.process.ImageProcessor getRightProcessor(ij.process.ImageProcessor ip)
Get the left half of an image that contains a stereo pair.

makeGroundTruthName

public static java.lang.String makeGroundTruthName(java.lang.String basename)
Make a ground truth filename for basename. The format is ..
Returns:
..

makeFeaturesName

public static java.lang.String makeFeaturesName(java.lang.String basename)
Make a features filename for basename. The format is ..
Returns:
..

makeStereoPairName

public static java.lang.String makeStereoPairName(java.lang.String basename)
Make a stereopair filename for basename. The format is ..
Returns:
..

getGroundTruthImagePlus

public static ij.ImagePlus getGroundTruthImagePlus(java.lang.String directory,
                                                   java.lang.String basename,
                                                   int observer)
Get the image that is the observation by observer of the images basename. The format is -. where n is the number of the observer.
Returns:
the image belonging to the observation.

getImagePlus

public static ij.ImagePlus getImagePlus(java.lang.String directory,
                                        java.lang.String name)
Get the image in directory with name name that is an image.