• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IntegerType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.imglib2.type.numeric.IntegerType的典型用法代码示例。如果您正苦于以下问题:Java IntegerType类的具体用法?Java IntegerType怎么用?Java IntegerType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IntegerType类属于net.imglib2.type.numeric包,在下文中一共展示了IntegerType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: chooseBestType

import net.imglib2.type.numeric.IntegerType; //导入依赖的package包/类
static private final <R extends IntegerType<R> & NativeType<R>> R chooseBestType(final int nBits) {
	
	if (nBits < 9) return (R)(Object) new UnsignedByteType();
	else if (nBits< 13) return (R)(Object) new Unsigned12BitType();
	else if (nBits < 17) return (R)(Object) new UnsignedShortType();
	else if (nBits < 33) return (R)(Object) new UnsignedIntType();
	else if (nBits < 65) return (R)(Object) new LongType();
	else throw new IllegalArgumentException("Cannot do an histogram of " + nBits + " bits.");
	/*
	switch (nBits) {
		case 8:
			return (R) new UnsignedByteType();
		case 12:
			return (R) new Unsigned12BitType();
		case 16:
			return (R) new UnsignedShortType();
		case 32:
			return (R) new UnsignedIntType();
		case 64:
			return (R) new LongType();
		default:
			return (R) new UnsignedAnyBitType(nBits);
	}
	*/
}
 
开发者ID:imglib,项目名称:imglib2-script,代码行数:26,代码来源:IntegralHistogram.java


示例2: testIntegralHistogram2d

import net.imglib2.type.numeric.IntegerType; //导入依赖的package包/类
@Test
public <R extends IntegerType<R> & NativeType<R>> void testIntegralHistogram2d() {
	// Create a 2d image with values 0-9 in every dimension, so bottom right is 81.
	Img<UnsignedByteType> img =
			new UnsignedByteType().createSuitableNativeImg(
					new ArrayImgFactory<UnsignedByteType>(),
					new long[]{10, 10});
	long[] p = new long[2];
	Cursor<UnsignedByteType> c = img.cursor();
	while (c.hasNext()) {
		c.fwd();
		c.localize(p);
		c.get().setInteger(p[0] * p[1]);
	}
	// Create integral histogram with 10 bins
	LinearHistogram<UnsignedByteType> lh = new LinearHistogram<UnsignedByteType>(10, 2, new UnsignedByteType(0), new UnsignedByteType(81));
	Img<R> ih = IntegralHistogram.create(img, lh);
	new ImageJ();
	try {
		ImgLib.wrap((Img)ih, "histogram").show();
	} catch (ImgLibException e) {
		e.printStackTrace();
	}
}
 
开发者ID:imglib,项目名称:imglib2-script,代码行数:25,代码来源:IntegralHistogramExpectationChecking.java


示例3: computeConfluency

import net.imglib2.type.numeric.IntegerType; //导入依赖的package包/类
double computeConfluency (Img<UnsignedByteType> img)
{
	Cursor<UnsignedByteType> c = img.cursor();		

	double onPixels = 0;
	double offPixels = 0;
	
	while (c.hasNext())
	{
		IntegerType<?> t = c.next();
		
		if(t.getInteger()==255)
		{
			onPixels++;
		}
		else offPixels++;
	}

	//IJ.log("" + ((int[])outlinePixelsIndices.get(12))[0]);
	return (double)onPixels/(onPixels+offPixels);
}
 
开发者ID:nicjac,项目名称:PHANTAST-FIJI,代码行数:22,代码来源:PHANTAST_.java


示例4: getOutlinePixels

import net.imglib2.type.numeric.IntegerType; //导入依赖的package包/类
public < T extends RealType< T > & NativeType< T > > ArrayList<int[]> getOutlinePixels(Img<T> img)
{
	ArrayList<int[]> outlinePixelsIndices = new ArrayList<int[]>();

	Cursor<T> c = img.cursor();		

	while (c.hasNext())
	{
		IntegerType t = (IntegerType)c.next();
		int[] position = new int[2];
		
		if(t.getInteger()==255)
		{
			c.localize(position);
			outlinePixelsIndices.add(position);
		}
	}

	//IJ.log("" + ((int[])outlinePixelsIndices.get(12))[0]);
	return outlinePixelsIndices;
}
 
开发者ID:nicjac,项目名称:PHANTAST-FIJI,代码行数:22,代码来源:PHANTAST_.java


示例5: chooseSmallestType

import net.imglib2.type.numeric.IntegerType; //导入依赖的package包/类
@SuppressWarnings("unchecked")
static private final <R extends RealType<R>, T extends NativeType<T> & NumericType<T>> T chooseSmallestType(final R srcType, final double maxSum) {
	if (IntegerType.class.isAssignableFrom(srcType.getClass())) {
		if (maxSum < Math.pow(2, 8)) return (T)(Object) new UnsignedByteType();
		if (maxSum < Math.pow(2, 16)) return (T)(Object) new UnsignedShortType();
		if (maxSum < Math.pow(2, 32)) return (T)(Object) new UnsignedIntType();
		if (maxSum < Math.pow(2, 64)) return (T)(Object) new LongType();
	} else {
		if (maxSum <= Float.MAX_VALUE) return (T)(Object) new FloatType();
		if (maxSum <= Double.MAX_VALUE) return (T)(Object) new DoubleType();
	}
	return null;
}
 
开发者ID:imglib,项目名称:imglib2-script,代码行数:14,代码来源:FastIntegralImg.java


示例6: identityIntegerTypeConverter

import net.imglib2.type.numeric.IntegerType; //导入依赖的package包/类
static private final Converter<IntegerType<?>, IntegerType<?>> identityIntegerTypeConverter() {
	return new Converter<IntegerType<?>, IntegerType<?>>() {
		@Override
		public final void convert(final IntegerType<?> input, final IntegerType<?> output) {
			output.setInteger(input.getIntegerLong());
		}
	};
}
 
开发者ID:imglib,项目名称:imglib2-script,代码行数:9,代码来源:FastIntegralImg.java


示例7: create

import net.imglib2.type.numeric.IntegerType; //导入依赖的package包/类
static public <T extends RealType<T>, R extends IntegerType<R> & NativeType<R>> Img<R> create(
		final Img<T> img,
		final Histogram<T> histogram)
{
	R chooseBestType = chooseBestType(computeBits(img));
	return create(img, histogram, chooseBestType);
}
 
开发者ID:imglib,项目名称:imglib2-script,代码行数:8,代码来源:IntegralHistogram.java


示例8: main

import net.imglib2.type.numeric.IntegerType; //导入依赖的package包/类
static public final <T extends IntegerType<T> & NativeType<T>> void main(String[] arg) {
	new ImageJ();
	TestHistograms t = new TestHistograms();
	//t.testFeatures();
	//t.testHistogramOf3x3Img();
	//t.comparePerformance();
	t.<T>testHistogramOf2x2x2Img();
}
 
开发者ID:imglib,项目名称:imglib2-script,代码行数:9,代码来源:TestHistograms.java


示例9: main

import net.imglib2.type.numeric.IntegerType; //导入依赖的package包/类
static public final <R extends IntegerType<R> & NativeType<R>> void main(String[] arg) {
	IntegralHistogramExpectationChecking I = new IntegralHistogramExpectationChecking();
	//I.testIntegralHistogram2dB();
	//I.testIntegralHistogram1d();
	I.<R>testIntegralHistogram2d();
	//I.testUnsignedAnyBitImg();
}
 
开发者ID:imglib,项目名称:imglib2-script,代码行数:8,代码来源:IntegralHistogramExpectationChecking.java


示例10: cca

import net.imglib2.type.numeric.IntegerType; //导入依赖的package包/类
@OpMethod(op = net.imagej.ops.labeling.cca.DefaultCCA.class)
public <T extends IntegerType<T>, L, I extends IntegerType<I>>
	ImgLabeling<L, I> cca(final ImgLabeling<L, I> out,
		final RandomAccessibleInterval<T> in, final StructuringElement element,
		final Iterator<L> labelGenerator)
{
	@SuppressWarnings("unchecked")
	final ImgLabeling<L, I> result =
		(ImgLabeling<L, I>) ops().run(
			net.imagej.ops.Ops.Labeling.CCA.class, out, in, element,
			labelGenerator);
	return result;
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:14,代码来源:LabelingNamespace.java


示例11: uint2

import net.imglib2.type.numeric.IntegerType; //导入依赖的package包/类
@OpMethod(op = net.imagej.ops.convert.ConvertTypes.IntegerToUint2.class)
public <T extends IntegerType<T>> Unsigned2BitType uint2(
	final Unsigned2BitType out, final T in)
{
	final Unsigned2BitType result = (Unsigned2BitType) ops().run(
		Ops.Convert.Uint2.class, out, in);
	return result;
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:9,代码来源:ConvertNamespace.java


示例12: uint4

import net.imglib2.type.numeric.IntegerType; //导入依赖的package包/类
@OpMethod(op = net.imagej.ops.convert.ConvertTypes.IntegerToUint4.class)
public <T extends IntegerType<T>> Unsigned4BitType uint4(
	final Unsigned4BitType out, final T in)
{
	final Unsigned4BitType result = (Unsigned4BitType) ops().run(
		Ops.Convert.Uint4.class, out, in);
	return result;
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:9,代码来源:ConvertNamespace.java


示例13: int8

import net.imglib2.type.numeric.IntegerType; //导入依赖的package包/类
@OpMethod(op = net.imagej.ops.convert.ConvertTypes.IntegerToInt8.class)
public <T extends IntegerType<T>> ByteType int8(final ByteType out,
	final T in)
{
	final ByteType result = (ByteType) ops().run(
		Ops.Convert.Int8.class, out, in);
	return result;
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:9,代码来源:ConvertNamespace.java


示例14: uint8

import net.imglib2.type.numeric.IntegerType; //导入依赖的package包/类
@OpMethod(op = net.imagej.ops.convert.ConvertTypes.IntegerToUint8.class)
public <T extends IntegerType<T>> UnsignedByteType uint8(
	final UnsignedByteType out, final T in)
{
	final UnsignedByteType result = (UnsignedByteType) ops().run(
		Ops.Convert.Uint8.class, out, in);
	return result;
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:9,代码来源:ConvertNamespace.java


示例15: uint12

import net.imglib2.type.numeric.IntegerType; //导入依赖的package包/类
@OpMethod(op = net.imagej.ops.convert.ConvertTypes.IntegerToUint12.class)
public <T extends IntegerType<T>> Unsigned12BitType uint12(
	final Unsigned12BitType out, final T in)
{
	final Unsigned12BitType result = (Unsigned12BitType) ops().run(
		Ops.Convert.Uint12.class, out, in);
	return result;
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:9,代码来源:ConvertNamespace.java


示例16: int16

import net.imglib2.type.numeric.IntegerType; //导入依赖的package包/类
@OpMethod(op = net.imagej.ops.convert.ConvertTypes.IntegerToInt16.class)
public <T extends IntegerType<T>> ShortType int16(final ShortType out,
	final T in)
{
	final ShortType result = (ShortType) ops().run(
		Ops.Convert.Int16.class, out, in);
	return result;
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:9,代码来源:ConvertNamespace.java


示例17: uint16

import net.imglib2.type.numeric.IntegerType; //导入依赖的package包/类
@OpMethod(op = net.imagej.ops.convert.ConvertTypes.IntegerToUint16.class)
public <T extends IntegerType<T>> UnsignedShortType uint16(
	final UnsignedShortType out, final T in)
{
	final UnsignedShortType result = (UnsignedShortType) ops().run(
		Ops.Convert.Uint16.class, out, in);
	return result;
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:9,代码来源:ConvertNamespace.java


示例18: int32

import net.imglib2.type.numeric.IntegerType; //导入依赖的package包/类
@OpMethod(op = net.imagej.ops.convert.ConvertTypes.IntegerToInt32.class)
public <T extends IntegerType<T>> IntType int32(final IntType out,
	final T in)
{
	final IntType result = (IntType) ops().run(
		Ops.Convert.Int32.class, out, in);
	return result;
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:9,代码来源:ConvertNamespace.java


示例19: uint32

import net.imglib2.type.numeric.IntegerType; //导入依赖的package包/类
@OpMethod(op = net.imagej.ops.convert.ConvertTypes.IntegerToUint32.class)
public <T extends IntegerType<T>> UnsignedIntType uint32(
	final UnsignedIntType out, final T in)
{
	final UnsignedIntType result = (UnsignedIntType) ops().run(
		Ops.Convert.Uint32.class, out, in);
	return result;
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:9,代码来源:ConvertNamespace.java


示例20: int64

import net.imglib2.type.numeric.IntegerType; //导入依赖的package包/类
@OpMethod(op = net.imagej.ops.convert.ConvertTypes.IntegerToInt64.class)
public <T extends IntegerType<T>> LongType int64(final LongType out,
	final T in)
{
	final LongType result = (LongType) ops().run(
		Ops.Convert.Int64.class, out, in);
	return result;
}
 
开发者ID:imagej,项目名称:imagej-ops,代码行数:9,代码来源:ConvertNamespace.java



注:本文中的net.imglib2.type.numeric.IntegerType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ScheduleEntry类代码示例发布时间:2022-05-23
下一篇:
Java Identifiable类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap