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

java.lang.Object
  extended by de.unihalle.informatik.MiToBo.core.datatypes.images.MTBImageWindow
All Implemented Interfaces:
MTBImageManipulator

@ALDMetaInfo(export=MANDATORY)
public class MTBImageWindow
extends Object
implements MTBImageManipulator

Class for windowing a MTBImage. Creates a hyperrectangle window over a MTBImage to access sectors of the image (volume) easily. Translation of the window is supported.

Author:
gress

Nested Class Summary
static class MTBImageWindow.BoundaryPadding
          Padding of image: Method of how to obtain pixel values outside the image domain
 
Field Summary
protected  MTBImageManipulator m_impulator
          source image on which the window is applied
protected  MTBImageWindow.BoundaryPadding m_padMode
          padding mode for nonexistent values (outside the underlying image), see static finals
protected  int m_posC
          current c-position of the window in the source image
protected  int m_posT
          current t-position of the window in the source image
protected  int m_posX
          current x-position of the window in the source image
protected  int m_posY
          current y-position of the window in the source image
protected  int m_posZ
          current z-position of the window in the source image
protected  int m_sizeC
          size of the window in c-dimension
protected  int m_sizeT
          size of the window in t-dimension
protected  int m_sizeX
          size of the window in x-dimension
protected  int m_sizeY
          size of the window in y-dimension
protected  int m_sizeZ
          size of the window in z-dimension
 
Constructor Summary
MTBImageWindow(int sizeX, int sizeY, int sizeZ, int sizeT, int sizeC, MTBImageManipulator sourceImage, MTBImageWindow.BoundaryPadding paddingMode)
          Create a new window on a given source MTBImageManipulator (i.e.
 
Method Summary
 MTBImage createImageFromWindow()
           
 int getSizeC()
          Get window size in c-dimension
 int getSizeT()
          Get window size in t-dimension
 int getSizeX()
          Get window size in x-dimension
 int getSizeY()
          Get window size in y-dimension
 int getSizeZ()
          Get window size in z-dimension
 double getStepsizeT()
          Get the stepsize in t-dimension (timestep)
 double getStepsizeX()
          Get the physical size of a voxel (stepsize) in x-dimension
 double getStepsizeY()
          Get the physical size of a voxel (stepsize) in y-dimension
 double getStepsizeZ()
          Get the physical size of a voxel (stepsize) in z-dimension
 String getTitle()
          Get title of underlying image
 MTBImage.MTBImageType getType()
          Get underlying data type
 String getUnitT()
          Get the unit of the t-dimension
 String getUnitX()
          Get the unit of the x-dimension
 String getUnitY()
          Get the unit of the y-dimension
 String getUnitZ()
          Get the unit of the z-dimension
 double getValueDouble(int x, int y, int z, int t, int c)
          Get the value of the 5D image at coordinate (x,y,z,t,c) as a Double
 int getValueInt(int x, int y, int z, int t, int c)
          Get the value of the 5D image at coordinate (x,y,z,t,c) as an Integer
 int[] getWindowPosition()
          Get the current window position
 void incrPositionC()
          Increment the window's position by 1 in the c-dimension
 void incrPositionC(int increment)
          Increment the window's position by 'increment' in the c-dimension
 void incrPositionT()
          Increment the window's position by 1 in the t-dimension
 void incrPositionT(int increment)
          Increment the window's position by 'increment' in the t-dimension
 void incrPositionX()
          Increment the window's position by 1 in the x-dimension
 void incrPositionX(int increment)
          Increment the window's position by 'increment' in the x-dimension
 void incrPositionY()
          Increment the window's position by 1 in the y-dimension
 void incrPositionY(int increment)
          Increment the window's position by 'increment' in the y-dimension
 void incrPositionZ()
          Increment the window's position by 1 in the z-dimension
 void incrPositionZ(int increment)
          Increment the window's position by 'increment' in the z-dimension
 void putValueDouble(int x, int y, int z, int t, int c, double value)
          Set the value of the 5D image at coordinate (x,y,z,t,c) using a Double
 void putValueInt(int x, int y, int z, int t, int c, int value)
          Set the value of the 5D image at coordinate (x,y,z,t,c) using an Integer
 void setPositionC(int c)
          Set the window's position to 'c' in the c-dimension
 void setPositionT(int t)
          Set the window's position to 't' in the t-dimension
 void setPositionX(int x)
          Set the window's position to 'x' in the x-dimension
 void setPositionY(int y)
          Set the window's position to 'y' in the y-dimension
 void setPositionZ(int z)
          Set the window's position to 'z' in the z-dimension
 void setSource(MTBImageManipulator sourceImage)
          Set a new source for the window.
 void setWindowPosition(int x, int y, int z, int t, int c)
          Set the window's position in the source image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_sizeX

protected int m_sizeX
size of the window in x-dimension


m_sizeY

protected int m_sizeY
size of the window in y-dimension


m_sizeZ

protected int m_sizeZ
size of the window in z-dimension


m_sizeT

protected int m_sizeT
size of the window in t-dimension


m_sizeC

protected int m_sizeC
size of the window in c-dimension


m_impulator

protected MTBImageManipulator m_impulator
source image on which the window is applied


m_posX

protected int m_posX
current x-position of the window in the source image


m_posY

protected int m_posY
current y-position of the window in the source image


m_posZ

protected int m_posZ
current z-position of the window in the source image


m_posT

protected int m_posT
current t-position of the window in the source image


m_posC

protected int m_posC
current c-position of the window in the source image


m_padMode

protected MTBImageWindow.BoundaryPadding m_padMode
padding mode for nonexistent values (outside the underlying image), see static finals

Constructor Detail

MTBImageWindow

public MTBImageWindow(int sizeX,
                      int sizeY,
                      int sizeZ,
                      int sizeT,
                      int sizeC,
                      MTBImageManipulator sourceImage,
                      MTBImageWindow.BoundaryPadding paddingMode)
Create a new window on a given source MTBImageManipulator (i.e. MTBImage or MTBImageWindow).

Parameters:
sizeX - size of the window in x-dimension
sizeY - size of the window in y-dimension
sizeZ - size of the window in z-dimension
sizeT - size of the window in t-dimension
sizeC - size of the window in c-dimension
sourceImage - source image on which the window is applied
paddingMode -
Method Detail

setSource

public void setSource(MTBImageManipulator sourceImage)
Set a new source for the window. The window's position and size stay as they are.

Parameters:
sourceImage - source image on which the window is applied

createImageFromWindow

public MTBImage createImageFromWindow()

getTitle

public String getTitle()
Get title of underlying image

Specified by:
getTitle in interface MTBImageManipulator
Returns:

getType

public MTBImage.MTBImageType getType()
Get underlying data type

Specified by:
getType in interface MTBImageManipulator
Returns:
data type ID

getSizeX

public int getSizeX()
Get window size in x-dimension

Specified by:
getSizeX in interface MTBImageManipulator
Returns:
size of x-dimension

getSizeY

public int getSizeY()
Get window size in y-dimension

Specified by:
getSizeY in interface MTBImageManipulator
Returns:
size of y-dimension

getSizeZ

public int getSizeZ()
Get window size in z-dimension

Specified by:
getSizeZ in interface MTBImageManipulator
Returns:
size of z-dimension

getSizeT

public int getSizeT()
Get window size in t-dimension

Specified by:
getSizeT in interface MTBImageManipulator
Returns:
size of t(ime)-dimension

getSizeC

public int getSizeC()
Get window size in c-dimension

Specified by:
getSizeC in interface MTBImageManipulator
Returns:
size of c(hannel)-dimension

getValueDouble

public double getValueDouble(int x,
                             int y,
                             int z,
                             int t,
                             int c)
Get the value of the 5D image at coordinate (x,y,z,t,c) as a Double

Specified by:
getValueDouble in interface MTBImageManipulator
Parameters:
x - x-coordinate
y - y-coordinate
z - z-coordinate
t - t-coordinate
c - c-coordinate
Returns:
voxel value

getValueInt

public int getValueInt(int x,
                       int y,
                       int z,
                       int t,
                       int c)
Get the value of the 5D image at coordinate (x,y,z,t,c) as an Integer

Specified by:
getValueInt in interface MTBImageManipulator
Parameters:
x - x-coordinate
y - y-coordinate
z - z-coordinate
t - t-coordinate
c - c-coordinate
Returns:
voxel value

putValueDouble

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

Specified by:
putValueDouble in interface MTBImageManipulator
Parameters:
x - x-coordinate
y - y-coordinate
z - z-coordinate
t - t-coordinate
c - c-coordinate
value - to set the voxel to

putValueInt

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

Specified by:
putValueInt in interface MTBImageManipulator
Parameters:
x - x-coordinate
y - y-coordinate
z - z-coordinate
t - t-coordinate
c - c-coordinate
value - to set the voxel to

setWindowPosition

public void setWindowPosition(int x,
                              int y,
                              int z,
                              int t,
                              int c)
Set the window's position in the source image. Set the position of the (upper left) window coordinate (0,0,0,0,0) to the specified position in the source image.

Parameters:
x - x-coordinate in source image
y - y-coordinate in source image
z - z-coordinate in source image
t - t-coordinate in source image
c - c-coordinate in source image

getWindowPosition

public int[] getWindowPosition()
Get the current window position

Returns:
window position ([0]=x-position, [1]=y-position, [2]=z-position, [3]=t-position, [4]=c-position)

incrPositionX

public void incrPositionX()
Increment the window's position by 1 in the x-dimension


incrPositionX

public void incrPositionX(int increment)
Increment the window's position by 'increment' in the x-dimension

Parameters:
increment -

incrPositionY

public void incrPositionY()
Increment the window's position by 1 in the y-dimension


incrPositionY

public void incrPositionY(int increment)
Increment the window's position by 'increment' in the y-dimension

Parameters:
increment -

incrPositionZ

public void incrPositionZ()
Increment the window's position by 1 in the z-dimension


incrPositionZ

public void incrPositionZ(int increment)
Increment the window's position by 'increment' in the z-dimension

Parameters:
increment -

incrPositionT

public void incrPositionT()
Increment the window's position by 1 in the t-dimension


incrPositionT

public void incrPositionT(int increment)
Increment the window's position by 'increment' in the t-dimension

Parameters:
increment -

incrPositionC

public void incrPositionC()
Increment the window's position by 1 in the c-dimension


incrPositionC

public void incrPositionC(int increment)
Increment the window's position by 'increment' in the c-dimension

Parameters:
increment -

setPositionX

public void setPositionX(int x)
Set the window's position to 'x' in the x-dimension

Parameters:
x -

setPositionY

public void setPositionY(int y)
Set the window's position to 'y' in the y-dimension

Parameters:
y -

setPositionZ

public void setPositionZ(int z)
Set the window's position to 'z' in the z-dimension

Parameters:
z -

setPositionT

public void setPositionT(int t)
Set the window's position to 't' in the t-dimension

Parameters:
t -

setPositionC

public void setPositionC(int c)
Set the window's position to 'c' in the c-dimension

Parameters:
c -

getStepsizeX

public double getStepsizeX()
Get the physical size of a voxel (stepsize) in x-dimension

Specified by:
getStepsizeX in interface MTBImageManipulator
Returns:
physical voxel size in x-dimension

getStepsizeY

public double getStepsizeY()
Get the physical size of a voxel (stepsize) in y-dimension

Specified by:
getStepsizeY in interface MTBImageManipulator
Returns:
physical voxel size in y-dimension

getStepsizeZ

public double getStepsizeZ()
Get the physical size of a voxel (stepsize) in z-dimension

Specified by:
getStepsizeZ in interface MTBImageManipulator
Returns:
physical voxel size in z-dimension

getStepsizeT

public double getStepsizeT()
Get the stepsize in t-dimension (timestep)

Specified by:
getStepsizeT in interface MTBImageManipulator
Returns:
time stepsize

getUnitX

public String getUnitX()
Get the unit of the x-dimension

Specified by:
getUnitX in interface MTBImageManipulator
Returns:
String of x-dimension's unit

getUnitY

public String getUnitY()
Get the unit of the y-dimension

Specified by:
getUnitY in interface MTBImageManipulator
Returns:
String of y-dimension's unit

getUnitZ

public String getUnitZ()
Get the unit of the z-dimension

Specified by:
getUnitZ in interface MTBImageManipulator
Returns:
String of z-dimension's unit

getUnitT

public String getUnitT()
Get the unit of the t-dimension

Specified by:
getUnitT in interface MTBImageManipulator
Returns:
String of t-dimension's unit


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