本文整理了Java中net.imglib2.view.Views.extendPeriodic()
方法的一些代码示例,展示了Views.extendPeriodic()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Views.extendPeriodic()
方法的具体详情如下:
包路径:net.imglib2.view.Views
类名称:Views
方法名:extendPeriodic
[英]Extend a RandomAccessibleInterval with a periodic out-of-bounds strategy.
[中]使用周期性越界策略扩展随机访问的区间。
代码示例来源:origin: net.preibisch/multiview-reconstruction
public PSFExtraction(
final RandomAccessibleInterval< T > img,
final Collection< RealLocalizable > locations,
final T type,
final long[] size,
final boolean multithreaded )
{
// Mirror produces some artifacts ... so we use periodic
this( Views.extendPeriodic( img ), locations, type, size, multithreaded );
}
代码示例来源:origin: imagej/imagej-ops
@Override
public ExtendedRandomAccessibleInterval<T, F> calculate(F input) {
return Views.extendPeriodic(input);
}
}
代码示例来源:origin: net.imglib2/imglib2-script
public ExtendPeriodic(final RandomAccessibleInterval<T> img) {
super(Views.interval(Views.extendPeriodic(img), img));
}
代码示例来源:origin: net.imglib2/imglib2
/**
* Expand a RandomAccessibleInterval as specified by border. source will be
* extended with a periodic out-of-bounds strategy.
*
* @param source
* the interval to expand.
* @return Expansion of the {@link RandomAccessibleInterval} source as
* specified by border.
*/
public static < T > IntervalView< T > expandPeriodic( final RandomAccessibleInterval< T > source, final long... border )
{
return interval( extendPeriodic( source ), Intervals.expand( source, border ) );
}
代码示例来源:origin: imglib/imglib2
/**
* Expand a RandomAccessibleInterval as specified by border. source will be
* extended with a periodic out-of-bounds strategy.
*
* @param source
* the interval to expand.
* @return Expansion of the {@link RandomAccessibleInterval} source as
* specified by border.
*/
public static < T > IntervalView< T > expandPeriodic( final RandomAccessibleInterval< T > source, final long... border )
{
return interval( extendPeriodic( source ), Intervals.expand( source, border ) );
}
代码示例来源:origin: net.imglib2/imglib2-algorithm-gpl
public static < R extends RealType< R > > Img< ComplexFloatType > computeKernelFFT(
final Interval kernelConvolutionInterval,
final long[] min,
final long[] max,
final boolean complexConjugate,
final RandomAccessible< R > kernel,
final ImgFactory< ComplexFloatType > fftFactory,
final ExecutorService service )
{
// assemble the correct kernel (size of the input + extended periodic +
// top left at center of input kernel)
final RandomAccessibleInterval< R > kernelInput = Views.interval( Views.extendPeriodic( Views.interval( kernel, kernelConvolutionInterval ) ), new FinalInterval( min, max ) );
final Img< ComplexFloatType > fftKernel = FFT.realToComplex( kernelInput, fftFactory, service );
// if complexConjugate is set we are computing the correlation
// instead of the convolution (same as mirroring the kernel)
// should be false by default
if ( complexConjugate )
FFTMethods.complexConjugate( fftKernel );
return fftKernel;
}
代码示例来源:origin: net.preibisch/multiview-reconstruction
public static < R extends RealType< R > > Img< ComplexFloatType > computeKernelFFT(
final Interval kernelConvolutionInterval,
final long[] min,
final long[] max,
final boolean complexConjugate,
final RandomAccessible< R > kernel,
final ImgFactory< ComplexFloatType > fftFactory,
final ExecutorService service )
{
// assemble the correct kernel (size of the input + extended periodic +
// top left at center of input kernel)
final RandomAccessibleInterval< R > kernelInput = Views.interval( Views.extendPeriodic( Views.interval( kernel, kernelConvolutionInterval ) ), new FinalInterval( min, max ) );
final Img< ComplexFloatType > fftKernel = FFT.realToComplex( kernelInput, fftFactory, service );
// if complexConjugate is set we are computing the correlation
// instead of the convolution (same as mirroring the kernel)
// should be false by default
if ( complexConjugate )
FFTMethods.complexConjugate( fftKernel );
return fftKernel;
}
代码示例来源:origin: net.imglib2/imglib2-ops
/**
* Creates the histograms for all contextual regions. The image is scanned
* line by line as this (hopefully) speeds up the underlying image cursor.
*/
private int[] createHistograms( K img )
{
RandomAccess< T > ra = Views.extendPeriodic( img ).randomAccess();
int[] histograms = new int[ m_ctxNrX * m_ctxNrY * histNrBins ];
for ( int ctxY = 0; ctxY < m_ctxNrY; ctxY++ )
{
for ( int y = 0; y < ctxYSize; y++ )
{
for ( int ctxX = 0; ctxX < m_ctxNrX; ctxX++ )
{
for ( int x = 0; x < ctxXSize; x++ )
{
ra.fwd( 0 );
final int bin = valueToBin( ra.get().getRealDouble() );
final int offSet = ctxY * m_ctxNrX * histNrBins + ctxX * histNrBins;
final int index = offSet + bin;
histograms[ index ]++;
}
}
ra.fwd( 1 );
}
}
return histograms;
}
代码示例来源:origin: net.imglib2/imglib2-algorithms-legacy
ExtendedRandomAccessibleInterval<FloatType, Img<FloatType>> extendedInvPCM = Views.extendPeriodic(invPCM);
final LocalNeighborhoodCursor<FloatType> localCursor =
new LocalNeighborhoodCursor<FloatType>( extendedInvPCM.randomAccess(), 1 );
代码示例来源:origin: imagej/imagej-ops
@Override
@SuppressWarnings("unchecked")
public O calculate(final I kernel, final Dimensions paddedDimensions) {
Dimensions paddedFFTInputDimensions;
// if an fftsize op has been set recompute padded size
if (fftSizeOp != null) {
long[][] sizes = fftSizeOp.calculate(paddedDimensions);
paddedFFTInputDimensions = new FinalDimensions(sizes[0]);
}
else {
paddedFFTInputDimensions = paddedDimensions;
}
// compute where to place the final Interval for the kernel so that the
// coordinate in the center
// of the kernel is shifted to position (0,0).
final Interval kernelConvolutionInterval = paddingIntervalCentered.calculate(
kernel, paddedFFTInputDimensions);
final Interval kernelConvolutionIntervalOrigin = paddingIntervalOrigin
.calculate(kernel, kernelConvolutionInterval);
return (O) Views.interval(Views.extendPeriodic(Views.interval(Views
.extendValue(kernel, Util.getTypeFromInterval(kernel).createVariable()),
kernelConvolutionInterval)), kernelConvolutionIntervalOrigin);
}
代码示例来源:origin: net.imglib2/imglib2-algorithm-gpl
final RandomAccessibleInterval< R > kernelInput = Views.interval( Views.extendPeriodic( Views.interval( kernel, kernelConvolutionInterval ) ), new FinalInterval( min, max ) );
final RandomAccessibleInterval< R > imgInput = Views.interval( img, imgConvolutionInterval );
代码示例来源:origin: net.imglib2/imglib2-algorithms-gpl
final RandomAccessibleInterval< R > kernelInput = Views.interval( Views.extendPeriodic( Views.interval( kernel, kernelConvolutionInterval ) ), new FinalInterval( min, max ) );
final RandomAccessibleInterval< R > imgInput = Views.interval( img, imgConvolutionInterval );
代码示例来源:origin: net.preibisch/multiview-reconstruction
final RandomAccessibleInterval< R > kernelInput = Views.interval( Views.extendPeriodic( Views.interval( kernel, kernelConvolutionInterval ) ), new FinalInterval( min, max ) );
final RandomAccessibleInterval< R > imgInput = Views.interval( img, imgConvolutionInterval );
代码示例来源:origin: net.imagej/imagej-deprecated
break;
case PERIODICAL:
RandomAccess< T > srcRA = Views.extendPeriodic( op ).randomAccess();
Cursor< T > resCur = Views.iterable( res ).localizingCursor();
while ( resCur.hasNext() )
代码示例来源:origin: net.imglib2/imglib2-algorithms-legacy
cursor = Views.extendPeriodic( laPlacian ).randomAccess();
else
cursor = laPlacian.randomAccess();
代码示例来源:origin: net.imglib2/imglib2-algorithms-gpl
final RandomAccessibleInterval< R > kernelInput = Views.interval( Views.extendPeriodic( Views.interval( kernel, kernelConvolutionInterval ) ), new FinalInterval( min, max ) );
final RandomAccessibleInterval< R > imgInput = Views.interval( img, imgConvolutionInterval );
代码示例来源:origin: net.imglib2/imglib2-ops
default:
RandomAccess< T > srcRA = Views.extendPeriodic( op ).randomAccess();
Cursor< T > resCur = res.localizingCursor();
while ( resCur.hasNext() )
代码示例来源:origin: imagej/imagej-ops
@Test
public void extendPeriodicTest() {
Img<DoubleType> img = new ArrayImgFactory<DoubleType>().create(new int[] { 10, 10 }, new DoubleType());
OutOfBounds<DoubleType> il2 = Views.extendPeriodic(img).randomAccess();
OutOfBounds<DoubleType> opr = ops.transform().extendPeriodicView(img).randomAccess();
il2.setPosition(new int[] { -1, -1 });
opr.setPosition(new int[] { -1, -1 });
assertEquals(il2.get().get(), opr.get().get(), 1e-10);
il2.setPosition(new int[] { 11, 11 });
opr.setPosition(new int[] { 11, 11 });
assertEquals(il2.get().get(), opr.get().get(), 1e-10);
}
内容来源于网络,如有侵权,请联系作者删除!