/** * Set {@code gPos} to the display coordinates at gPos transformed into the * global coordinate system. * * @param gPos * is set to the corresponding global coordinates. */ public < P extends RealLocalizable & RealPositionable > void displayToGlobalCoordinates( final double[] gPos ) { assert gPos.length >= 3; viewerTransform.applyInverse( gPos, gPos ); }
/** * Set {@code gPos} to the display coordinates at gPos transformed into the * global coordinate system. * * @param gPos * is set to the corresponding global coordinates. */ public < P extends RealLocalizable & RealPositionable > void displayToGlobalCoordinates( final P gPos ) { assert gPos.numDimensions() >= 3; viewerTransform.applyInverse( gPos, gPos ); }
@Override public FloatType get() { // go from PSI(Decon)_image local coordinate system to world coordinate system s[ 0 ] = position[ 0 ] + offsetX; s[ 1 ] = position[ 1 ] + offsetY; s[ 2 ] = position[ 2 ] + offsetZ; // go from world coordinate system to local coordinate system of input image (pixel coordinates) transform.applyInverse( t, s ); ir.setPosition( t ); return ir.get(); }
/** * Set {@code gPos} to the current mouse coordinates transformed into the * global coordinate system. * * @param gPos * is set to the current global coordinates. */ public void getGlobalMouseCoordinates( final RealPositionable gPos ) { assert gPos.numDimensions() == 3; final RealPoint lPos = new RealPoint( 3 ); mouseCoordinates.getMouseCoordinates( lPos ); viewerTransform.applyInverse( gPos, lPos ); }
@Override public FloatType get() { // go from PSI(Decon)_image local coordinate system to world coordinate system s[ 0 ] = pX + offsetX; s[ 1 ] = pY + offsetY; // go from world coordinate system to local coordinate system of input image (pixel coordinates) transform.applyInverse( t, s ); t2d[ 0 ] = t[ 0 ]; t2d[ 1 ] = t[ 1 ]; // check if position t is inside of the input image (pixel coordinates) if ( intersectsLinearInterpolation( t[ 0 ], t[ 1 ], imgMinX, imgMinY, imgMaxX, imgMaxY ) ) { ir.setPosition( t2d ); return getInsideValue( v, ir, hasMinValue, minValue ); } else { return outside; } }
@Override public FloatType get() { // go from PSI(Decon)_image local coordinate system to world coordinate system s[ 0 ] = position[ 0 ] + offsetX; s[ 1 ] = position[ 1 ] + offsetY; s[ 2 ] = position[ 2 ] + offsetZ; // go from world coordinate system to local coordinate system of input image (pixel coordinates) transform.applyInverse( t, s ); // check if position t is inside of the input image (pixel coordinates) if ( intersectsLinearInterpolation( t[ 0 ], t[ 1 ], t[ 2 ], imgMinX, imgMinY, imgMinZ, imgMaxX, imgMaxY, imgMaxZ ) ) { ir.setPosition( t ); return getInsideValue( v, ir, hasMinValue, minValue ); } else { return outside; } }
/** * Set {@code gPos} to the display coordinates (x,y,0)<sup>T</sup> transformed into the * global coordinate system. * * @param gPos * is set to the global coordinates at display (x,y,0)<sup>T</sup>. */ public void displayToGlobalCoordinates( final double x, final double y, final RealPositionable gPos ) { assert gPos.numDimensions() >= 3; final RealPoint lPos = new RealPoint( 3 ); lPos.setPosition( x, 0 ); lPos.setPosition( y, 1 ); viewerTransform.applyInverse( gPos, lPos ); }
for ( int i = 0; i < 4; ++i ) sourceToScreen.applyInverse( sourceCorner, screenCorners[ i ] ); for ( int d = 0; d < 3; ++d )