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

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.MTBImageRGB
All Implemented Interfaces:
MTBImageManipulator, KeyListener, EventListener

public class MTBImageRGB
extends MTBImage

Class for easy access to RGB (hyper)stacks. This image consists of three separate byte images, thus the data is not a reference to ImagePlus data, but is allocated for this MTBImage object. 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
protected  byte[][] m_dataB
          reference to the ImagePlus pixel data (blue channel)
protected  byte[][] m_dataG
          reference to the ImagePlus pixel data (green channel)
protected  byte[][] m_dataR
          reference to the ImagePlus pixel data (red channel)
protected  String[] m_sliceLabels
          slice labels
 
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 MTBImageRGB(ij.ImagePlus img)
          Constructor
protected MTBImageRGB(int sizeX, int sizeY, int sizeZ, int sizeT, int sizeC)
          Constructor
 
Method Summary
 void fillWhite()
           
 MTBImage getChannelB()
          Get a reference to the blue channel image.
 MTBImage getChannelG()
          Get a reference to the green channel image.
 MTBImage getChannelR()
          Get a reference to the red channel image.
 String getCurrentSliceLabel()
          Get the slice label of the slice specified by the actual slice index
 ij.ImagePlus getImagePlus()
          Get an ImagePlus object.
 double[] getMinMaxDouble()
          Get minimum and maximum value of the image (all channels) as double
 int[] getMinMaxInt()
          Get minimum and maximum value of the image as int
 int[] getValue(int x, int y)
          Get RGB value from the specified position in the actual slice.
 int[] getValue(int x, int y, int z, int t, int c)
          Get RGB value from the specified position.
 int getValueB(int x, int y)
          Get blue value from the specified position in the actual slice.
 int getValueB(int x, int y, int z, int t, int c)
          Get blue value from the specified position.
 double getValueDouble(int x, int y)
          Get the value of the actual slice at coordinate (x,y) as a 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 getValueG(int x, int y)
          Get green value from the specified position in the actual slice.
 int getValueG(int x, int y, int z, int t, int c)
          Get green value from the specified position.
 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
 int getValueR(int x, int y)
          Get red value from the specified position in the actual slice.
 int getValueR(int x, int y, int z, int t, int c)
          Get red value from the specified position.
 void putValue(int x, int y, int red, int green, int blue)
          Put a new RGB value at the specified position in the actual slice.
 void putValue(int x, int y, int z, int t, int c, int red, int green, int blue)
          Put a new RGB value at the specified position.
 void putValueB(int x, int y, int blue)
          Put a new blue value at the specified position in the actual slice.
 void putValueB(int x, int y, int z, int t, int c, int blue)
          Put a new blue value at the specified position.
 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 putValueG(int x, int y, int green)
          Put a new green value at the specified position in the actual slice.
 void putValueG(int x, int y, int z, int t, int c, int green)
          Put a new green value at the specified position.
 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)
 void putValueR(int x, int y, int red)
          Put a new red value at the specified position in the actual slice.
 void putValueR(int x, int y, int z, int t, int c, int red)
          Put a new red value at the specified position.
 void setCurrentSliceLabel(String label)
          Set the slice label of the slice specified by the actual slice index
 void setStepsizeT(double stepsize)
          Set the stepsize in t-dimension (timestep)
 void setStepsizeX(double stepsize)
          Set the physical size of a voxel (stepsize) in x-dimension
 void setStepsizeY(double stepsize)
          Set the physical size of a voxel (stepsize) in y-dimension
 void setStepsizeZ(double stepsize)
          Set the physical size of a voxel (stepsize) in z-dimension
 void setTitle(String title)
          Set the images title
 void setUnitT(String unit)
          Set the unit of the t-dimension
 void setUnitX(String unit)
          Set the unit of the x-dimension
 void setUnitY(String unit)
          Set the unit of the y-dimension
 void setUnitZ(String unit)
          Set the unit of the z-dimension
protected  void updateImagePlus()
          Creates or updates an ImagePlus of RGB type from the MTBImage RGB(3 byte-channels) data, can be returned by getImagePlus() or displayed by show()
 
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, getCalibration, getCurrentSlice, getCurrentSlice, getCurrentSliceCoords, getCurrentSliceIndex, 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, setCurrentZStackCoordinates, setImagePart, setSlice, setSliceLabel, 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_dataR

protected byte[][] m_dataR
reference to the ImagePlus pixel data (red channel)


m_dataG

protected byte[][] m_dataG
reference to the ImagePlus pixel data (green channel)


m_dataB

protected byte[][] m_dataB
reference to the ImagePlus pixel data (blue channel)


m_sliceLabels

protected String[] m_sliceLabels
slice labels

Constructor Detail

MTBImageRGB

protected MTBImageRGB(ij.ImagePlus img)
Constructor

Parameters:
img -

MTBImageRGB

protected MTBImageRGB(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

setTitle

public void setTitle(String title)
Set the images title

Overrides:
setTitle in class MTBImage
Parameters:
title -

getImagePlus

public ij.ImagePlus getImagePlus()
Get an ImagePlus object. An ImagePlus object of type ImagePlus.COLOR_RGB is created and returned. This ImagePlus does not share memory with this MTBImage.

Specified by:
getImagePlus in class MTBImage
Returns:
ImagePlus object

updateImagePlus

protected void updateImagePlus()
Creates or updates an ImagePlus of RGB type from the MTBImage RGB(3 byte-channels) data, can be returned by getImagePlus() or displayed by show()

Specified by:
updateImagePlus in class MTBImage

getCurrentSliceLabel

public String getCurrentSliceLabel()
Get the slice label of the slice specified by the actual slice index

Overrides:
getCurrentSliceLabel in class MTBImage
Returns:

setCurrentSliceLabel

public void setCurrentSliceLabel(String label)
Set the slice label of the slice specified by the actual slice index

Overrides:
setCurrentSliceLabel in class MTBImage
Parameters:
label -

setStepsizeX

public void setStepsizeX(double stepsize)
Set the physical size of a voxel (stepsize) in x-dimension

Overrides:
setStepsizeX in class MTBImage
Parameters:
stepsize -

setStepsizeY

public void setStepsizeY(double stepsize)
Set the physical size of a voxel (stepsize) in y-dimension

Overrides:
setStepsizeY in class MTBImage
Parameters:
stepsize -

setStepsizeZ

public void setStepsizeZ(double stepsize)
Set the physical size of a voxel (stepsize) in z-dimension

Overrides:
setStepsizeZ in class MTBImage
Parameters:
stepsize -

setStepsizeT

public void setStepsizeT(double stepsize)
Set the stepsize in t-dimension (timestep)

Overrides:
setStepsizeT in class MTBImage
Parameters:
stepsize -

setUnitX

public void setUnitX(String unit)
Set the unit of the x-dimension

Overrides:
setUnitX in class MTBImage
Parameters:
unit - String of x-dimension unit

setUnitY

public void setUnitY(String unit)
Set the unit of the y-dimension

Overrides:
setUnitY in class MTBImage
Parameters:
unit - String of y-dimension unit

setUnitZ

public void setUnitZ(String unit)
Set the unit of the z-dimension

Overrides:
setUnitZ in class MTBImage
Parameters:
unit - String of z-dimension unit

setUnitT

public void setUnitT(String unit)
Set the unit of the t-dimension

Overrides:
setUnitT in class MTBImage
Parameters:
unit - String of t-dimension unit

getMinMaxDouble

public double[] getMinMaxDouble()
Get minimum and maximum value of the image (all channels) 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,
                             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:
RGB value (three byte-values) stored in an int (like ImageJ), then casted to double

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)
Get the value of the actual slice at coordinate (x,y) as a 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:
RGB value (three byte-values) stored in an int (like ImageJ), then casted to double

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:
RGB value (three byte-values) stored in an int (like ImageJ)

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)
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:
RGB value (three byte-values) stored in an int (like ImageJ)

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)
RGB - value (three byte-values) stored in an int (like ImageJ), then casted to double

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,
                           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)
RGB - value (three byte-values) stored in an int (like ImageJ), then casted to double

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)
RGB - value (three byte-values) stored in an int (like ImageJ)

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 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)
RGB - value (three byte-values) stored in an int (like ImageJ)

getValue

public int[] getValue(int x,
                      int y,
                      int z,
                      int t,
                      int c)
Get RGB value from the specified position.

Parameters:
x -
y -
z -
t -
c -
Returns:
3-element array with red[0], green[1], blue[2] values

getValue

public int[] getValue(int x,
                      int y)
Get RGB value from the specified position in the actual slice.

Parameters:
x -
y -
Returns:
3-element array with red[0], green[1], blue[2] values

putValue

public void putValue(int x,
                     int y,
                     int z,
                     int t,
                     int c,
                     int red,
                     int green,
                     int blue)
Put a new RGB value at the specified position. RGB values must be in the range [0, 255]

Parameters:
x -
y -
z -
t -
c -
red -
green -
blue -

putValue

public void putValue(int x,
                     int y,
                     int red,
                     int green,
                     int blue)
Put a new RGB value at the specified position in the actual slice. RGB values must be in the range [0, 255]

Parameters:
x -
y -
red -
green -
blue -

getValueR

public int getValueR(int x,
                     int y,
                     int z,
                     int t,
                     int c)
Get red value from the specified position.

Parameters:
x -
y -
z -
t -
c -
Returns:
red value

getValueR

public int getValueR(int x,
                     int y)
Get red value from the specified position in the actual slice.

Parameters:
x -
y -
Returns:
red value

getValueG

public int getValueG(int x,
                     int y,
                     int z,
                     int t,
                     int c)
Get green value from the specified position.

Parameters:
x -
y -
z -
t -
c -
Returns:
green value

getValueG

public int getValueG(int x,
                     int y)
Get green value from the specified position in the actual slice.

Parameters:
x -
y -
Returns:
green value

getValueB

public int getValueB(int x,
                     int y,
                     int z,
                     int t,
                     int c)
Get blue value from the specified position.

Parameters:
x -
y -
z -
t -
c -
Returns:
blue value

getValueB

public int getValueB(int x,
                     int y)
Get blue value from the specified position in the actual slice.

Parameters:
x -
y -
Returns:
blue value

putValueR

public void putValueR(int x,
                      int y,
                      int z,
                      int t,
                      int c,
                      int red)
Put a new red value at the specified position. Red values must be in the range [0, 255]

Parameters:
x -
y -
z -
t -
c -
red -

putValueR

public void putValueR(int x,
                      int y,
                      int red)
Put a new red value at the specified position in the actual slice. Red values must be in the range [0, 255]

Parameters:
x -
y -
red -

putValueG

public void putValueG(int x,
                      int y,
                      int z,
                      int t,
                      int c,
                      int green)
Put a new green value at the specified position. Green values must be in the range [0, 255]

Parameters:
x -
y -
z -
t -
c -
green -

putValueG

public void putValueG(int x,
                      int y,
                      int green)
Put a new green value at the specified position in the actual slice. Green values must be in the range [0, 255]

Parameters:
x -
y -
green -

putValueB

public void putValueB(int x,
                      int y,
                      int z,
                      int t,
                      int c,
                      int blue)
Put a new blue value at the specified position. Blue values must be in the range [0, 255]

Parameters:
x -
y -
z -
t -
c -
blue -

putValueB

public void putValueB(int x,
                      int y,
                      int blue)
Put a new blue value at the specified position in the actual slice. Blue values must be in the range [0, 255]

Parameters:
x -
y -
blue -

getChannelR

public MTBImage getChannelR()
Get a reference to the red channel image.

Returns:
MTBImage of type MTB_BYTE

getChannelG

public MTBImage getChannelG()
Get a reference to the green channel image.

Returns:
MTBImage of type MTB_BYTE

getChannelB

public MTBImage getChannelB()
Get a reference to the blue channel image.

Returns:
MTBImage of type MTB_BYTE

fillWhite

public void fillWhite()
Overrides:
fillWhite in class MTBImage


Copyright © 2010–2015 Martin Luther University Halle-Wittenberg. All rights reserved.