Class DoubleType
- java.lang.Object
-
- net.imglib2.type.numeric.complex.AbstractComplexType<T>
-
- net.imglib2.type.numeric.real.AbstractRealType<DoubleType>
-
- net.imglib2.type.numeric.real.DoubleType
-
- All Implemented Interfaces:
java.lang.Comparable<DoubleType>,NativeType<DoubleType>,ComplexType<DoubleType>,NumericType<DoubleType>,RealType<DoubleType>,Add<DoubleType>,Div<DoubleType>,Mul<DoubleType>,MulFloatingPoint,Pow<DoubleType>,PowFloatingPoint,SetOne,SetZero,Sub<DoubleType>,ValueEquals<DoubleType>,Type<DoubleType>
- Direct Known Subclasses:
VolatileDoubleType.WrappedDoubleType
public class DoubleType extends AbstractRealType<DoubleType> implements NativeType<DoubleType>
TODO
-
-
Field Summary
Fields Modifier and Type Field Description protected DoubleAccessdataAccessprivate Indexiprotected NativeImg<?,? extends DoubleAccess>imgprivate static NativeTypeFactory<DoubleType,DoubleAccess>typeFactory
-
Constructor Summary
Constructors Constructor Description DoubleType()DoubleType(double value)DoubleType(DoubleAccess access)DoubleType(NativeImg<?,? extends DoubleAccess> doubleStorage)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DoubleTypecopy()DoubleTypecreateVariable()Creates a newTypevariable which can only store one value.static RealComposite<DoubleType>createVector(int n)DoubleTypeduplicateTypeOnSameNativeImg()Creates a newNativeTypewhich stores in the same physical array.static booleanequals(double a, double b)doubleget()intgetBitsPerPixel()FractiongetEntitiesPerPixel()Get the number of entities in the storage array required to store one pixel value.doublegetMaxValue()doublegetMinIncrement()doublegetMinValue()NativeTypeFactory<DoubleType,DoubleAccess>getNativeTypeFactory()doublegetRealDouble()floatgetRealFloat()Indexindex()Get the (modifiable) index into the current data array.voidset(double f)voidsetReal(double real)voidsetReal(float real)voidupdateContainer(java.lang.Object c)This method is used by an accessor (e.g., aCursor) to request an update of the current data array.static RealComposite<DoubleType>wrapVector(double[] array)Wrap an array as an n-dimensionalRealCompositeofDoubleType.-
Methods inherited from class net.imglib2.type.numeric.real.AbstractRealType
add, compareTo, dec, div, equals, getImaginaryDouble, getImaginaryFloat, getPhaseDouble, getPhaseFloat, getPowerDouble, getPowerFloat, hashCode, inc, mul, mul, mul, pow, pow, set, setImaginary, setImaginary, setOne, setZero, sub, toString, valueEquals
-
Methods inherited from class net.imglib2.type.numeric.complex.AbstractComplexType
complexConjugate, setComplexNumber, setComplexNumber
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.imglib2.type.numeric.ComplexType
complexConjugate, setComplexNumber, setComplexNumber
-
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
-
img
protected final NativeImg<?,? extends DoubleAccess> img
-
dataAccess
protected DoubleAccess dataAccess
-
typeFactory
private static final NativeTypeFactory<DoubleType,DoubleAccess> typeFactory
-
-
Constructor Detail
-
DoubleType
public DoubleType(NativeImg<?,? extends DoubleAccess> doubleStorage)
-
DoubleType
public DoubleType(double value)
-
DoubleType
public DoubleType(DoubleAccess access)
-
DoubleType
public DoubleType()
-
-
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<DoubleType>- 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<DoubleType>
-
duplicateTypeOnSameNativeImg
public DoubleType duplicateTypeOnSameNativeImg()
Description copied from interface:NativeTypeCreates a newNativeTypewhich stores in the same physical array. This is only used internally.- Specified by:
duplicateTypeOnSameNativeImgin interfaceNativeType<DoubleType>- Returns:
- a new
NativeTypeinstance working on the sameNativeImg
-
getNativeTypeFactory
public NativeTypeFactory<DoubleType,DoubleAccess> getNativeTypeFactory()
- Specified by:
getNativeTypeFactoryin interfaceNativeType<DoubleType>
-
get
public double get()
-
set
public void set(double f)
-
getRealFloat
public float getRealFloat()
- Specified by:
getRealFloatin interfaceComplexType<DoubleType>
-
getRealDouble
public double getRealDouble()
- Specified by:
getRealDoublein interfaceComplexType<DoubleType>
-
setReal
public void setReal(float real)
- Specified by:
setRealin interfaceComplexType<DoubleType>
-
setReal
public void setReal(double real)
- Specified by:
setRealin interfaceComplexType<DoubleType>
-
getMaxValue
public double getMaxValue()
- Specified by:
getMaxValuein interfaceRealType<DoubleType>
-
getMinValue
public double getMinValue()
- Specified by:
getMinValuein interfaceRealType<DoubleType>
-
getMinIncrement
public double getMinIncrement()
- Specified by:
getMinIncrementin interfaceRealType<DoubleType>
-
createVariable
public DoubleType createVariable()
Description copied from interface:TypeCreates a newTypevariable which can only store one value.- Specified by:
createVariablein interfaceType<DoubleType>- Returns:
- a new
Typevariable
-
copy
public DoubleType copy()
Description copied from interface:Type- Specified by:
copyin interfaceType<DoubleType>- 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<DoubleType>- Returns:
- the number of storage type entities required to store one pixel value.
-
getBitsPerPixel
public int getBitsPerPixel()
- Specified by:
getBitsPerPixelin interfaceRealType<DoubleType>
-
equals
public static boolean equals(double a, double b)
-
createVector
public static RealComposite<DoubleType> createVector(int n)
- Parameters:
n- number of dimensions- Returns:
-
wrapVector
public static RealComposite<DoubleType> wrapVector(double[] array)
Wrap an array as an n-dimensionalRealCompositeofDoubleType.- Parameters:
array-- Returns:
-
-