public abstract class MTBImage extends de.unihalle.informatik.Alida.operator.ALDData implements MTBImageManipulator, KeyListener
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. Subclasses implement the wrapper for different types.
Modifier and Type | Class and Description |
---|---|
protected static class |
MTBImage.FactoryMethod
methods to create new image from an existing one. used in MTBImageFactory
|
class |
MTBImage.MTBImageFactory
A class for creating MTBImages which implements the MTBOperator.
|
static class |
MTBImage.MTBImageType
MiToBo image types
|
Modifier and Type | Field and Description |
---|---|
protected ij.measure.Calibration |
calibration
calibration object (from ImageJ)
|
protected int |
m_currentC
current c-coordinate, for 3D only access functions
|
protected int |
m_currentSliceIdx
Index of the current slice.
|
protected int |
m_currentT
current t-coordinate, for 3D only access functions
|
protected ij.ImagePlus |
m_img
the underlying ImagePlus object
|
protected ij.ImageStack |
m_imgStack
reference to the ImageStack object of the underlying ImagePlus object
|
protected int |
m_sizeC
size of c-dimension
|
protected int |
m_sizeStack
stacksize
|
protected int |
m_sizeT
size of t-dimension
|
protected int |
m_sizeX
size of x-dimension
|
protected int |
m_sizeY
size of y-dimension
|
protected int |
m_sizeZ
size of z-dimension
|
private String |
m_title
Image title
This member is private to enforce access via the corresponding
setter/getter only.
|
protected MTBImage.MTBImageType |
m_type
MiToBo image type
|
static String |
UNTITLED
Title string for new and untitled images
|
protected String |
xml
File description XML string if available
|
Modifier | Constructor and Description |
---|---|
protected |
MTBImage()
Constructor for initializing an empty image (dimension sizes = -1).
|
protected |
MTBImage(ij.ImagePlus img)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
adoptSliceLabels(MTBImage src)
Copy slice labels from src to this
|
void |
close()
Close the displayed ImagePlus
|
MTBImage |
convertType(MTBImage.MTBImageType type,
boolean scaleDown)
Create an image of given type from this image's values.
|
MTBImage |
convertType(MTBOperator callingOperator,
MTBImage.MTBImageType type,
boolean scaleDown)
Create an image of given type from this image's values.
|
void |
copyPhysicalProperties(MTBImage sourceImg)
Copy physical properties like stepsizes and units from
{#sourceImg} to this.
|
static MTBImage |
createMTBImage(ij.ImagePlus img)
Factory method to create MTBImage objects.
|
static MTBImage |
createMTBImage(int sizeX,
int sizeY,
int sizeZ,
int sizeT,
int sizeC,
MTBImage.MTBImageType type)
Factory method to create MTBImage objects with value 0 at each coordinate.
|
static MTBImageByte |
createMTBImageByte(int sizeX,
int sizeY,
int sizeZ,
int sizeT,
int sizeC,
byte[][] data)
Creates an image of type
MTBImage.MTBImageType.MTB_BYTE from
the given data array. |
void |
drawCircle2D(int x,
int y,
int z,
int radius,
int color)
Draws a circle at the given position into the x-y-plane.
|
void |
drawFilledCircle2D(int x,
int y,
int z,
int radius,
int color)
Draws a 2D circle at the given z position into the x-y-plane.
|
void |
drawLine2D(int xstart,
int ystart,
int xend,
int yend,
int value)
Draws a 2D line into the current slice of the image.
|
void |
drawLine2D(int xstart,
int ystart,
int xend,
int yend,
int z,
int t,
int c,
int value)
Draws a 2D line into the given slice of the image.
|
void |
drawPoint2D(int x,
int y,
int z,
int value,
int mode)
Draws a point at given position into the x-y-plane.
|
MTBImage |
duplicate()
Duplicates the object.
|
MTBImage |
duplicate(de.unihalle.informatik.Alida.operator.ALDOperator.HidingMode h)
Duplicates the object.
|
MTBImage |
duplicate(MTBOperator callingOperator)
Deprecated.
|
boolean |
equals(MTBImage img)
Test if this object and img are of same type, have same size and same
values
|
boolean |
equalSize(MTBImage img)
Test if this object and img have the same size in x-, y-, z-, t- and
c-dimension
|
void |
fillBlack()
Set all pixels of the image to black, i.e. the minimal available value.
|
void |
fillWhite()
Set all pixels of the image to white, i.e. the maximal available value.
|
ij.measure.Calibration |
getCalibration()
Get the calibration object.
|
MTBImage |
getCurrentSlice()
Get a copy of the current slice.
|
MTBImage |
getCurrentSlice(MTBOperator callingOperator)
Get a copy of the current slice.
|
int[] |
getCurrentSliceCoords()
Get the current slice coordinates (z,t,c) (for functions that work on a
slice only, this has nothing to do with the ij.ImageStack's current slice)
|
int |
getCurrentSliceIndex()
Get the current slice index (for functions that work on a slice only, this
has nothing to do with the ij.ImageStack's current slice)
|
String |
getCurrentSliceLabel()
Get the slice label of the slice specified by the current slice index
|
int[] |
getCurrentZStackCoords()
Get the current z-stack coordinates. [0]=t-coordinate, [1]=c-coordinate.
|
MTBImage |
getImagePart(int x,
int y,
int z,
int t,
int c,
int sizeX,
int sizeY,
int sizeZ,
int sizeT,
int sizeC)
Get a copy of a part of this image as new MTBImage.
|
MTBImage |
getImagePart(MTBOperator callingOperator,
int x,
int y,
int z,
int t,
int c,
int sizeX,
int sizeY,
int sizeZ,
int sizeT,
int sizeC)
Get a copy of a part of this image as new MTBImage.
|
abstract ij.ImagePlus |
getImagePlus()
Get an ImagePlus object.
|
abstract double[] |
getMinMaxDouble()
Get minimum and maximum value of the image as double
|
abstract int[] |
getMinMaxInt()
Get minimum and maximum value of the image as int
|
int |
getSizeC()
Get size of c(hannel)-dimension
|
int |
getSizeStack()
Get size of the underlying (ImageJ) stack which corresponds to the number
of slices
|
int |
getSizeT()
Get size of t(ime)-dimension
|
int |
getSizeX()
Get size of x-dimension
|
int |
getSizeY()
Get size of y-dimension
|
int |
getSizeZ()
Get size of z-dimension
|
MTBImage |
getSlice(int z,
int t,
int c)
Get a copy of the specified slice.
|
MTBImage |
getSlice(MTBOperator callingOperator,
int z,
int t,
int c)
Get a copy of the specified slice.
|
String |
getSliceLabel(int z,
int t,
int c)
Get the slice label of the slice specified by (z,t,c)
|
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 the image's title
|
static String |
getTitleRunning(String title)
Return a unique title for the copy of an image, i.e. a running number is appended/incremented.
|
MTBImage.MTBImageType |
getType()
Get MiToBo image type
|
double |
getTypeMax()
Return the maximum value that the current type can handle
|
double |
getTypeMin()
Return the minimum value that the current type can handle
|
static String |
getTypeName(int type)
Deprecated.
|
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
|
abstract double |
getValueDouble(int x,
int y)
Get the value of the current slice at coordinate (x,y) as an Double
|
abstract double |
getValueDouble(int x,
int y,
int z)
Get the value of the current slice at coordinate (x,y,z) as an Double
|
abstract 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
|
abstract int |
getValueInt(int x,
int y)
Get the value of the current slice at coordinate (x,y) as an Integer
|
abstract int |
getValueInt(int x,
int y,
int z)
Get the value of the current z-stack coordinate (x,y,z) as an Integer
|
abstract 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
|
String |
getXML()
Get the XML file description string if one was available.
|
boolean |
hasImagePlus() |
static boolean |
isValidType(MTBImage.MTBImageType type)
Deprecated.
|
void |
keyPressed(KeyEvent e) |
void |
keyReleased(KeyEvent e) |
void |
keyTyped(KeyEvent e) |
static MTBImage.MTBImageType |
ordinalToType(int enumIdx)
Return the corresponding MTBImageType for its index in the enum.
|
abstract void |
putValueDouble(int x,
int y,
double value)
Set the value of the current slice at coordinate (x,y) using a Double
|
abstract void |
putValueDouble(int x,
int y,
int z,
double value)
Set the value of the current slice at coordinate (x,y,z) using a Double
|
abstract 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
|
abstract void |
putValueInt(int x,
int y,
int value)
Set the value of the current slice at coordinate (x,y) using an Integer
|
abstract void |
putValueInt(int x,
int y,
int z,
int value)
Set the value of the current slice at coordinate (x,y,z) using an Integer
|
abstract 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
|
MTBImageDouble |
scaleValues(int c,
int t,
double curMin,
double curMax,
double scaleMin,
double scaleMax)
Method to scale the intensity values (range [curMin, curMax]) of the image
to a given range [scaleMin, scaleMax].
|
void |
setCalibration(ij.measure.Calibration _calibration)
Set the calibration object (see getCalibration() for further information).
|
protected void |
setCalibrationFromUnderlyingIJImage()
Set the MiToBo image calibration reference to underlying ImagePlus
calibration.
|
void |
setCurrentSlice(MTBImageManipulator src)
Copy the values of the source to the current slice
|
void |
setCurrentSliceCoords(int z,
int t,
int c)
Set the current slice for functions that work on a slice only (this has
nothing to do with the ij.ImageStack's current slice)
|
void |
setCurrentSliceIndex(int stackindex)
Set the current slice for functions that work on a slice only (this has
nothing to do with the ij.ImageStack's current slice) Stack indices range
from 0 to N-1 (unlike ImageJ, where stack indices range from 1 to N)
|
void |
setCurrentSliceLabel(String label)
Set the slice label of the slice specified by the current slice index
|
void |
setCurrentZStackCoordinates(int t,
int c)
Set the current z-stack coordinates for functions that work on (spatial) 3D
only.
|
void |
setImagePart(MTBImageManipulator src,
int x,
int y,
int z,
int t,
int c)
Set a part of this image to the values of the source
|
void |
setSlice(MTBImageManipulator src,
int z,
int t,
int c)
Copy the value of source to the specified slice
|
void |
setSliceLabel(String label,
int z,
int t,
int c)
Set the slice label of the slice specified by (z,t,c)
|
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 image's 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
|
void |
setXML(String _xml)
Set the XML file description string if one was available
|
void |
show()
Display the image as an ImagePlus.
|
static MTBImage.MTBImageType |
stringToType(String s)
For a given String, return the corresponding MTBImageType.
|
String |
toString()
Returns the String "IMG("title of the image")"
|
void |
updateAndRepaintWindow()
Update and repaint the image window if the image is displayed by ImageJ
|
protected abstract void |
updateImagePlus()
Should be used to create or update ImagePlus data if the MTBImage is not
using an ImagePlus to store the data (MTB_INT, MTB_DOUBLE, MTB_RGB).
|
protected void |
updateImageSize_ImgToProp()
Update the image size in the properties hashtable from the image's size
|
protected void |
updatePhysProperties_ImgToProp()
Update physical properties (stepsizes, units) in the properties hashtable
from its member variables
|
protected void |
updatePhysProperties_PropToImg()
Update physical properties (stepsizes, units) of the image (member
variables) from its properties hashtable
|
public static final String UNTITLED
protected ij.ImagePlus m_img
protected ij.ImageStack m_imgStack
protected int m_sizeX
protected int m_sizeY
protected int m_sizeZ
protected int m_sizeT
protected int m_sizeC
protected int m_sizeStack
protected MTBImage.MTBImageType m_type
protected int m_currentSliceIdx
This has nothing to do with the ij.ImageStack's current slice.
protected int m_currentT
protected int m_currentC
private String m_title
This member is private to enforce access via the corresponding setter/getter only. They take care of properly synchronizing the image title with the ImageJ GUI as it might have been changed by the user without MiToBo noticing that.
protected ij.measure.Calibration calibration
protected String xml
protected MTBImage(ij.ImagePlus img)
img
- Wrapped ImagePlus object.protected MTBImage()
public ij.measure.Calibration getCalibration()
The MTBImage and the underlying ImagePlus (if available) share the same {link ij.measure.Calibration} object. This object stores information about physical pixel size, world coordinates (it can return world coordinates for a specified pixel coordinate) etc.
public void setCalibration(ij.measure.Calibration _calibration)
The calibration objected is updated consistently in the MiToBo image data structure and also in the underlying ImagePlus image, if existent.
_calibration
- Calibration for image.protected void setCalibrationFromUnderlyingIJImage()
public String getXML()
public void setXML(String _xml)
_xml
- @Deprecated public static boolean isValidType(MTBImage.MTBImageType type)
type
- Integer specifying a MTBImage type.@Deprecated public static String getTypeName(int type)
type
- Numerical identifier for image.public boolean equalSize(MTBImage img)
img
- image to compare withpublic boolean equals(MTBImage img)
img
- image to compare withpublic double getStepsizeX()
getStepsizeX
in interface MTBImageManipulator
public double getStepsizeY()
getStepsizeY
in interface MTBImageManipulator
public double getStepsizeZ()
getStepsizeZ
in interface MTBImageManipulator
public double getStepsizeT()
getStepsizeT
in interface MTBImageManipulator
public void setStepsizeX(double stepsize)
stepsize
- Stepsize in x dimension.public void setStepsizeY(double stepsize)
stepsize
- Stepsize in y dimension.public void setStepsizeZ(double stepsize)
stepsize
- Stepsize in z dimension.public void setStepsizeT(double stepsize)
stepsize
- Stepsize in t dimension.public String getUnitX()
getUnitX
in interface MTBImageManipulator
public String getUnitY()
getUnitY
in interface MTBImageManipulator
public String getUnitZ()
getUnitZ
in interface MTBImageManipulator
public String getUnitT()
getUnitT
in interface MTBImageManipulator
public void setUnitX(String unit)
unit
- String of x-dimension unitpublic void setUnitY(String unit)
unit
- String of y-dimension unitpublic void setUnitZ(String unit)
unit
- String of z-dimension unitpublic void setUnitT(String unit)
unit
- String of t-dimension unitpublic void copyPhysicalProperties(MTBImage sourceImg)
sourceImg
- Image from where to copy the properties.protected void updatePhysProperties_PropToImg()
protected void updatePhysProperties_ImgToProp()
protected void updateImageSize_ImgToProp()
public String getTitle()
getTitle
in interface MTBImageManipulator
public void setTitle(String title)
title
- New title for image.MTBImageException
public int getSizeX()
getSizeX
in interface MTBImageManipulator
public int getSizeY()
getSizeY
in interface MTBImageManipulator
public int getSizeZ()
getSizeZ
in interface MTBImageManipulator
public int getSizeT()
getSizeT
in interface MTBImageManipulator
public int getSizeC()
getSizeC
in interface MTBImageManipulator
public MTBImage.MTBImageType getType()
getType
in interface MTBImageManipulator
public int getSizeStack()
public double getTypeMax()
public double getTypeMin()
public int[] getCurrentSliceCoords()
public int getCurrentSliceIndex()
public void setCurrentSliceCoords(int z, int t, int c)
public void setCurrentSliceIndex(int stackindex)
stackindex
- index of the slice in the underlying (ImageJ) stackpublic int[] getCurrentZStackCoords()
public void setCurrentZStackCoordinates(int t, int c)
t
- current t-coordinatec
- current c-coordinatepublic void show()
public void updateAndRepaintWindow()
public void close()
public MTBImageDouble scaleValues(int c, int t, double curMin, double curMax, double scaleMin, double scaleMax) throws IllegalArgumentException
c
- current c-coordinate of channel dimensiont
- current t-coordinate of time dimensioncurMin
- minimal intensity value of the current imagecurMax
- maximal intensity value of the current imagescaleMin
- new minimal intensity value of the scaled imagescaleMax
- new maximal intensity value of the scaled imageIllegalArgumentException
- on illegal scaling valuespublic MTBImage convertType(MTBImage.MTBImageType type, boolean scaleDown)
type
- new image's type (see static final fields for types)scaleDown
- If true, the data is scaled down to fit in the range of the new
image type values, if the new image type is of less precision. If
false, the values are simply casted.public MTBImage convertType(MTBOperator callingOperator, MTBImage.MTBImageType type, boolean scaleDown)
callingOperator
- the MTBOperator, which calls this methodtype
- new image's type (see static final fields for types)scaleDown
- If true, the data is scaled down to fit in the range of the new
image type values, if the new image type is of less precision. If
false, the values are simply casted.public MTBImage getImagePart(int x, int y, int z, int t, int c, int sizeX, int sizeY, int sizeZ, int sizeT, int sizeC) throws IllegalArgumentException
x
- x-coordinate where the first value is copied fromy
- y-coordinate where the first value is copied fromz
- z-coordinate where the first value is copied fromt
- t-coordinate where the first value is copied fromc
- c-coordinate where the first value is copied fromsizeX
- size of the copied part in x-dimensionsizeY
- size of the copied part in y-dimensionsizeZ
- size of the copied part in z-dimensionsizeT
- size of the copied part in t-dimensionsizeC
- size of the copied part in c-dimensionIllegalArgumentException
- if image boundaries are exceeded in any waypublic MTBImage getImagePart(MTBOperator callingOperator, int x, int y, int z, int t, int c, int sizeX, int sizeY, int sizeZ, int sizeT, int sizeC) throws IllegalArgumentException
callingOperator
- the MTBOperator, which calls this methodx
- x-coordinate where the first value is copied fromy
- y-coordinate where the first value is copied fromz
- z-coordinate where the first value is copied fromt
- t-coordinate where the first value is copied fromc
- c-coordinate where the first value is copied fromsizeX
- size of the copied part in x-dimensionsizeY
- size of the copied part in y-dimensionsizeZ
- size of the copied part in z-dimensionsizeT
- size of the copied part in t-dimensionsizeC
- size of the copied part in c-dimensionIllegalArgumentException
- if image boundaries are exceeded in any waypublic void setImagePart(MTBImageManipulator src, int x, int y, int z, int t, int c) throws IllegalArgumentException
src
- source MTBImage (or MTBImageWindow)x
- x-coordinate where the first value is copied toy
- y-coordinate where the first value is copied toz
- z-coordinate where the first value is copied tot
- t-coordinate where the first value is copied toc
- c-coordinate where the first value is copied toIllegalArgumentException
- if image boundaries are exceeded in any waypublic MTBImage getSlice(int z, int t, int c) throws IllegalArgumentException
z
- t
- c
- IllegalArgumentException
- if z, c or t do not match the image sizepublic MTBImage getSlice(MTBOperator callingOperator, int z, int t, int c) throws IllegalArgumentException
callingOperator
- the MTBOperator, which calls this methodz
- t
- c
- IllegalArgumentException
- if z, c or t do not match the image sizepublic MTBImage getCurrentSlice()
IllegalArgumentException
public MTBImage getCurrentSlice(MTBOperator callingOperator)
callingOperator
- the MTBOperator, which calls this methodIllegalArgumentException
public void setSlice(MTBImageManipulator src, int z, int t, int c) throws IllegalArgumentException
src
- z
- t
- c
- IllegalArgumentException
public void setCurrentSlice(MTBImageManipulator src) throws IllegalArgumentException
src
- IllegalArgumentException
public String toString()
public void drawLine2D(int xstart, int ystart, int xend, int yend, int value)
MTBImages are 5D, but here t- and c-dimensions are ignored.
This function basically relies on the Bresenham algorithm for rendering
line segments as implemented in method
MTBLineSegment2D.getPixelsAlongSegment()
of class
MTBLineSegment2D
.
xstart
- x-coordinate of start point.ystart
- y-coordinate of start point.xend
- x-coordinate of end point.yend
- y-coordinate of end point.value
- Color or gray-scale value to use for drawing the segment.public void drawLine2D(int xstart, int ystart, int xend, int yend, int z, int t, int c, int value)
This function basically relies on the Bresenham algorithm for rendering
line segments as implemented in method
MTBLineSegment2D.getPixelsAlongSegment()
of class
MTBLineSegment2D
.
xstart
- x-coordinate of start point.ystart
- y-coordinate of start point.xend
- x-coordinate of end point.yend
- y-coordinate of end point.z
- z-coordinate of image slice.t
- t-coordinate of image slice.c
- c-coordinate of image slice.value
- Color or gray-scale value to use for drawing the segment.public void drawPoint2D(int x, int y, int z, int value, int mode)
MTBImages are 5D, but here t- and c-dimensions are ignored.
x
- x-coordinate of point.y
- y-coordinate of point.z
- z-coordinate of point.value
- Color/gray-scale value to be used.mode
- Shape of the point (0 = one pixel, 1 = X, 2 = cross)public void drawCircle2D(int x, int y, int z, int radius, int color)
MTBImages are 5D, but here t- and c-dimensions are ignored.
x
- Center of circle in x.y
- Center of circle in y.z
- Circle position in z.radius
- Radius of circle.color
- Color of circlepublic void drawFilledCircle2D(int x, int y, int z, int radius, int color)
MTBImages are 5D, but here t- and c-dimensions are ignored.
x
- Center of circle in x.y
- Center of circle in y.z
- Circle position in z.radius
- Radius of circle.color
- Color of circlepublic String getCurrentSliceLabel()
public String getSliceLabel(int z, int t, int c)
z
- z-coordinate of desired label.t
- t-coordinate of desired label.c
- c-coordinate of desired label.public void setCurrentSliceLabel(String label)
label
- public void setSliceLabel(String label, int z, int t, int c)
label
- z
- t
- c
- public void adoptSliceLabels(MTBImage src) throws IllegalArgumentException
src
- IllegalArgumentException
public boolean hasImagePlus()
public abstract ij.ImagePlus getImagePlus()
(MTBImage)(ImagePlus.getProperty("MTBImage"))
;protected abstract void updateImagePlus()
public abstract int getValueInt(int x, int y, int z, int t, int c)
getValueInt
in interface MTBImageManipulator
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)public abstract double getValueDouble(int x, int y, int z, int t, int c)
getValueDouble
in interface MTBImageManipulator
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)public abstract void putValueInt(int x, int y, int z, int t, int c, int value)
putValueInt
in interface MTBImageManipulator
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 topublic abstract void putValueDouble(int x, int y, int z, int t, int c, double value)
putValueDouble
in interface MTBImageManipulator
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 topublic abstract int getValueInt(int x, int y, int z)
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)public abstract double getValueDouble(int x, int y, int z)
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)public abstract void putValueInt(int x, int y, int z, int value)
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 topublic abstract void putValueDouble(int x, int y, int z, double value)
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 topublic abstract int getValueInt(int x, int y)
x
- x-coordinate ranging from 0 to (sizeX - 1)y
- y-coordinate ranging from 0 to (sizeY - 1)public abstract double getValueDouble(int x, int y)
x
- x-coordinate ranging from 0 to (sizeX - 1)y
- y-coordinate ranging from 0 to (sizeY - 1)public void fillWhite()
public void fillBlack()
public abstract void putValueInt(int x, int y, int value)
x
- x-coordinate ranging from 0 to (sizeX - 1)y
- y-coordinate ranging from 0 to (sizeY - 1)value
- to set the voxel topublic abstract void putValueDouble(int x, int y, double value)
x
- x-coordinate ranging from 0 to (sizeX - 1)y
- y-coordinate ranging from 0 to (sizeY - 1)value
- to set the voxel topublic abstract int[] getMinMaxInt()
public abstract double[] getMinMaxDouble()
public MTBImage duplicate()
That means also a copy of the underlying ImagePlus (or other data structure) is created. The method uses the internal MTBImageFactory, which extends MTBOperator, thus the duplicated image will keep its history. The reference to the calling operator is set to null, use duplicate(MTBOperator) if you need to specify the calling operator.
public MTBImage duplicate(de.unihalle.informatik.Alida.operator.ALDOperator.HidingMode h)
The parameter allows to configure how the internal operator call should be handled in the history, i.e., to directly hand over a hiding mode to the underlying operator.
h
- Hiding mode to be used for history construction.MTBImage
of the same type.@Deprecated public MTBImage duplicate(MTBOperator callingOperator)
callingOperator
- the MTBOperator, which calls this methodpublic static MTBImage.MTBImageType stringToType(String s)
s
- String must be one of "MTB_BYTE", "MTB_SHORT", "MTB_INT", "MTB_FLOAT", "MTB_DOUBLE", "MTB_RGB"public static MTBImage.MTBImageType ordinalToType(int enumIdx)
enumIdx
- Type identifier.public void keyPressed(KeyEvent e)
keyPressed
in interface KeyListener
public void keyReleased(KeyEvent e)
keyReleased
in interface KeyListener
public void keyTyped(KeyEvent e)
keyTyped
in interface KeyListener
public static MTBImage createMTBImage(ij.ImagePlus img) throws IllegalArgumentException
img
- ImagePlus object to wrapIllegalArgumentException
- for unsupported typespublic static MTBImage createMTBImage(int sizeX, int sizeY, int sizeZ, int sizeT, int sizeC, MTBImage.MTBImageType type) throws IllegalArgumentException
sizeX
- size in x-dimensionsizeY
- size in y-dimensionsizeZ
- size in z-dimensionsizeT
- size in t-dimensionsizeC
- size in c-dimensiontype
- image type (one of MTB_BYTE, MTB_SHORT, MTB_INT, MTB_FLOAT,
MTB_DOUBLE)IllegalArgumentException
- Thrown in case of invalid arguments.public static MTBImageByte createMTBImageByte(int sizeX, int sizeY, int sizeZ, int sizeT, int sizeC, byte[][] data) throws IllegalArgumentException
MTBImage.MTBImageType.MTB_BYTE
from
the given data array.
The array should contain for each xy-slice of the image a 1D-array, and the c,t and z dimensions should multiply to the number of slices given. Note that the dimension of the array must be consistent with the requested size of the image, if not, an exception occurs.
sizeX
- Size of new image in x dimension.sizeY
- Size of new image in y dimension.sizeZ
- Size of new image in z dimension.sizeT
- Size of new image in t dimension.sizeC
- Size of new image in c dimension.data
- Data array.IllegalArgumentException
public static String getTitleRunning(String title)
title
- of the original imageCopyright © 2010–2020 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.