本文整理汇总了Java中net.imglib2.Localizable类的典型用法代码示例。如果您正苦于以下问题:Java Localizable类的具体用法?Java Localizable怎么用?Java Localizable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Localizable类属于net.imglib2包,在下文中一共展示了Localizable类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: visualise
import net.imglib2.Localizable; //导入依赖的package包/类
/**
* Visualise MSER. Add a 3sigma ellipse overlay to {@link #imp} in the given
* color. Add a slice to {@link #stack} showing binary mask of MSER region.
*/
public void visualise( final Mser< T > mser, final Color color )
{
final ByteProcessor byteProcessor = new ByteProcessor( w, h );
final byte[] pixels = ( byte[] )byteProcessor.getPixels();
for ( final Localizable l : mser )
{
final int x = l.getIntPosition( 0 );
final int y = l.getIntPosition( 1 );
pixels[ y * w + x ] = (byte)(255 & 0xff);
}
final String label = "" + mser.value();
stack.addSlice( label, byteProcessor );
final EllipseRoi ellipse = createEllipse( mser.mean(), mser.cov(), 3 );
ellipse.setStrokeColor( color );
ov.add( ellipse );
}
开发者ID:imglib,项目名称:imglib2-tests,代码行数:22,代码来源:MserTreeExample.java
示例2: print
import net.imglib2.Localizable; //导入依赖的package包/类
public static void print( PixelListComponentTree< IntType > tree )
{
for ( PixelListComponent< IntType > component : tree )
{
System.out.println( component );
for ( int r = 0; r < dimensions[1]; ++r )
{
System.out.print("| ");
for ( int c = 0; c < dimensions[0]; ++c )
{
boolean set = false;
for ( Localizable l : component )
if( l.getIntPosition( 0 ) == c && l.getIntPosition( 1 ) == r )
set = true;
System.out.print( set ? "x " : ". " );
}
System.out.println("|");
}
System.out.println();
}
}
开发者ID:imglib,项目名称:imglib2-tests,代码行数:24,代码来源:PixelListComponentTreeExample.java
示例3: gaussianSmooth
import net.imglib2.Localizable; //导入依赖的package包/类
/**
* Gaussian Smooth of the input image using intermediate float format.
* @param <T>
* @param img
* @param sigma
* @return
*/
public static <T extends RealType<T> & NativeType<T>> RandomAccessibleInterval<T> gaussianSmooth(
RandomAccessibleInterval<T> img, double[] sigma) {
Interval interval = Views.iterable(img);
ImgFactory<T> outputFactory = new ArrayImgFactory<T>();
final long[] dim = new long[ img.numDimensions() ];
img.dimensions(dim);
RandomAccessibleInterval<T> output = outputFactory.create( dim,
img.randomAccess().get().createVariable() );
final long[] pos = new long[ img.numDimensions() ];
Arrays.fill(pos, 0);
Localizable origin = new Point(pos);
ImgFactory<FloatType> tempFactory = new ArrayImgFactory<FloatType>();
RandomAccessible<T> input = Views.extendMirrorSingle(img);
Gauss.inFloat(sigma, input, interval, output, origin, tempFactory);
return output;
}
开发者ID:fiji,项目名称:Colocalisation_Analysis,代码行数:28,代码来源:TestImageAccessor.java
示例4: PhaseCorrelationPeak2
import net.imglib2.Localizable; //导入依赖的package包/类
public PhaseCorrelationPeak2(Localizable pcmPosition, double phaseCorr)
{
this.pcmLocation = new Point( pcmPosition );
this.shift = null;
this.subpixelPcmLocation = null;
this.subpixelShift = null;
this.phaseCorr = phaseCorr;
this.crossCorr = 0.0;
this.nPixel = 0;
}
开发者ID:PreibischLab,项目名称:BigStitcher,代码行数:11,代码来源:PhaseCorrelationPeak2.java
示例5: intersect
import net.imglib2.Localizable; //导入依赖的package包/类
public static < T, U, V > void intersect(
final RandomAccessible< T > source1,
final RandomAccessible< U > source2,
final RandomAccessible< V > target,
final Shape shape,
final Localizable seed,
final Filter< Pair< Pair< T, U >, V >, Pair< Pair< T, U >, V > > filter,
final Converter< Pair< T, U >, V > writer )
{
final RandomAccessiblePair.RandomAccess access =
new RandomAccessiblePair< >( new RandomAccessiblePair< >( source1, source2 ), target ).randomAccess();
access.setPosition( seed );
intersect( source1, source2, target, shape, seed, access.get().copy(), filter, writer );
}
开发者ID:saalfeldlab,项目名称:bigcat,代码行数:15,代码来源:LabelRestrictToSegmentController.java
示例6: move
import net.imglib2.Localizable; //导入依赖的package包/类
@Override
public void move( final Localizable localizable )
{
for ( int d = 0; d < n; ++d )
{
final int distance = localizable.getIntPosition( d );
position[ d ] += distance;
}
}
开发者ID:saalfeldlab,项目名称:bigwarp,代码行数:10,代码来源:GridRandomAccess.java
示例7: apply
import net.imglib2.Localizable; //导入依赖的package包/类
@Override
public void apply( final Localizable source, final Positionable target )
{
assert source.numDimensions() >= numTargetDimensions && target.numDimensions() >= numTargetDimensions: "Dimensions do not match.";
for ( int d = 0; d < numTargetDimensions; ++d )
target.setPosition( apply( source.getIntPosition( d ) ), d );
}
开发者ID:saalfeldlab,项目名称:z-spacing,代码行数:9,代码来源:PermutationTransform.java
示例8: applyInverse
import net.imglib2.Localizable; //导入依赖的package包/类
@Override
public void applyInverse( final Positionable source, final Localizable target )
{
assert source.numDimensions() >= numSourceDimensions && target.numDimensions() >= numSourceDimensions: "Dimensions do not match.";
for ( int d = 0; d < numSourceDimensions; ++d )
source.setPosition( applyInverse( target.getIntPosition( d ) ), d );
}
开发者ID:saalfeldlab,项目名称:z-spacing,代码行数:9,代码来源:PermutationTransform.java
示例9: initPositions
import net.imglib2.Localizable; //导入依赖的package包/类
public final void initPositions(final Localizable l, final int offset) {
for (int d=0; d<maxPositions.length; ++d) {
final long p = l.getLongPosition(d);
maxPositions[d] = p + offset;
minPositions[d] = p + offset;
}
}
开发者ID:imglib,项目名称:imglib2-script,代码行数:8,代码来源:Histogram.java
示例10: ops
import net.imglib2.Localizable; //导入依赖的package包/类
@OpMethod(op = net.imagej.ops.morphology.floodFill.DefaultFloodFill.class)
public <T extends Type<T> & Comparable<T>> RandomAccessibleInterval<T>
floodFill(final RandomAccessibleInterval<T> out,
final RandomAccessibleInterval<T> in, final Localizable startPos,
final Shape structElement)
{
@SuppressWarnings("unchecked")
final RandomAccessibleInterval<T> result =
(RandomAccessibleInterval<T>) ops().run(
net.imagej.ops.morphology.floodFill.DefaultFloodFill.class, out, in, startPos,
structElement);
return result;
}
开发者ID:imagej,项目名称:imagej-ops,代码行数:14,代码来源:MorphologyNamespace.java
示例11: compute
import net.imglib2.Localizable; //导入依赖的package包/类
@Override
public void compute(RandomAccessibleInterval<T> op0, Localizable loc,
RandomAccessibleInterval<T> r)
{
final RandomAccess<T> op0c = op0.randomAccess();
op0c.setPosition(loc);
final T fillValue = op0c.get().copy();
FloodFill.fill(Views.extendValue(op0, fillValue), Views.extendValue(r, fillValue), loc, fillValue, structElement, new Filter<Pair<T,T >, Pair<T,T>>() {
@Override
public boolean accept(Pair<T, T> t, Pair<T, T> u) {
return !t.getB().valueEquals(u.getB()) && t.getA().valueEquals(u.getA());
}
});
}
开发者ID:imagej,项目名称:imagej-ops,代码行数:16,代码来源:DefaultFloodFill.java
示例12: initialize
import net.imglib2.Localizable; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void initialize() {
createFunc = RAIs.function(ops(), CreateImgFromDimsAndType.class, in(), new BitType());
floodFillComp = (BinaryComputerOp) Computers.binary(ops(),
Ops.Morphology.FloodFill.class, RandomAccessibleInterval.class, in(),
Localizable.class, structElement);
}
开发者ID:imagej,项目名称:imagej-ops,代码行数:9,代码来源:DefaultFillHoles.java
示例13: gradientBackwardDifference
import net.imglib2.Localizable; //导入依赖的package包/类
public static < T extends NumericType< T > > void gradientBackwardDifference( final RandomAccessible< T > source, final RandomAccessibleInterval< T > gradient, final int dimension, Localizable pos )
{
final int n = gradient.numDimensions();
final long[] min = new long[ n ];
for ( int d = 0; d < n; ++d ){
if(d < (n-1)){
min[d] = pos.getLongPosition(d);
}else{
min[d] = dimension;
}
}
final RandomAccess< T > result = gradient.randomAccess();
final RandomAccess< T > back = source.randomAccess( Intervals.translate( gradient, 1, dimension ) );
final RandomAccess< T > ctr = source.randomAccess( gradient );
result.setPosition( min );
back.setPosition( min );
back.bck( dimension );
ctr.setPosition( min );
// process pixel
final T t = result.get();
t.set( ctr.get() );
t.sub( back.get() );
// System.out.println(" bd " + result.get());
}
开发者ID:bogovicj,项目名称:hhmi-exp,代码行数:30,代码来源:PartialDerivativeDirectional.java
示例14: gradientForwardDifference
import net.imglib2.Localizable; //导入依赖的package包/类
/**
* Compute the partial derivative of source in a particular dimension using a
* forward difference scheme.
*
* @param source
* source image, has to provide valid data in the interval of the
* gradient image plus a one pixel border in dimension.
* @param gradient
* output image
* @param dimension
* along which dimension the partial derivatives are computed
*/
public static < T extends NumericType< T > > void gradientForwardDifference( final RandomAccessible< T > source, final RandomAccessibleInterval< T > gradient, final int dimension, Localizable pos )
{
final int n = gradient.numDimensions();
final long[] min = new long[ n ];
// System.out.println("pos: " );
for ( int d = 0; d < n; ++d ){
if(d < (n-1)){
min[d] = pos.getLongPosition(d);
}else{
min[d] = dimension;
}
// System.out.println(" " + min[d]);
}
// System.out.println(" ");
final RandomAccess< T > result = gradient.randomAccess();
final RandomAccess< T > ctr = source.randomAccess( gradient );
final RandomAccess< T > front = source.randomAccess( Intervals.translate( gradient, -1, dimension ) );
result.setPosition( min );
ctr.setPosition( min );
front.setPosition( min );
front.fwd( dimension );
// process pixel
final T t = result.get();
t.set( front.get() );
t.sub( ctr.get() );
// System.out.println(" fd " + result.get());
}
开发者ID:bogovicj,项目名称:hhmi-exp,代码行数:49,代码来源:PartialDerivativeDirectional.java
示例15: move
import net.imglib2.Localizable; //导入依赖的package包/类
public void move( final Localizable localizable )
{
for ( int d = 0; d < n; ++d )
{
final long distance = localizable.getLongPosition( d );
currentPos[ d ] += distance;
currentMin[ d ] += distance;
currentMax[ d ] += distance;
}
}
开发者ID:bogovicj,项目名称:hhmi-exp,代码行数:11,代码来源:CrossNeighborhoodRandomAccess.java
示例16: setPosition
import net.imglib2.Localizable; //导入依赖的package包/类
public void setPosition( final Localizable localizable )
{
for ( int d = 0; d < n; ++d )
{
final long position = localizable.getLongPosition( d );
currentPos[ d ] = position;
currentMin[ d ] = position + span.min( d );
currentMax[ d ] = position + span.max( d );
}
}
开发者ID:bogovicj,项目名称:hhmi-exp,代码行数:11,代码来源:CrossNeighborhoodRandomAccess.java
示例17: labelSignedDistanceFunction
import net.imglib2.Localizable; //导入依赖的package包/类
/**
*
* Returns the signed distance function (phi) for an object, reconstructed
* from the MGDM decomposition
*
*
* @param pt the center point
* @param lb the object
* @return
*/
public final double labelSignedDistanceFunction(Localizable pt, int lb){
RandomAccess<L> lbra = mgdmlabels.randomAccess();
lbra.setPosition(pt);
lbra.setPosition(0, ndims); //TODO double check me
RandomAccess<FloatType> dra = mgdmfunctions.randomAccess();
dra.setPosition(pt);
dra.setPosition(0, ndims); //TODO double check me
int l = lbra.get().getInteger();
double out = 0;
if( l == lb ){
out = - dra.get().get();
}
for (int n = 0; n < nmgdm ; n++) {
lbra.setPosition(n, ndims);
l = lbra.get().getInteger();
if ( l == lb){ break; }
dra.setPosition(n, ndims);
out += dra.get().get();
}
return out;
}
开发者ID:bogovicj,项目名称:hhmi-exp,代码行数:39,代码来源:MgdmDecomposition.java
示例18: signedDistanceFunctionNeighborhood
import net.imglib2.Localizable; //导入依赖的package包/类
/**
*
* Builds the signed distance function (phi) for an object, reconstructed
* from the MGDM decomposition in a neighborhood around the input {@link Localizable}.
*
*
* @param pt the center point
* @param lb the object
* @return
*/
public final void signedDistanceFunctionNeighborhood(Localizable pt, int lb){
int[] pos = new int[ndims];
pt.localize(pos);
Cursor<DoubleType> c = phi.cursor();
while(c.hasNext()){
c.fwd();
c.get().set( labelSignedDistanceFunction(c, lb));
}
}
开发者ID:bogovicj,项目名称:hhmi-exp,代码行数:23,代码来源:MgdmDecomposition.java
示例19: move
import net.imglib2.Localizable; //导入依赖的package包/类
@Override
public void move(Localizable localizable)
{
for (final RandomAccess< T > ra : RAs)
ra.move( localizable);
}
开发者ID:PreibischLab,项目名称:BigStitcher,代码行数:7,代码来源:AveragedRandomAccessible.java
示例20: setPosition
import net.imglib2.Localizable; //导入依赖的package包/类
@Override
public void setPosition(Localizable localizable)
{
for (final RandomAccess< T > ra : RAs)
ra.setPosition( localizable );
}
开发者ID:PreibischLab,项目名称:BigStitcher,代码行数:7,代码来源:AveragedRandomAccessible.java
注:本文中的net.imglib2.Localizable类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论