public static RealInterval getBoundingBoxReal( final Dimensions dims, final AffineTransform3D transform ) { final double[] min = new double[]{ 0, 0, 0 }; final double[] max = new double[]{ dims.dimension( 0 ) - 1, dims.dimension( 1 ) - 1, dims.dimension( 2 ) - 1 }; return transform.estimateBounds( new FinalRealInterval( min, max ) ); } }
public static long[] maxTransformedKernel( final HashMap< ViewId, PointSpreadFunction > psfs, final ViewRegistrations vr ) { long[] maxDim = null; int n = -1; for ( final ViewId viewId : psfs.keySet() ) { final PointSpreadFunction psf = psfs.get( viewId ); final Img< FloatType > img = psf.getPSFCopy(); if ( maxDim == null ) { n = img.numDimensions(); maxDim = new long[ n ]; } final ViewRegistration v = vr.getViewRegistration( viewId ); v.updateModel(); final FinalRealInterval bounds = v.getModel().estimateBounds( img ); System.out.println( Group.pvid( viewId ) + ": " + IOFunctions.printRealInterval( bounds ) ); // +3 should be +1, but just to be safe for ( int d = 0; d < maxDim.length; ++d ) maxDim[ d ] = Math.max( maxDim[ d ], Math.round( Math.abs( bounds.realMax( d ) - bounds.realMin( d ) ) ) + 3 ); } return maxDim; } }
size.dimension( 2 ) - 1 }; final FinalRealInterval interval = registrations.get( viewId ).estimateBounds( new FinalRealInterval( min, max ) );
final RealInterval minMaxDim = model.estimateBounds( psf );
( bb.max( 2 ) - bb.min( 2 ) )/2 + bb.min( 2 ) }; final RealInterval bounds = currentViewerTransform.estimateBounds( bb ); IOFunctions.println( printRealInterval( bounds ));