Refine search
public static final < T extends RealType< T > > void readBytes( final byte[] b, final Cursor< T > cursor, final int width ) { while( cursor.hasNext() ) { cursor.fwd(); // otherwise the position is off below cursor.get().setReal( b[ cursor.getIntPosition( 0 ) + cursor.getIntPosition( 1 ) * width ] & 0xff ); } }
protected void multiplyInPlace( final Img<ComplexFloatType> fftImage1, final Img<ComplexFloatType> fftImage2 ) { final Cursor<ComplexFloatType> cursor1 = fftImage1.cursor(); final Cursor<ComplexFloatType> cursor2 = fftImage2.cursor(); while ( cursor1.hasNext() ) { cursor1.fwd(); cursor2.fwd(); cursor1.get().mul( cursor2.get() ); } }
@Override public void compute(final IterableInterval<I> input, final O output) { double moment11 = 0; final Cursor<I> cur = input.localizingCursor(); while (cur.hasNext()) { cur.fwd(); double x = cur.getDoublePosition(0); double y = cur.getDoublePosition(1); double val = cur.get().getRealDouble(); moment11 += x * y * val; } output.setReal(moment11); } }
protected void mapSingle( final RandomAccess< A > sourceRandomAccess, final Converter< A, ARGBType > conv ) { final Cursor< ARGBType > targetCursor = target.localizingCursor(); while ( targetCursor.hasNext() ) { targetCursor.fwd(); sourceRandomAccess.setPosition( targetCursor.getLongPosition( 0 ), 0 ); sourceRandomAccess.setPosition( targetCursor.getLongPosition( 1 ), 1 ); conv.convert( sourceRandomAccess.get(), targetCursor.get() ); } } }
private static final void normalizeAndConjugateComplexImage( final Img<ComplexFloatType> fftImage, final float normalizationThreshold ) { final Cursor<ComplexFloatType> cursor = fftImage.cursor(); while ( cursor.hasNext() ) { cursor.fwd(); normalizeLength( cursor.get(), normalizationThreshold ); cursor.get().complexConjugate(); } }
public static final < T extends RealType< T > > void readUnsignedShorts( final byte[] b, final Cursor< T > cursor, final int width, final boolean isLittleEndian ) { while( cursor.hasNext() ) { cursor.fwd(); cursor.get().setReal( LegacyStackImgLoaderLOCI.getShortValueInt( b, ( cursor.getIntPosition( 0 ) + cursor.getIntPosition( 1 ) * width ) * 2, isLittleEndian ) ); } }
@Override public void compute(final IterableInterval<I> input, final O output) { double moment01 = 0; final Cursor<I> cur = input.localizingCursor(); while (cur.hasNext()) { cur.fwd(); double y = cur.getDoublePosition(1); double val = cur.get().getRealDouble(); moment01 += y * val; } output.setReal(moment01); } }
protected void mapSingle( final RandomAccess< A > sourceRandomAccess, final Converter< A, ARGBType > conv ) { final Cursor< ARGBType > targetCursor = target.localizingCursor(); while ( targetCursor.hasNext() ) { targetCursor.fwd(); sourceRandomAccess.setPosition( targetCursor.getLongPosition( 0 ), 0 ); sourceRandomAccess.setPosition( targetCursor.getLongPosition( 1 ), 1 ); conv.convert( sourceRandomAccess.get(), targetCursor.get() ); } } }
public static final < T extends RealType< T > > void readSignedShorts( final byte[] b, final Cursor< T > cursor, final int width, final boolean isLittleEndian ) { while( cursor.hasNext() ) { cursor.fwd(); cursor.get().setReal( LegacyStackImgLoaderLOCI.getShortValue( b, ( cursor.getIntPosition( 0 ) + cursor.getIntPosition( 1 ) * width ) * 2, isLittleEndian ) ); } }
@Override public void compute(final IterableInterval<I> input, final O output) { double moment10 = 0; final Cursor<I> cur = input.localizingCursor(); while (cur.hasNext()) { cur.fwd(); double x = cur.getDoublePosition(0); double val = cur.get().getRealDouble(); moment10 += x * val; } output.setReal(moment10); } }
public static final < T extends RealType< T > > void readFloats( final byte[] b, final Cursor< T > cursor, final int width, final boolean isLittleEndian ) { while( cursor.hasNext() ) { cursor.fwd(); cursor.get().setReal( LegacyStackImgLoaderLOCI.getFloatValue( b, ( cursor.getIntPosition( 0 ) + cursor.getIntPosition( 1 ) * width ) * 4, isLittleEndian ) ); } }