snakeprogram3d
Class SnakeImages

java.lang.Object
  extended by snakeprogram3d.SnakeImages

public class SnakeImages
extends java.lang.Object

A class for accessing original and or smoothed image data.


Field Summary
 int FRAMES
           
 double MAXPIXEL
           
 double MINPIXEL
           
 int SLICES
           
 
Method Summary
 boolean checkSnake()
           
 void drawRawSnake(ij.process.ImageProcessor improc)
          This method is called by updateDisplay() and draws the points in SnakeRaw to the screen connected by a line.
 void drawSnake(Snake s, ij.process.ImageProcessor improc)
           
 void drawSnakes(ij.process.ImageProcessor imp)
          Draws all of the snakes in SnakeStore
 double fromZoomX(double newX)
          this method takes an X coordinates and returns its position in the original, un-zoomed, image
 double fromZoomY(double newY)
          this method takes an Y coordinates and returns position in the original, un-zoomed, image
 ij.ImagePlus getAndLoadImage(javax.swing.JFrame xx)
          Gets a file name via the swing file chooser dialog
 double[] getAutoIntensities()
          not a good function
 int getCurrentFrame()
           
 int getCurrentSlice()
           
 double getDepth()
           
 java.io.File getFile()
           
 int getHeight()
           
 int getNFrames()
           
 int getNSlices()
          Returns the total number of slices
 ij.ImagePlus getOriginalPlus()
           
 double getPixel(double x, double y, double z)
          Gets the Smoothed pixel value from the image.
 java.lang.String getTitle()
           
 int getWidth()
           
 double getZResolution()
           
 boolean hasImage()
           
 double heightFromSlice()
          finds the height using the current slice as the reference
 double heightFromSlice(double slice)
          returns the height in PIXELS zero height corresponds to frame 1
 void loadImage(ij.ImagePlus implus)
           
 void nextFrame()
           
 void nextImage()
           
 void previousFrame()
           
 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 setImageSmoothing(double v)
           
 void setInitializing(boolean v)
           
 void setMaxDrawingBounds(int w, int h)
           
 void setRawData(java.util.ArrayList<double[]> xv)
           
 void setSnakes(MultipleSnakesStore mss)
           
 void setZoomIn(boolean v)
           
 void setZoomInBox(boolean v)
           
 void setZoomLocation(int x, int y)
           
 void setZResolution(double value)
          returns the height in PIXELS zero height corresponds to frame 1
 double sliceFromHeight(double height)
          returns the slice as a double, which gives the fraction between slices for interpolating.
 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

SLICES

public int SLICES

FRAMES

public int FRAMES

MAXPIXEL

public double MAXPIXEL

MINPIXEL

public double MINPIXEL
Method Detail

hasImage

public boolean hasImage()

getZResolution

public double getZResolution()

updateImagePanel

public void updateImagePanel()

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)

checkSnake

public boolean checkSnake()

setDrawSnake

public void setDrawSnake(boolean v)

setFollow

public void setFollow(boolean v)

getOriginalPlus

public ij.ImagePlus getOriginalPlus()

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 updateDisplay() and draws the points in SnakeRaw 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 returns its position in the original, un-zoomed, image


fromZoomY

public double fromZoomY(double newY)
this method takes an Y coordinates and returns 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


getAndLoadImage

public ij.ImagePlus getAndLoadImage(javax.swing.JFrame xx)
Gets a file name via the swing file chooser dialog


getNSlices

public int getNSlices()
Returns the total number of slices


getNFrames

public int getNFrames()

getCurrentFrame

public int getCurrentFrame()

getCurrentSlice

public int getCurrentSlice()

nextImage

public void nextImage()

previousImage

public void previousImage()

nextFrame

public void nextFrame()

previousFrame

public void previousFrame()

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()
not a good function


heightFromSlice

public double heightFromSlice(double slice)
returns the height in PIXELS zero height corresponds to frame 1

Parameters:
slice - frame number starts at 1.

heightFromSlice

public double heightFromSlice()
finds the height using the current slice as the reference


sliceFromHeight

public double sliceFromHeight(double height)
returns the slice as a double, which gives the fraction between slices for interpolating. a height of zero corresponds to slice of 1, as per ImageJ slice.


setZResolution

public void setZResolution(double value)
returns the height in PIXELS zero height corresponds to frame 1

Parameters:
value - frame number starts at 1.

getPixel

public double getPixel(double x,
                       double y,
                       double z)
Gets the Smoothed pixel value from the image. This value is smoothed in all three directions.

Parameters:
x - cnet in pixels.
y - cnet in pixels.
z - cnet in pixels.
Returns:
pixel value

getHeight

public int getHeight()
Returns:
height of original image in px

getWidth

public int getWidth()
Returns:
width of original image in px

getDepth

public double getDepth()
Returns:
slices times zresolution

getTitle

public java.lang.String getTitle()

getFile

public java.io.File getFile()

setImageSmoothing

public void setImageSmoothing(double v)

setMaxDrawingBounds

public void setMaxDrawingBounds(int w,
                                int h)