de.unihalle.informatik.MiToBo.core.datatypes.images
Class MTBImageShort

java.lang.Object
  extended by de.unihalle.informatik.Alida.operator.ALDData
      extended by de.unihalle.informatik.MiToBo.core.datatypes.images.MTBImage
          extended by de.unihalle.informatik.MiToBo.core.datatypes.images.MTBImageShort
All Implemented Interfaces:
MTBImageManipulator, java.awt.event.KeyListener, java.util.EventListener

public class MTBImageShort
extends MTBImage

Wrapper class for easy access to Short (hyper)stacks. Voxel indices range is different from ImageJ Here, indices in each dimension range from 0 to (dimSize - 1), while ImageJ stack indices range from 1 to dimSize.

Author:
gress

Nested Class Summary
 
Nested classes/interfaces inherited from class de.unihalle.informatik.MiToBo.core.datatypes.images.MTBImage
MTBImage.FactoryMethod, MTBImage.MTBImageFactory, MTBImage.MTBImageType
 
Field Summary
private  short[][] m_data
          reference to the ImagePlus pixel data
 
Fields inherited from class de.unihalle.informatik.MiToBo.core.datatypes.images.MTBImage
calibration, m_currentC, m_currentSliceIdx, m_currentT, m_img, m_imgStack, m_sizeC, m_sizeStack, m_sizeT, m_sizeX, m_sizeY, m_sizeZ, m_title, m_type, UNTITLED, xml
 
Constructor Summary
protected MTBImageShort(ij.ImagePlus img)
          Constructor
protected MTBImageShort(int sizeX, int sizeY, int sizeZ, int sizeT, int sizeC)
          Constructor
 
Method Summary
 ij.ImagePlus getImagePlus()
          Get an ImagePlus object.
 double[] getMinMaxDouble()
          Get minimum and maximum value of the image as double
 int[] getMinMaxInt()
          Get minimum and maximum value of the image as int
 double getValueDouble(int x, int y)
          Get the value of the actual slice at coordinate (x,y) as an Double
 double getValueDouble(int x, int y, int z)
          Get the voxel value of the actual z-stack at coordinate (x,y,z) No test of coordinate validity
 double getValueDouble(int x, int y, int z, int t, int c)
          Get the voxel value of the 5D image at coordinate (x,y,z,t,c) No test of coordinate validity
 int getValueInt(int x, int y)
          Get the value of the actual slice at coordinate (x,y) as an Integer
 int getValueInt(int x, int y, int z)
          Get the voxel value of the actual z-stack at coordinate (x,y,z) No test of coordinate validity
 int getValueInt(int x, int y, int z, int t, int c)
          Get the voxel value of the 5D image at coordinate (x,y,z,t,c) No test of coordinate validity
 void putValueDouble(int x, int y, double value)
          Set the value of the actual slice at coordinate (x,y) using a Double
 void putValueDouble(int x, int y, int z, double value)
          Set the voxel value of the actual z-stack at coordinate (x,y,z)
 void putValueDouble(int x, int y, int z, int t, int c, double value)
          Set the voxel value of the 5D image at coordinate (x,y,z,t,c)
 void putValueInt(int x, int y, int value)
          Set the value of the actual slice at coordinate (x,y) using an Integer
 void putValueInt(int x, int y, int z, int value)
          Set the voxel value of the actual z-stack at coordinate (x,y,z)
 void putValueInt(int x, int y, int z, int t, int c, int value)
          Set the voxel value of the 5D image at coordinate (x,y,z,t,c)
protected  void updateImagePlus()
          Does nothing, because the underlying ImagePlus is updated immediately when values are changed in the MTBImage
 
Methods inherited from class de.unihalle.informatik.MiToBo.core.datatypes.images.MTBImage
adoptSliceLabels, close, convertType, convertType, copyPhysicalProperties, createMTBImage, createMTBImage, createMTBImageByte, drawLine2D, drawPoint2D, duplicate, duplicate, equals, equalSize, fillBlack, fillWhite, getCalibration, getCurrentSlice, getCurrentSlice, getCurrentSliceCoords, getCurrentSliceIndex, getCurrentSliceLabel, getCurrentZStackCoords, getImagePart, getImagePart, getSizeC, getSizeStack, getSizeT, getSizeX, getSizeY, getSizeZ, getSlice, getSlice, getSliceLabel, getStepsizeT, getStepsizeX, getStepsizeY, getStepsizeZ, getTitle, getTitleRunning, getType, getTypeMax, getTypeMin, getTypeName, getUnitT, getUnitX, getUnitY, getUnitZ, getXML, hasImagePlus, isValidType, keyPressed, keyReleased, keyTyped, ordinalToType, scaleValues, setCalibration, setCurrentSlice, setCurrentSliceCoords, setCurrentSliceIndex, setCurrentSliceLabel, setCurrentZStackCoordinates, setImagePart, setSlice, setSliceLabel, setStepsizeT, setStepsizeX, setStepsizeY, setStepsizeZ, setTitle, setUnitT, setUnitX, setUnitY, setUnitZ, setXML, show, stringToType, toString, updateAndRepaintWindow, updateImageSize_ImgToProp, updatePhysProperties_ImgToProp, updatePhysProperties_PropToImg
 
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDData
cloneProperties, getLocation, getProperty, getPropertyKeys, print, setLocation, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_data

private short[][] m_data
reference to the ImagePlus pixel data

Constructor Detail

MTBImageShort

protected MTBImageShort(ij.ImagePlus img)
Constructor

Parameters:
img -

MTBImageShort

protected MTBImageShort(int sizeX,
                        int sizeY,
                        int sizeZ,
                        int sizeT,
                        int sizeC)
Constructor

Parameters:
sizeX - size in x-dimension
sizeY - size in y-dimension
sizeZ - size in z-dimension
sizeT - size in t-dimension
sizeC - size in c-dimension
Method Detail

getImagePlus

public ij.ImagePlus getImagePlus()
Get an ImagePlus object. A reference to the underlying ImagePlus is returned.

Specified by:
getImagePlus in class MTBImage
Returns:
ImagePlus object

getMinMaxDouble

public double[] getMinMaxDouble()
Get minimum and maximum value of the image as double

Specified by:
getMinMaxDouble in class MTBImage
Returns:
min at double[0], max at double[1]

getMinMaxInt

public int[] getMinMaxInt()
Get minimum and maximum value of the image as int

Specified by:
getMinMaxInt in class MTBImage
Returns:
min at int[0], max at int[1]

getValueDouble

public double getValueDouble(int x,
                             int y)
Get the value of the actual slice at coordinate (x,y) as an Double

Specified by:
getValueDouble in class MTBImage
Parameters:
x - x-coordinate ranging from 0 to (sizeX - 1)
y - y-coordinate ranging from 0 to (sizeY - 1)
Returns:
voxel value

getValueDouble

public double getValueDouble(int x,
                             int y,
                             int z)
Get the voxel value of the actual z-stack at coordinate (x,y,z) No test of coordinate validity

Specified by:
getValueDouble in class MTBImage
Parameters:
x - x-coordinate ranging from 0 to (sizeX - 1)
y - y-coordinate ranging from 0 to (sizeY - 1)
z - z-coordinate ranging from 0 to (sizeZ - 1)
Returns:
value as int

getValueDouble

public double getValueDouble(int x,
                             int y,
                             int z,
                             int t,
                             int c)
Get the voxel value of the 5D image at coordinate (x,y,z,t,c) No test of coordinate validity

Specified by:
getValueDouble in interface MTBImageManipulator
Specified by:
getValueDouble in class MTBImage
Parameters:
x - x-coordinate ranging from 0 to (sizeX - 1)
y - y-coordinate ranging from 0 to (sizeY - 1)
z - z-coordinate ranging from 0 to (sizeZ - 1)
t - t-coordinate ranging from 0 to (sizeT - 1)
c - c-coordinate ranging from 0 to (sizeC - 1)
Returns:
value as double

getValueInt

public int getValueInt(int x,
                       int y)
Get the value of the actual slice at coordinate (x,y) as an Integer

Specified by:
getValueInt in class MTBImage
Parameters:
x - x-coordinate ranging from 0 to (sizeX - 1)
y - y-coordinate ranging from 0 to (sizeY - 1)
Returns:
voxel value

getValueInt

public int getValueInt(int x,
                       int y,
                       int z)
Get the voxel value of the actual z-stack at coordinate (x,y,z) No test of coordinate validity

Specified by:
getValueInt in class MTBImage
Parameters:
x - x-coordinate ranging from 0 to (sizeX - 1)
y - y-coordinate ranging from 0 to (sizeY - 1)
z - z-coordinate ranging from 0 to (sizeZ - 1)
Returns:
value as int

getValueInt

public int getValueInt(int x,
                       int y,
                       int z,
                       int t,
                       int c)
Get the voxel value of the 5D image at coordinate (x,y,z,t,c) No test of coordinate validity

Specified by:
getValueInt in interface MTBImageManipulator
Specified by:
getValueInt in class MTBImage
Parameters:
x - x-coordinate ranging from 0 to (sizeX - 1)
y - y-coordinate ranging from 0 to (sizeY - 1)
z - z-coordinate ranging from 0 to (sizeZ - 1)
t - t-coordinate ranging from 0 to (sizeT - 1)
c - c-coordinate ranging from 0 to (sizeC - 1)
Returns:
value as int

putValueDouble

public void putValueDouble(int x,
                           int y,
                           double value)
Set the value of the actual slice at coordinate (x,y) using a Double

Specified by:
putValueDouble in class MTBImage
Parameters:
x - x-coordinate ranging from 0 to (sizeX - 1)
y - y-coordinate ranging from 0 to (sizeY - 1)
value - to set the voxel to

putValueDouble

public void putValueDouble(int x,
                           int y,
                           int z,
                           double value)
Set the voxel value of the actual z-stack at coordinate (x,y,z)

Specified by:
putValueDouble in class MTBImage
Parameters:
x - x-coordinate ranging from 0 to (sizeX - 1)
y - y-coordinate ranging from 0 to (sizeY - 1)
z - z-coordinate ranging from 0 to (sizeZ - 1)
value - to set the voxel to

putValueDouble

public void putValueDouble(int x,
                           int y,
                           int z,
                           int t,
                           int c,
                           double value)
Set the voxel value of the 5D image at coordinate (x,y,z,t,c)

Specified by:
putValueDouble in interface MTBImageManipulator
Specified by:
putValueDouble in class MTBImage
Parameters:
x - x-coordinate ranging from 0 to (sizeX - 1)
y - y-coordinate ranging from 0 to (sizeY - 1)
z - z-coordinate ranging from 0 to (sizeZ - 1)
t - t-coordinate ranging from 0 to (sizeT - 1)
c - c-coordinate ranging from 0 to (sizeC - 1)
value - to set the voxel to

putValueInt

public void putValueInt(int x,
                        int y,
                        int value)
Set the value of the actual slice at coordinate (x,y) using an Integer

Specified by:
putValueInt in class MTBImage
Parameters:
x - x-coordinate ranging from 0 to (sizeX - 1)
y - y-coordinate ranging from 0 to (sizeY - 1)
value - to set the voxel to

putValueInt

public void putValueInt(int x,
                        int y,
                        int z,
                        int value)
Set the voxel value of the actual z-stack at coordinate (x,y,z)

Specified by:
putValueInt in class MTBImage
Parameters:
x - x-coordinate ranging from 0 to (sizeX - 1)
y - y-coordinate ranging from 0 to (sizeY - 1)
z - z-coordinate ranging from 0 to (sizeZ - 1)
value - to set the voxel to

putValueInt

public void putValueInt(int x,
                        int y,
                        int z,
                        int t,
                        int c,
                        int value)
Set the voxel value of the 5D image at coordinate (x,y,z,t,c)

Specified by:
putValueInt in interface MTBImageManipulator
Specified by:
putValueInt in class MTBImage
Parameters:
x - x-coordinate ranging from 0 to (sizeX - 1)
y - y-coordinate ranging from 0 to (sizeY - 1)
z - z-coordinate ranging from 0 to (sizeZ - 1)
t - t-coordinate ranging from 0 to (sizeT - 1)
c - c-coordinate ranging from 0 to (sizeC - 1)
value - to set the voxel to

updateImagePlus

protected void updateImagePlus()
Does nothing, because the underlying ImagePlus is updated immediately when values are changed in the MTBImage

Specified by:
updateImagePlus in class MTBImage