snakeprogram
Class SnakeImages

java.lang.Object
  extended by snakeprogram.SnakeImages

public class SnakeImages
extends java.lang.Object

A class for controlling the image data. Copyright (c) 2010, Lehigh University All rights reserved. see COPYING for license.


Field Summary
 int LINEWIDTH
           
 
Method Summary
 void addStaticMarker(double[] pt)
           
 void clearStaticMarkers()
           
 void drawRawSnake(ij.process.ImageProcessor improc)
          This method is called by updateImagePanel() and draws the points in SnakeRawX and SnakeRawY to the screen connected by a line.
 void drawSnake(Snake s, ij.process.ImageProcessor improc)
           
static void drawSnake(Snake s, ij.process.ImageProcessor ip, int frame)
          This is a static version of drawSnake for use with an external program.
 void drawSnakes(ij.process.ImageProcessor imp)
          Draws all of the snakes in SnakeStore
 double fromZoomX(double newX)
          this method takes an X coordinates and sets it to its position in the original, un-zoomed, image
 double fromZoomY(double newY)
          this method takes an Y coordinates and sets it to its position in the original, un-zoomed, image
 void getAndLoadImage()
          Gets a file name via the swing file chooser dialog
 double[] getAutoIntensities()
           
 double getAveragedValue(double x, double y, int ss)
           
 int getCounter()
           
 ij.process.ImageProcessor getProcessor()
           
 int getStackSize()
           
 java.lang.String getTitle()
           
 boolean hasImage()
           
 void loadImage(ij.ImagePlus implus)
           
 void nextImage()
           
 void previousImage()
           
 void resetZoom()
          Sets the zoom box to be the whole image
 void setCurrentSnake(Snake cs)
           
 void setDrawSnake(boolean v)
           
 void setFollow(boolean v)
           
 void setInitializing(boolean v)
           
 void setMarker(double[] pt)
           
 void setRawData(java.util.ArrayList<double[]> xv)
           
 void setSnakes(MultipleSnakesStore mss)
           
 void setStretchFix(boolean v)
           
 void setZoomIn(boolean v)
           
 void setZoomInBox(boolean v)
           
 void setZoomLocation(int x, int y)
           
 double[] toZoom(double[] old)
          transform a 2d array
 double toZoomX(double oldX)
          this method takes an X coordinate on the original image and finds its new position on a zoomed image
 double toZoomY(double oldY)
          takes an Y coordinate on the original image and finds its new position on a zoomed image
 void trackingZoomBox(int x, int y)
           
 void updateImagePanel()
           
 void updateMousePosition(double x, double y)
          This is used for following the mouse it requres the image coordinates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LINEWIDTH

public final int LINEWIDTH
See Also:
Constant Field Values
Method Detail

hasImage

public boolean hasImage()

updateImagePanel

public void updateImagePanel()

setMarker

public void setMarker(double[] pt)

trackingZoomBox

public void trackingZoomBox(int x,
                            int y)

setZoomInBox

public void setZoomInBox(boolean v)

setZoomIn

public void setZoomIn(boolean v)

setRawData

public void setRawData(java.util.ArrayList<double[]> xv)

addStaticMarker

public void addStaticMarker(double[] pt)

clearStaticMarkers

public void clearStaticMarkers()

setDrawSnake

public void setDrawSnake(boolean v)

setFollow

public void setFollow(boolean v)

setStretchFix

public void setStretchFix(boolean v)

updateMousePosition

public void updateMousePosition(double x,
                                double y)
This is used for following the mouse it requres the image coordinates


drawRawSnake

public void drawRawSnake(ij.process.ImageProcessor improc)
This method is called by updateImagePanel() and draws the points in SnakeRawX and SnakeRawY to the screen connected by a line. Before doing this, it transforms the coordinates in these vectors based on the current zoom status. The new coordinates are then stored in the vectors, SnakeDrawX and SnakeDrawY. If the program is drawing a closed contour, the program will connect the first and last points of the snake.


drawSnake

public void drawSnake(Snake s,
                      ij.process.ImageProcessor improc)

drawSnakes

public void drawSnakes(ij.process.ImageProcessor imp)
Draws all of the snakes in SnakeStore


resetZoom

public void resetZoom()
Sets the zoom box to be the whole image


setZoomLocation

public void setZoomLocation(int x,
                            int y)

fromZoomX

public double fromZoomX(double newX)
this method takes an X coordinates and sets it to its position in the original, un-zoomed, image


fromZoomY

public double fromZoomY(double newY)
this method takes an Y coordinates and sets it to its position in the original, un-zoomed, image


toZoomX

public double toZoomX(double oldX)
this method takes an X coordinate on the original image and finds its new position on a zoomed image


toZoomY

public double toZoomY(double oldY)
takes an Y coordinate on the original image and finds its new position on a zoomed image


toZoom

public double[] toZoom(double[] old)
transform a 2d array


getAndLoadImage

public void getAndLoadImage()
Gets a file name via the swing file chooser dialog


getStackSize

public int getStackSize()

getCounter

public int getCounter()

nextImage

public void nextImage()

previousImage

public void previousImage()

getAveragedValue

public double getAveragedValue(double x,
                               double y,
                               int ss)

getProcessor

public ij.process.ImageProcessor getProcessor()

loadImage

public void loadImage(ij.ImagePlus implus)

setInitializing

public void setInitializing(boolean v)

setCurrentSnake

public void setCurrentSnake(Snake cs)

setSnakes

public void setSnakes(MultipleSnakesStore mss)

getAutoIntensities

public double[] getAutoIntensities()
                            throws java.lang.NullPointerException
Throws:
java.lang.NullPointerException

drawSnake

public static void drawSnake(Snake s,
                             ij.process.ImageProcessor ip,
                             int frame)
This is a static version of drawSnake for use with an external program. It doesn't set the color or anything, it just draws the snake.


getTitle

public java.lang.String getTitle()