ini.trakem2.imaging
Class PatchStack

java.lang.Object
  extended by ij.ImagePlus
      extended by ini.trakem2.imaging.PatchStack
All Implemented Interfaces:
ij.measure.Measurements, java.awt.image.ImageObserver

public class PatchStack
extends ij.ImagePlus

Assumed is all Patch instances in the array are of the same size, live in consecutive layers of the same thickness. The superclass ImagePlus uses the 'ip' pointer for a single ImageProcessor whose pixels get replaced every time a new slice is selected from the stack, when there is a stack. Here the 'ip' pointer is used for the current slice, which is the currently active Patch.


Field Summary
 
Fields inherited from class ij.ImagePlus
changes, CLOSED, COLOR_256, COLOR_RGB, compositeImage, currentSlice, GRAY16, GRAY32, GRAY8, height, img, ip, locked, nChannels, nFrames, nSlices, OPENED, roi, UPDATED, width, win
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Fields inherited from interface ij.measure.Measurements
AREA, AREA_FRACTION, CENTER_OF_MASS, CENTROID, CIRCULARITY, ELLIPSE, FERET, INTEGRATED_DENSITY, INVERT_Y, KURTOSIS, LABELS, LIMIT, MAX_STANDARDS, MEAN, MEDIAN, MIN_MAX, MODE, PERIMETER, RECT, SCIENTIFIC_NOTATION, SHAPE_DESCRIPTORS, SKEWNESS, SLICE, STACK_POSITION, STD_DEV
 
Constructor Summary
PatchStack(Patch[] patch, int currentSlice)
           
 
Method Summary
 void close()
           
 boolean contains(Patch p)
           
 void copy(boolean cut)
           
 ij.ImagePlus createColor256Copy()
          Does not respect local transform of the patches, this is intended for confocal stacks.
 ij.ImageStack createEmptyStack()
           
 ij.ImagePlus createGray8Copy()
          Does not respect local transform of the patches, this is intended for confocal stacks.
 ij.LookUpTable createLut()
           
 void createNewRoi(int sx, int sy)
           
 void decacheAll()
          Remove all awts and snaps from the loader's cache, and repaint (which will remake as many as needed)
 void draw()
           
 void draw(int x, int y, int width, int height)
           
 void flush()
           
 int getBitDepth()
           
 java.awt.Rectangle getBounds()
          Assumes all patches are of the same dimensions.
 ij.measure.Calibration getCalibration()
           
 Patch getCurrentPatch()
          Returns the Patch corresponding to the current slice.
 int getCurrentSlice()
           
 int[] getDimensions()
          Override to return width, height, 1, patch.length, 1
 ij.io.FileInfo getFileInfo()
           
 java.awt.Image getImage()
           
 ij.ImageStack getImageStack()
           
 ij.measure.Calibration getLocalCalibration()
           
 ij.process.ImageProcessor getMask()
           
 int getNChannels()
          Override to return 1.
 int getNFrames()
          Override to return 1.
 int getNSlices()
           
 Patch getPatch(int i)
          From 0 to getNSlices() -1, otherwise null.
 Patch getPatch(Layer layer, Patch p)
          If the 'p' is contained in this PatchStack, get the first Patch found to be contained here and in the given 'layer'
 int[] getPixel(int x, int y)
           
 ij.process.ImageProcessor getProcessor()
           
 java.util.Properties getProperties()
           
 java.lang.Object getProperty(java.lang.String key)
           
 ij.gui.Roi getRoi()
           
 ij.ImageStack getStack()
           
 int getStackIndex(int channel, int slice, int frame)
           
 int getStackSize()
           
 ij.process.ImageStatistics getStatistics(int nOptions, int nBins, double histMin, double histMax)
           
 java.lang.String getTitle()
           
 int getType()
           
 void hide()
           
 void invertLookupTable()
           
 boolean isInvertedLut()
           
 boolean isProcessor()
           
 void killRoi()
           
 void paste()
           
 void repaintWindow()
           
 void resetNonActive()
          Reset temporary changes such as from dragging B&C sliders and so on, in the current slice (the current Patch).
 void revert(Patch p)
           
 void revertAll()
           
 void saveImages()
          Store working copies and remake the awts and repaint.
 void saveRoi()
           
 void setCalibration(ij.measure.Calibration cal)
           
 void setColor(java.awt.Color c)
           
 void setCurrentSlice(Patch p)
           
 void setDimensions(int nChannels, int nSlices, int nFrames)
           
 void setFileInfo(ij.io.FileInfo fi)
           
 void setImage(java.awt.Image img)
           
 void setPosition(int channel, int slice, int frame)
           
 void setProcessor(java.lang.String title, ij.process.ImageProcessor ip)
           
 void setProperty(java.lang.String key, java.lang.Object value)
           
 void setRoi(java.awt.Rectangle r)
           
 void setRoi(ij.gui.Roi roi)
           
 void setSlice(int index)
           
 void setStack(java.lang.String title, ij.ImageStack stack)
           
 void setTitle(java.lang.String title)
           
protected  void setType(int type)
           
 void setWindow(java.awt.Window win)
           
 void show()
           
 void show(java.lang.String statusMessage)
           
 void trimProcessor()
           
 void updateAndDraw()
           
 void updateAndRepaintWindow()
           
 void updateImage()
           
 
Methods inherited from class ij.ImagePlus
addImageListener, convertIndexToPosition, copyScale, createHyperStack, createImagePlus, duplicate, flatten, getBufferedImage, getBytesPerPixel, getCanvas, getChannel, getChannelProcessor, getClipboard, getDefault16bitRange, getDisplayList, getDisplayRangeMax, getDisplayRangeMin, getFrame, getGlobalCalibration, getHeight, getHideOverlay, getID, getImageStackSize, getLocationAsString, getLuts, getNDimensions, getOpenAsHyperStack, getOriginalFileInfo, getOverlay, getShortTitle, getSlice, getStartTime, getStatistics, getStatistics, getStatistics, getWidth, getWindow, imageUpdate, isComposite, isDisplayedHyperStack, isHyperStack, isLocked, isVisible, killProcessor, killStack, lock, lockSilently, mouseMoved, notifyListeners, removeImageListener, resetClipboard, resetDisplayRange, resetStack, restoreRoi, revert, setActivated, setDefault16bitRange, setDisplayList, setDisplayList, setDisplayRange, setDisplayRange, setGlobalCalibration, setHideOverlay, setIgnoreFlush, setOpenAsHyperStack, setOverlay, setOverlay, setOverlay, setPosition, setPositionWithoutUpdate, setProcessor, setRoi, setRoi, setSliceWithoutUpdate, setStack, setStack, setWindow, startTiming, toString, unlock, updateChannelAndDraw, updatePosition, updateStatusbarValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PatchStack

public PatchStack(Patch[] patch,
                  int currentSlice)
Method Detail

getBounds

public java.awt.Rectangle getBounds()
Assumes all patches are of the same dimensions.


contains

public boolean contains(Patch p)

getPatch

public Patch getPatch(Layer layer,
                      Patch p)
If the 'p' is contained in this PatchStack, get the first Patch found to be contained here and in the given 'layer'


getPatch

public Patch getPatch(int i)
From 0 to getNSlices() -1, otherwise null.


getCurrentPatch

public Patch getCurrentPatch()
Returns the Patch corresponding to the current slice.


setCurrentSlice

public void setCurrentSlice(Patch p)

revert

public void revert(Patch p)

revertAll

public void revertAll()

resetNonActive

public void resetNonActive()
Reset temporary changes such as from dragging B&C sliders and so on, in the current slice (the current Patch).


saveImages

public void saveImages()
Store working copies and remake the awts and repaint.


draw

public void draw()
Overrides:
draw in class ij.ImagePlus

draw

public void draw(int x,
                 int y,
                 int width,
                 int height)
Overrides:
draw in class ij.ImagePlus

updateAndDraw

public void updateAndDraw()
Overrides:
updateAndDraw in class ij.ImagePlus

repaintWindow

public void repaintWindow()
Overrides:
repaintWindow in class ij.ImagePlus

updateAndRepaintWindow

public void updateAndRepaintWindow()
Overrides:
updateAndRepaintWindow in class ij.ImagePlus

updateImage

public void updateImage()
Overrides:
updateImage in class ij.ImagePlus

hide

public void hide()
Overrides:
hide in class ij.ImagePlus

close

public void close()
Overrides:
close in class ij.ImagePlus

show

public void show()
Overrides:
show in class ij.ImagePlus

show

public void show(java.lang.String statusMessage)
Overrides:
show in class ij.ImagePlus

invertLookupTable

public void invertLookupTable()

getImage

public java.awt.Image getImage()
Overrides:
getImage in class ij.ImagePlus

setImage

public void setImage(java.awt.Image img)
Overrides:
setImage in class ij.ImagePlus

setProcessor

public void setProcessor(java.lang.String title,
                         ij.process.ImageProcessor ip)
Overrides:
setProcessor in class ij.ImagePlus

setStack

public void setStack(java.lang.String title,
                     ij.ImageStack stack)
Overrides:
setStack in class ij.ImagePlus

setFileInfo

public void setFileInfo(ij.io.FileInfo fi)
Overrides:
setFileInfo in class ij.ImagePlus

setWindow

public void setWindow(java.awt.Window win)

setColor

public void setColor(java.awt.Color c)
Overrides:
setColor in class ij.ImagePlus

isProcessor

public boolean isProcessor()
Overrides:
isProcessor in class ij.ImagePlus

getProcessor

public ij.process.ImageProcessor getProcessor()
Overrides:
getProcessor in class ij.ImagePlus

trimProcessor

public void trimProcessor()
Overrides:
trimProcessor in class ij.ImagePlus

getMask

public ij.process.ImageProcessor getMask()
Overrides:
getMask in class ij.ImagePlus

getStatistics

public ij.process.ImageStatistics getStatistics(int nOptions,
                                                int nBins,
                                                double histMin,
                                                double histMax)
Overrides:
getStatistics in class ij.ImagePlus

getTitle

public java.lang.String getTitle()
Overrides:
getTitle in class ij.ImagePlus

setTitle

public void setTitle(java.lang.String title)
Overrides:
setTitle in class ij.ImagePlus

getStackSize

public int getStackSize()
Overrides:
getStackSize in class ij.ImagePlus

setDimensions

public void setDimensions(int nChannels,
                          int nSlices,
                          int nFrames)
Overrides:
setDimensions in class ij.ImagePlus

getNChannels

public int getNChannels()
Override to return 1.

Overrides:
getNChannels in class ij.ImagePlus

getNSlices

public int getNSlices()
Overrides:
getNSlices in class ij.ImagePlus

getNFrames

public int getNFrames()
Override to return 1.

Overrides:
getNFrames in class ij.ImagePlus

getDimensions

public int[] getDimensions()
Override to return width, height, 1, patch.length, 1

Overrides:
getDimensions in class ij.ImagePlus

getType

public int getType()
Overrides:
getType in class ij.ImagePlus

getBitDepth

public int getBitDepth()
Overrides:
getBitDepth in class ij.ImagePlus

setType

protected void setType(int type)
Overrides:
setType in class ij.ImagePlus

setProperty

public void setProperty(java.lang.String key,
                        java.lang.Object value)
Overrides:
setProperty in class ij.ImagePlus

getProperty

public java.lang.Object getProperty(java.lang.String key)
Overrides:
getProperty in class ij.ImagePlus

getProperties

public java.util.Properties getProperties()
Overrides:
getProperties in class ij.ImagePlus

createLut

public ij.LookUpTable createLut()
Overrides:
createLut in class ij.ImagePlus

isInvertedLut

public boolean isInvertedLut()
Overrides:
isInvertedLut in class ij.ImagePlus

getPixel

public int[] getPixel(int x,
                      int y)
Overrides:
getPixel in class ij.ImagePlus

createEmptyStack

public ij.ImageStack createEmptyStack()
Overrides:
createEmptyStack in class ij.ImagePlus

getStack

public ij.ImageStack getStack()
Overrides:
getStack in class ij.ImagePlus

getImageStack

public ij.ImageStack getImageStack()
Overrides:
getImageStack in class ij.ImagePlus

getCurrentSlice

public int getCurrentSlice()
Overrides:
getCurrentSlice in class ij.ImagePlus

setSlice

public void setSlice(int index)
Overrides:
setSlice in class ij.ImagePlus

getRoi

public ij.gui.Roi getRoi()
Overrides:
getRoi in class ij.ImagePlus

setRoi

public void setRoi(ij.gui.Roi roi)
Overrides:
setRoi in class ij.ImagePlus

setRoi

public void setRoi(java.awt.Rectangle r)
Overrides:
setRoi in class ij.ImagePlus

createNewRoi

public void createNewRoi(int sx,
                         int sy)
Overrides:
createNewRoi in class ij.ImagePlus

killRoi

public void killRoi()
Overrides:
killRoi in class ij.ImagePlus

saveRoi

public void saveRoi()
Overrides:
saveRoi in class ij.ImagePlus

getFileInfo

public ij.io.FileInfo getFileInfo()
Overrides:
getFileInfo in class ij.ImagePlus

flush

public void flush()
Overrides:
flush in class ij.ImagePlus

getCalibration

public ij.measure.Calibration getCalibration()
Overrides:
getCalibration in class ij.ImagePlus

setCalibration

public void setCalibration(ij.measure.Calibration cal)
Overrides:
setCalibration in class ij.ImagePlus

getLocalCalibration

public ij.measure.Calibration getLocalCalibration()
Overrides:
getLocalCalibration in class ij.ImagePlus

copy

public void copy(boolean cut)
Overrides:
copy in class ij.ImagePlus

paste

public void paste()
Overrides:
paste in class ij.ImagePlus

decacheAll

public void decacheAll()
Remove all awts and snaps from the loader's cache, and repaint (which will remake as many as needed)


setPosition

public void setPosition(int channel,
                        int slice,
                        int frame)
Overrides:
setPosition in class ij.ImagePlus

getStackIndex

public int getStackIndex(int channel,
                         int slice,
                         int frame)
Overrides:
getStackIndex in class ij.ImagePlus

createGray8Copy

public ij.ImagePlus createGray8Copy()
Does not respect local transform of the patches, this is intended for confocal stacks.


createColor256Copy

public ij.ImagePlus createColor256Copy()
Does not respect local transform of the patches, this is intended for confocal stacks.