use of net.imglib2.img.basictypeaccess.array.LongArray in project imagej-ops by imagej.
the class AbstractOpTest method generateUnsignedVariableBitLengthTypeArrayTestImg.
public ArrayImg<UnsignedVariableBitLengthType, LongArray> generateUnsignedVariableBitLengthTypeArrayTestImg(final boolean fill, final int nbits, final long... dims) {
final long[] array = new long[(int) Intervals.numElements(new FinalInterval(dims))];
if (fill) {
seed = 17;
for (int i = 0; i < array.length; i++) {
array[i] = (long) (((pseudoRandom() / Integer.MAX_VALUE)) % (Math.pow(2, nbits)));
}
}
final LongArray l = new LongArray(array);
return ArrayImgs.unsignedVariableBitLengths(l, nbits, dims);
}
use of net.imglib2.img.basictypeaccess.array.LongArray in project imagej-ops by imagej.
the class AbstractOpTest method generateUnsigned128BitArrayTestImg.
public ArrayImg<Unsigned128BitType, LongArray> generateUnsigned128BitArrayTestImg(final boolean fill, final long... dims) {
ArrayImg<Unsigned128BitType, LongArray> bits = ArrayImgs.unsigned128Bits(dims);
if (fill) {
MersenneTwisterFast betterRNG = new MersenneTwisterFast(0xf1eece);
for (Unsigned128BitType b : bits) {
BigInteger big = BigInteger.valueOf(betterRNG.nextLong());
b.set(big);
}
}
return bits;
}
Aggregations