本文整理汇总了Java中net.imglib2.type.numeric.real.DoubleType.get方法的典型用法代码示例。如果您正苦于以下问题:Java DoubleType.get方法的具体用法?Java DoubleType.get怎么用?Java DoubleType.get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.imglib2.type.numeric.real.DoubleType
的用法示例。
在下文中一共展示了DoubleType.get方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: unaryComputer
import net.imglib2.type.numeric.real.DoubleType; //导入方法依赖的package包/类
@Override
protected CenterAwareComputerOp<T, BitType> unaryComputer(final T inClass,
final BitType outClass)
{
final LocalThresholdMethod<T> op = new LocalThresholdMethod<T>() {
private UnaryComputerOp<Iterable<T>, DoubleType> mean;
private UnaryComputerOp<Iterable<T>, DoubleType> stdDeviation;
@Override
public void compute(final Iterable<T> neighborhood, final T center, final BitType output) {
if (mean == null) {
mean = Computers.unary(ops(), Ops.Stats.Mean.class, new DoubleType(),
neighborhood);
}
if (stdDeviation == null) {
stdDeviation = Computers.unary(ops(), Ops.Stats.StdDev.class,
new DoubleType(), neighborhood);
}
final DoubleType meanValue = new DoubleType();
mean.compute(neighborhood, meanValue);
final DoubleType stdDevValue = new DoubleType();
stdDeviation.compute(neighborhood, stdDevValue);
double threshold = meanValue.get() * (1.0d + p * Math.exp(-q * meanValue
.get()) + k * ((stdDevValue.get() / r) - 1.0));
output.set(center.getRealDouble() >= threshold);
}
};
op.setEnvironment(ops());
return op;
}
示例2: unaryComputer
import net.imglib2.type.numeric.real.DoubleType; //导入方法依赖的package包/类
@Override
protected CenterAwareComputerOp<T, BitType> unaryComputer(final T inClass,
final BitType outClass)
{
final LocalThresholdMethod<T> op = new LocalThresholdMethod<T>() {
private UnaryComputerOp<Iterable<T>, DoubleType> mean;
private UnaryComputerOp<Iterable<T>, DoubleType> stdDeviation;
@Override
public void compute(final Iterable<T> neighborhood, final T center, final BitType output) {
if (mean == null) {
mean = Computers.unary(ops(), Ops.Stats.Mean.class, new DoubleType(),
neighborhood);
}
if (stdDeviation == null) {
stdDeviation = Computers.unary(ops(), Ops.Stats.StdDev.class,
new DoubleType(), neighborhood);
}
final DoubleType meanValue = new DoubleType();
mean.compute(neighborhood, meanValue);
final DoubleType stdDevValue = new DoubleType();
stdDeviation.compute(neighborhood, stdDevValue);
double threshold = meanValue.get() * (1.0d + k * ((Math.sqrt(stdDevValue
.get()) / r) - 1.0));
output.set(center.getRealDouble() >= threshold);
}
};
op.setEnvironment(ops());
return op;
}