Class ComplexDoubleType
- java.lang.Object
-
- net.imglib2.type.numeric.complex.AbstractComplexType<ComplexDoubleType>
-
- net.imglib2.type.numeric.complex.ComplexDoubleType
-
- All Implemented Interfaces:
NativeType<ComplexDoubleType>,ComplexType<ComplexDoubleType>,NumericType<ComplexDoubleType>,Add<ComplexDoubleType>,Div<ComplexDoubleType>,Mul<ComplexDoubleType>,MulFloatingPoint,Pow<ComplexDoubleType>,PowFloatingPoint,SetOne,SetZero,Sub<ComplexDoubleType>,ValueEquals<ComplexDoubleType>,Type<ComplexDoubleType>
public class ComplexDoubleType extends AbstractComplexType<ComplexDoubleType> implements NativeType<ComplexDoubleType>
TODO
-
-
Field Summary
Fields Modifier and Type Field Description protected DoubleAccessdataAccessprivate Indexiprivate intimaginaryIprotected NativeImg<?,? extends DoubleAccess>imgprivate intrealIprivate static NativeTypeFactory<ComplexDoubleType,DoubleAccess>typeFactory
-
Constructor Summary
Constructors Constructor Description ComplexDoubleType()ComplexDoubleType(double r, double i)ComplexDoubleType(DoubleAccess access)ComplexDoubleType(NativeImg<?,? extends DoubleAccess> complexfloatStorage)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ComplexDoubleTypecopy()ComplexDoubleTypecreateVariable()Creates a newTypevariable which can only store one value.ComplexDoubleTypeduplicateTypeOnSameNativeImg()Creates a newNativeTypewhich stores in the same physical array.FractiongetEntitiesPerPixel()Get the number of entities in the storage array required to store one pixel value.doublegetImaginaryDouble()floatgetImaginaryFloat()NativeTypeFactory<ComplexDoubleType,DoubleAccess>getNativeTypeFactory()doublegetRealDouble()floatgetRealFloat()Indexindex()Get the (modifiable) index into the current data array.voidset(double r, double i)voidset(ComplexDoubleType c)Sets the value of anotherType.voidsetImaginary(double i)voidsetImaginary(float i)voidsetReal(double r)voidsetReal(float r)voidupdateContainer(java.lang.Object c)This method is used by an accessor (e.g., aCursor) to request an update of the current data array.-
Methods inherited from class net.imglib2.type.numeric.complex.AbstractComplexType
add, complexConjugate, div, equals, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, hashCode, mul, mul, mul, pow, pow, setComplexNumber, setComplexNumber, setOne, setZero, sub, toString, valueEquals
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.imglib2.type.NativeType
decIndex, decIndex, getIndex, incIndex, incIndex, updateIndex
-
Methods inherited from interface net.imglib2.type.operators.ValueEquals
valueEquals
-
-
-
-
Field Detail
-
i
private final Index i
-
realI
private int realI
-
imaginaryI
private int imaginaryI
-
img
protected final NativeImg<?,? extends DoubleAccess> img
-
dataAccess
protected DoubleAccess dataAccess
-
typeFactory
private static final NativeTypeFactory<ComplexDoubleType,DoubleAccess> typeFactory
-
-
Constructor Detail
-
ComplexDoubleType
public ComplexDoubleType(NativeImg<?,? extends DoubleAccess> complexfloatStorage)
-
ComplexDoubleType
public ComplexDoubleType(double r, double i)
-
ComplexDoubleType
public ComplexDoubleType(DoubleAccess access)
-
ComplexDoubleType
public ComplexDoubleType()
-
-
Method Detail
-
updateContainer
public void updateContainer(java.lang.Object c)
Description copied from interface:NativeTypeThis method is used by an accessor (e.g., aCursor) to request an update of the current data array.As an example consider a
CellCursormoving on aCellImg. The cursor maintains aNativeTypewhich provides access to the image data. When the cursor moves from one cell to the next, the underlying data array of theNativeTypemust be switched to the data array of the new cell.To achieve this, the
CellCursorcallsupdateContainer()with itself as the argument.updateContainer()in turn will callNativeImg.update(Object)on it's container, passing along the reference to the cursor. In this example, the container would be aCellImg. While theNativeTypedoes not know about the type of the cursor, the container does.CellImgknows that it is passed aCellCursorinstance, which can be used to figure out the current cell and the underlying data array, which is then returned to theNativeType.The idea behind this concept is maybe not obvious. The
NativeTypeknows which basic type is used (float, int, byte, ...). However, it does not know how the data is stored (ArrayImg,CellImg, ...). This prevents the need for multiple implementations ofNativeType.- Specified by:
updateContainerin interfaceNativeType<ComplexDoubleType>- Parameters:
c- reference to an accessor which can be passed on to the container (which will know what to do with it).
-
index
public Index index()
Description copied from interface:NativeTypeGet the (modifiable) index into the current data array. The returned instance will always be the same for the same Type.- Specified by:
indexin interfaceNativeType<ComplexDoubleType>
-
duplicateTypeOnSameNativeImg
public ComplexDoubleType duplicateTypeOnSameNativeImg()
Description copied from interface:NativeTypeCreates a newNativeTypewhich stores in the same physical array. This is only used internally.- Specified by:
duplicateTypeOnSameNativeImgin interfaceNativeType<ComplexDoubleType>- Returns:
- a new
NativeTypeinstance working on the sameNativeImg
-
getNativeTypeFactory
public NativeTypeFactory<ComplexDoubleType,DoubleAccess> getNativeTypeFactory()
- Specified by:
getNativeTypeFactoryin interfaceNativeType<ComplexDoubleType>
-
getRealFloat
public float getRealFloat()
- Specified by:
getRealFloatin interfaceComplexType<ComplexDoubleType>
-
getRealDouble
public double getRealDouble()
- Specified by:
getRealDoublein interfaceComplexType<ComplexDoubleType>
-
getImaginaryFloat
public float getImaginaryFloat()
- Specified by:
getImaginaryFloatin interfaceComplexType<ComplexDoubleType>
-
getImaginaryDouble
public double getImaginaryDouble()
- Specified by:
getImaginaryDoublein interfaceComplexType<ComplexDoubleType>
-
setReal
public void setReal(float r)
- Specified by:
setRealin interfaceComplexType<ComplexDoubleType>
-
setReal
public void setReal(double r)
- Specified by:
setRealin interfaceComplexType<ComplexDoubleType>
-
setImaginary
public void setImaginary(float i)
- Specified by:
setImaginaryin interfaceComplexType<ComplexDoubleType>
-
setImaginary
public void setImaginary(double i)
- Specified by:
setImaginaryin interfaceComplexType<ComplexDoubleType>
-
set
public void set(double r, double i)
-
set
public void set(ComplexDoubleType c)
Description copied from interface:TypeSets the value of anotherType.- Specified by:
setin interfaceType<ComplexDoubleType>- Overrides:
setin classAbstractComplexType<ComplexDoubleType>- Parameters:
c- the new value
-
createVariable
public ComplexDoubleType createVariable()
Description copied from interface:TypeCreates a newTypevariable which can only store one value.- Specified by:
createVariablein interfaceType<ComplexDoubleType>- Returns:
- a new
Typevariable
-
copy
public ComplexDoubleType copy()
Description copied from interface:Type- Specified by:
copyin interfaceType<ComplexDoubleType>- Returns:
- a new
Typevariable
-
getEntitiesPerPixel
public Fraction getEntitiesPerPixel()
Description copied from interface:NativeTypeGet the number of entities in the storage array required to store one pixel value. A pixel value may be spread over several or less than one entity. For example, a complex number may require 2 entries of a float[] array to store one pixel. Or a 12-bit type might need 12/64th entries of a long[] array.- Specified by:
getEntitiesPerPixelin interfaceNativeType<ComplexDoubleType>- Returns:
- the number of storage type entities required to store one pixel value.
-
-