de.unihalle.informatik.MiToBo.core.datatypes.images
Class MTBImage.MTBImageFactory

java.lang.Object
  extended by de.unihalle.informatik.Alida.operator.ALDOperator
      extended by de.unihalle.informatik.MiToBo.core.operator.MTBOperator
          extended by de.unihalle.informatik.MiToBo.core.datatypes.images.MTBImage.MTBImageFactory
All Implemented Interfaces:
de.unihalle.informatik.Alida.datatypes.ALDConfigurationValidator
Enclosing class:
MTBImage

public class MTBImage.MTBImageFactory
extends MTBOperator

A class for creating MTBImages which implements the MTBOperator.

Author:
gress

Nested Class Summary
 
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
de.unihalle.informatik.Alida.operator.ALDOperator.HidingMode
 
Field Summary
private  java.lang.Integer c
           
private  MTBImage.FactoryMethod factoryMethod
           
private  MTBImage inImg
           
private  MTBImage resultImg
           
private  boolean scaleDown
           
private  java.lang.Integer sizeC
           
private  java.lang.Integer sizeT
           
private  java.lang.Integer sizeX
           
private  java.lang.Integer sizeY
           
private  java.lang.Integer sizeZ
           
private  java.lang.Integer t
           
private  MTBImage.MTBImageType targetImageType
           
private  java.lang.Integer x
           
private  java.lang.Integer y
           
private  java.lang.Integer z
           
 
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
completeDAG, name, portHashAccess, verbose, versionProvider
 
Constructor Summary
MTBImage.MTBImageFactory()
           
MTBImage.MTBImageFactory(MTBImage inImg)
          Duplicate constructor
MTBImage.MTBImageFactory(MTBImage inImg, int z, int t, int c)
          Get slice constructor
MTBImage.MTBImageFactory(MTBImage inImg, int x, int y, int z, int t, int c, int sizeX, int sizeY, int sizeZ, int sizeT, int sizeC)
          Create a new image from the specified image part
MTBImage.MTBImageFactory(MTBImage inImg, MTBImage.MTBImageType type, boolean scaleDown)
          Convert constructor
 
Method Summary
protected  MTBImage convertType(MTBImage img, MTBImage.MTBImageType type, boolean scaleDown)
          Create an image of given type from this image's values.
 MTBImage duplicate(MTBImage img)
           
private  MTBImage duplicateImageJType(MTBImage img)
           
private  MTBImage duplicateNonImageJType(MTBImage img)
           
protected  int getC()
           
protected  MTBImage.FactoryMethod getFactoryMethod()
           
protected  MTBImage getImagePart(MTBImage img, 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
protected  MTBImage getInImg()
           
 MTBImage getResultImg()
           
protected  boolean getScaleDown()
           
protected  int getSizeC()
           
protected  int getSizeT()
           
protected  int getSizeX()
           
protected  int getSizeY()
           
protected  int getSizeZ()
           
protected  MTBImage getSlice(MTBImage img, int z, int t, int c)
          Get a copy of the specified slice
protected  int getT()
           
protected  MTBImage.MTBImageType getTargetImageType()
           
protected  int getX()
           
protected  int getY()
           
protected  int getZ()
           
protected  void operate()
           
protected  void setC(int c)
           
protected  void setFactoryMethod(MTBImage.FactoryMethod fm)
           
protected  void setInImg(MTBImage inImg)
           
 void setResultImg(MTBImage resultImg)
           
protected  void setScaleDown(boolean scaleDown)
           
protected  void setSizeC(int sizeC)
           
protected  void setSizeT(int sizeT)
           
protected  void setSizeX(int sizeX)
           
protected  void setSizeY(int sizeY)
           
protected  void setSizeZ(int sizeZ)
           
protected  void setT(int t)
           
protected  void setTargetImageType(MTBImage.MTBImageType type)
           
protected  void setX(int x)
           
protected  void setY(int y)
           
protected  void setZ(int z)
           
 
Methods inherited from class de.unihalle.informatik.MiToBo.core.operator.MTBOperator
readResolve
 
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
deserializeFromXmlFile, fieldContained, getALDPortHashAccessKey, getConstructionMode, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterNames, getSupplementalNames, getVerbose, getVersion, isConfigured, parametersToXmlObject, print, print, print, printInterface, printInterface, readHistory, reinitializeParameterDescriptors, runOp, runOp, runOp, serializeToXmlFile, setConstructionMode, setName, setParameter, setParametersFromXml, setParametersFromXml, setVerbose, toStringVerbose, unconfiguredItems, validate, validateCustom, validateGeneric, writeHistory, writeHistory, writeHistory, writeParametersToXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

c

@Parameter(label="c",
           required=false,
           type=PARAMETER,
           description="Starting coordinate in c-dimension for copying an image part if factory method is IMAGE_PART or slice coordinate if factory method is SLICE")
private java.lang.Integer c

factoryMethod

@Parameter(label="factoryMethod",
           required=true,
           type=PARAMETER,
           description="Type of image creation method")
private MTBImage.FactoryMethod factoryMethod

inImg

@Parameter(label="inImg",
           required=true,
           type=INPUT,
           description="Input image")
private MTBImage inImg

resultImg

@Parameter(label="resultImg",
           required=true,
           type=OUTPUT,
           description="Result image")
private MTBImage resultImg

scaleDown

@Parameter(label="scaleDown",
           required=false,
           type=PARAMETER,
           description="Scale image values if factory method is CONVERT")
private boolean scaleDown

sizeC

@Parameter(label="sizeC",
           required=false,
           type=PARAMETER,
           description="Size in c-dimension for copying an image part if factory method is IMAGE_PART")
private java.lang.Integer sizeC

sizeT

@Parameter(label="sizeT",
           required=false,
           type=PARAMETER,
           description="Size in t-dimension for copying an image part if factory method is IMAGE_PART")
private java.lang.Integer sizeT

sizeX

@Parameter(label="sizeX",
           required=false,
           type=PARAMETER,
           description="Size in x-dimension for copying an image part if factory method is IMAGE_PART")
private java.lang.Integer sizeX

sizeY

@Parameter(label="sizeY",
           required=false,
           type=PARAMETER,
           description="Size in y-dimension for copying an image part if factory method is IMAGE_PART")
private java.lang.Integer sizeY

sizeZ

@Parameter(label="sizeZ",
           required=false,
           type=PARAMETER,
           description="Size in z-dimension for copying an image part if factory method is IMAGE_PART")
private java.lang.Integer sizeZ

t

@Parameter(label="t",
           required=false,
           type=PARAMETER,
           description="Starting coordinate in t-dimension for copying an image part if factory method is IMAGE_PART or slice coordinate if factory method is SLICE")
private java.lang.Integer t

targetImageType

@Parameter(label="targetImageType",
           required=false,
           type=PARAMETER,
           description="Image type of new image if factory method is CONVERT")
private MTBImage.MTBImageType targetImageType

x

@Parameter(label="x",
           required=false,
           type=PARAMETER,
           description="Starting coordinate in x-dimension for copying an image part if factory method is IMAGE_PART")
private java.lang.Integer x

y

@Parameter(label="y",
           required=false,
           type=PARAMETER,
           description="Starting coordinate in y-dimension for copying an image part if factory method is IMAGE_PART")
private java.lang.Integer y

z

@Parameter(label="z",
           required=false,
           type=PARAMETER,
           description="Starting coordinate in z-dimension for copying an image part if factory method is IMAGE_PART or slice coordinate if factory method is SLICE")
private java.lang.Integer z
Constructor Detail

MTBImage.MTBImageFactory

public MTBImage.MTBImageFactory()
                         throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

MTBImage.MTBImageFactory

public MTBImage.MTBImageFactory(MTBImage inImg)
                         throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Duplicate constructor

Parameters:
inImg -
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

MTBImage.MTBImageFactory

public MTBImage.MTBImageFactory(MTBImage inImg,
                                int z,
                                int t,
                                int c)
                         throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Get slice constructor

Parameters:
inImg -
z -
t -
c -
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

MTBImage.MTBImageFactory

public MTBImage.MTBImageFactory(MTBImage inImg,
                                int x,
                                int y,
                                int z,
                                int t,
                                int c,
                                int sizeX,
                                int sizeY,
                                int sizeZ,
                                int sizeT,
                                int sizeC)
                         throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Create a new image from the specified image part

Parameters:
inImg -
x -
y -
z -
t -
c -
sizeX -
sizeY -
sizeZ -
sizeT -
sizeC -
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

MTBImage.MTBImageFactory

public MTBImage.MTBImageFactory(MTBImage inImg,
                                MTBImage.MTBImageType type,
                                boolean scaleDown)
                         throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Convert constructor

Parameters:
inImg -
type -
scaleDown -
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Method Detail

convertType

protected MTBImage convertType(MTBImage img,
                               MTBImage.MTBImageType type,
                               boolean scaleDown)
Create an image of given type from this image's values. Information is lost if a type of less precision is used!

Parameters:
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.
Returns:
new image of given type

duplicate

public MTBImage duplicate(MTBImage img)

duplicateImageJType

private MTBImage duplicateImageJType(MTBImage img)

duplicateNonImageJType

private MTBImage duplicateNonImageJType(MTBImage img)

getC

protected int getC()

getFactoryMethod

protected MTBImage.FactoryMethod getFactoryMethod()

getImagePart

protected MTBImage getImagePart(MTBImage img,
                                int x,
                                int y,
                                int z,
                                int t,
                                int c,
                                int sizeX,
                                int sizeY,
                                int sizeZ,
                                int sizeT,
                                int sizeC)
                         throws java.lang.IllegalArgumentException
Get a copy of a part of this image as new MTBImage

Parameters:
x - x-coordinate where the first value is copied from
y - y-coordinate where the first value is copied from
z - z-coordinate where the first value is copied from
t - t-coordinate where the first value is copied from
c - c-coordinate where the first value is copied from
sizeX - size of the copied part in x-dimension
sizeY - size of the copied part in y-dimension
sizeZ - size of the copied part in z-dimension
sizeT - size of the copied part in t-dimension
sizeC - size of the copied part in c-dimension
Returns:
new MTBImage with values equal to the specified part
Throws:
java.lang.IllegalArgumentException - if image boundaries are exceeded in any way

getInImg

protected MTBImage getInImg()

getResultImg

public MTBImage getResultImg()

getScaleDown

protected boolean getScaleDown()

getSizeC

protected int getSizeC()

getSizeT

protected int getSizeT()

getSizeX

protected int getSizeX()

getSizeY

protected int getSizeY()

getSizeZ

protected int getSizeZ()

getSlice

protected MTBImage getSlice(MTBImage img,
                            int z,
                            int t,
                            int c)
                     throws java.lang.IllegalArgumentException
Get a copy of the specified slice

Parameters:
z -
t -
c -
Returns:
Throws:
java.lang.IllegalArgumentException

getT

protected int getT()

getTargetImageType

protected MTBImage.MTBImageType getTargetImageType()

getX

protected int getX()

getY

protected int getY()

getZ

protected int getZ()

operate

protected void operate()
                throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Specified by:
operate in class de.unihalle.informatik.Alida.operator.ALDOperator
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

setC

protected void setC(int c)

setFactoryMethod

protected void setFactoryMethod(MTBImage.FactoryMethod fm)

setInImg

protected void setInImg(MTBImage inImg)

setResultImg

public void setResultImg(MTBImage resultImg)

setScaleDown

protected void setScaleDown(boolean scaleDown)
                     throws de.unihalle.informatik.Alida.exceptions.ALDOperatorException
Throws:
de.unihalle.informatik.Alida.exceptions.ALDOperatorException

setSizeC

protected void setSizeC(int sizeC)

setSizeT

protected void setSizeT(int sizeT)

setSizeX

protected void setSizeX(int sizeX)

setSizeY

protected void setSizeY(int sizeY)

setSizeZ

protected void setSizeZ(int sizeZ)

setT

protected void setT(int t)

setTargetImageType

protected void setTargetImageType(MTBImage.MTBImageType type)

setX

protected void setX(int x)

setY

protected void setY(int y)

setZ

protected void setZ(int z)