use of net.imglib2.type.numeric.integer.ShortType in project imagej-ops by imagej.
the class InvertTest method testShortTypeInvert.
@Test
public void testShortTypeInvert() {
final Img<ShortType> inShortType = generateShortArrayTestImg(true, 5, 5);
final Img<ShortType> outShortType = inShortType.factory().create(inShortType, new ShortType());
assertDefaultInvert(inShortType, outShortType);
assertDefaultInvertMinMaxProvided(inShortType, outShortType, new ShortType((Short.MIN_VALUE)), new ShortType((short) (Short.MIN_VALUE + 1)));
assertDefaultInvertMinMaxProvided(inShortType, outShortType, new ShortType((Short.MAX_VALUE)), new ShortType((short) (Short.MAX_VALUE - 1)));
assertDefaultInvertMinMaxProvided(inShortType, outShortType, new ShortType((Short.MAX_VALUE)), new ShortType((Short.MAX_VALUE)));
}
use of net.imglib2.type.numeric.integer.ShortType in project imagej-ops by imagej.
the class ConvertIIsTest method createImages.
@Before
public void createImages() {
final FinalDimensions dims = FinalDimensions.wrap(new long[] { 10, 10 });
in = ops.create().img(dims, new ShortType());
addNoise(in);
out = ops.create().img(dims, new ByteType());
}
use of net.imglib2.type.numeric.integer.ShortType in project imagej-ops by imagej.
the class CreateImgTest method testCreateFromRaiDifferentType.
@Test
public void testCreateFromRaiDifferentType() {
final IntervalView<ByteType> input = Views.interval(PlanarImgs.bytes(10, 10, 10), new FinalInterval(new long[] { 10, 10, 1 }));
final Img<?> res = (Img<?>) ops.run(CreateImgFromDimsAndType.class, input, new ShortType());
assertEquals("Image Type: ", ShortType.class, res.firstElement().getClass());
assertArrayEquals("Image Dimensions: ", Intervals.dimensionsAsLongArray(input), Intervals.dimensionsAsLongArray(res));
assertEquals("Image Factory: ", ArrayImgFactory.class, res.factory().getClass());
}
Aggregations