Class ArrayImgRangeCopier<T>
java.lang.Object
net.imglib2.blocks.ArrayImgRangeCopier<T>
- Type Parameters:
T- a primitive array type, e.g.,byte[].
- All Implemented Interfaces:
RangeCopier<T>
Does the actual copying work from an
ArrayImg into a primitive array.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int[]private final int[]private final int[]private final Rangesprivate final int[]private final intprivate final Tprivate final Ranges.Range[]private final List<Ranges.Range>[]private final Tprivate final int[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidCopy the block starting atsrcPoswith the givensizeinto the (appropriately sized)destarray.private voidIterate therangesPerDimensionlist for the given dimensiondand recursively call itself for iterating dimensiond-1.private voidcopyRanges(T dest) Once we get here,setupDestSize(int[])andupdateRange(int)for all dimensions have been called, so thedsteps,doffsets,cdims, andlengthsfields have been appropriately set up for the current Range combination.private voidcopyRangesRecursively(T src, int srcPos, T dest, int destPos, int d) (package private) voidfillRanges(T dest, int dConst) Once we get here,setupDestSize(int[])andupdateRange(int)for all dimensions have been called, so thedsteps,doffsets,cdims, andlengthsfields have been appropriately set up for the current Range combination.private voidfillRangesRecursively(T dest, int destPos, int d, int dConst) Return a new independent instance of thisRangeCopier.private voidsetupDestSize(int[] size) private voidupdateRange(int d)
-
Field Details
-
n
private final int n -
srcDims
private final int[] srcDims -
findRanges
-
memCopy
-
oob
-
rangesPerDimension
-
ranges
-
dsteps
private final int[] dsteps -
doffsets
private final int[] doffsets -
csteps
private final int[] csteps -
lengths
private final int[] lengths -
src
-
-
Constructor Details
-
ArrayImgRangeCopier
-
ArrayImgRangeCopier
-
-
Method Details
-
newInstance
Description copied from interface:RangeCopierReturn a new independent instance of thisRangeCopier. This is used for multi-threading. The new instance works on the same source image, but has independent internal state.- Specified by:
newInstancein interfaceRangeCopier<T>- Returns:
- new independent instance of this
RangeCopier
-
copy
Copy the block starting atsrcPoswith the givensizeinto the (appropriately sized)destarray.This finds the src range lists for all dimensions and then calls
copy(Object, int)to iterate all range combinations.- Specified by:
copyin interfaceRangeCopier<T>- Parameters:
srcPos- min coordinates of block to copy from src Img.dest- destination array. Type isbyte[],float[], etc, corresponding to the src Img's native type.size- dimensions of block to copy from src Img.
-
copy
Iterate therangesPerDimensionlist for the given dimensiondand recursively call itself for iterating dimensiond-1.- Parameters:
dest- destination array. Type isbyte[],float[], etc, corresponding to the src Img's native type.d- current dimension. This method calls itself recursively withd-1untild==0is reached.
-
setupDestSize
private void setupDestSize(int[] size) -
updateRange
private void updateRange(int d) -
copyRanges
Once we get here,setupDestSize(int[])andupdateRange(int)for all dimensions have been called, so thedsteps,doffsets,cdims, andlengthsfields have been appropriately set up for the current Range combination. -
copyRangesRecursively
-
fillRanges
Once we get here,setupDestSize(int[])andupdateRange(int)for all dimensions have been called, so thedsteps,doffsets,cdims, andlengthsfields have been appropriately set up for the current Range combination. AlsocellAccessis positioned on the corresponding cell. -
fillRangesRecursively
-