use of net.imglib2.img.cell.CellImgFactory in project imagej-ops by imagej.
the class CreateImgTest method testImageFactory.
@Test
public void testImageFactory() {
final Dimensions dim = new FinalDimensions(10, 10, 10);
@SuppressWarnings("unchecked") final Img<DoubleType> arrayImg = (Img<DoubleType>) ops.run(CreateImgFromDimsAndType.class, dim, new DoubleType(), new ArrayImgFactory<DoubleType>());
final Class<?> arrayFactoryClass = arrayImg.factory().getClass();
assertEquals("Image Factory: ", ArrayImgFactory.class, arrayFactoryClass);
@SuppressWarnings("unchecked") final Img<DoubleType> cellImg = (Img<DoubleType>) ops.run(CreateImgFromDimsAndType.class, dim, new DoubleType(), new CellImgFactory<DoubleType>());
final Class<?> cellFactoryClass = cellImg.factory().getClass();
assertEquals("Image Factory: ", CellImgFactory.class, cellFactoryClass);
}
use of net.imglib2.img.cell.CellImgFactory in project imagej-ops by imagej.
the class CreateLabelingTest method testImageFactory.
@SuppressWarnings("unchecked")
@Test
public void testImageFactory() {
final Dimensions dim = new FinalDimensions(10, 10, 10);
assertEquals("Labeling Factory: ", ArrayImgFactory.class, ((Img<?>) ((ImgLabeling<String, ?>) ops.run(DefaultCreateImgLabeling.class, dim, null, new ArrayImgFactory<IntType>())).getIndexImg()).factory().getClass());
assertEquals("Labeling Factory: ", CellImgFactory.class, ((Img<?>) ((ImgLabeling<String, ?>) ops.run(DefaultCreateImgLabeling.class, dim, null, new CellImgFactory<IntType>())).getIndexImg()).factory().getClass());
}
Aggregations