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() ); } } }
public static final < T extends RealType< T > > void readUnsignedInts( final byte[] b, final Cursor< T > cursor, final int width, final boolean isLittleEndian ) { while( cursor.hasNext() ) { cursor.fwd(); cursor.get().setReal( LegacyStackImgLoaderLOCI.getIntValue( b, ( cursor.getIntPosition( 0 ) + cursor.getIntPosition( 1 ) * width ) * 4, 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 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 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 double DotProduct(final Img<T> image1, final Img<T> image2) { final Cursor<T> cursorImage1 = image1.cursor(); final Cursor<T> cursorImage2 = image2.cursor(); double dotProduct = 0.0d; while (cursorImage1.hasNext()) { cursorImage1.fwd(); cursorImage2.fwd(); float val1 = cursorImage1.get().getRealFloat(); float val2 = cursorImage2.get().getRealFloat(); dotProduct += val1 * val2; } return dotProduct; }
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 ) ); } }