diff --git a/src/main/java/bdv/gui/BigWarpInitDialog.java b/src/main/java/bdv/gui/BigWarpInitDialog.java index a8fa4222..72e7829c 100644 --- a/src/main/java/bdv/gui/BigWarpInitDialog.java +++ b/src/main/java/bdv/gui/BigWarpInitDialog.java @@ -788,10 +788,7 @@ protected void updateImagePlusDropdown() } /** - * Adds first two image plus images to the sourc list automatically. - * - * Make sure to call {@link updateImagePlusDropdown} before calling this - * method. + * Adds first two image plus images to the source list automatically. */ public void initializeImagePlusSources() { diff --git a/src/main/java/bdv/gui/BigWarpViewerFrame.java b/src/main/java/bdv/gui/BigWarpViewerFrame.java index 32c52598..e892e9cc 100644 --- a/src/main/java/bdv/gui/BigWarpViewerFrame.java +++ b/src/main/java/bdv/gui/BigWarpViewerFrame.java @@ -246,7 +246,7 @@ public void setTransformEnabled( final boolean enabled ) /** * Get {@code Behaviours} hook where TransformEventHandler behaviours are installed. - * This is installed in {@link #getTriggerbindings} with the id "transform". + * This is installed in {@link #getTriggerBindings} with the id "transform". * The hook can be used to update the keymap and install additional behaviours. */ public Behaviours getTransformBehaviours() diff --git a/src/main/java/bdv/ij/BigWarpToDeformationFieldPlugIn.java b/src/main/java/bdv/ij/BigWarpToDeformationFieldPlugIn.java index e67240b0..1bceb401 100644 --- a/src/main/java/bdv/ij/BigWarpToDeformationFieldPlugIn.java +++ b/src/main/java/bdv/ij/BigWarpToDeformationFieldPlugIn.java @@ -474,7 +474,7 @@ else if ( nd == 3 ) * * @param data the bigwarp data storing the fixed transformations * @param transform the current transformation - * @param concat concatenate the current with fixed transformation + * @param concatPreTransforms concatenate the current with fixed transformation * @param ignoreAffine whether the output should include the affine part of the transformation * @return the transformation */ @@ -857,9 +857,11 @@ private static RealTransform getTpsAffineToggle( final BigWarpTransform bwXfm, f } /** - * @param tps + * Get the affine part of a thin-plate spline transform. The affine will be 2D (3D) + * if the transformation is 2D (3D). * - * @return + * @param tps the {@link ThinPlateR2LogRSplineKernelTransform} instance + * @return the {@link AffineGet} instance. * * @deprecated Use {@link BigWarpTransform} method instead */ diff --git a/src/main/java/bdv/viewer/BigWarpViewerPanel.java b/src/main/java/bdv/viewer/BigWarpViewerPanel.java index ceb898d6..de353058 100644 --- a/src/main/java/bdv/viewer/BigWarpViewerPanel.java +++ b/src/main/java/bdv/viewer/BigWarpViewerPanel.java @@ -29,6 +29,7 @@ import bdv.viewer.animate.RotationAnimator; import bdv.viewer.animate.SimilarityTransformAnimator3D; import bdv.viewer.overlay.BigWarpMaskSphereOverlay; +import bigwarp.BigWarp; import bigwarp.BigWarpData; import bigwarp.source.SourceInfo; import bigwarp.util.Rotation2DHelpers; @@ -156,7 +157,7 @@ public void setHoveredIndex( int index ) * Makes the first group contain all the moving images and the second group * contain all the fixed images *

- * Deprecated. use {@link BigWarp#createMovingTargetGroup()} + * @deprecated use {@link BigWarp#createMovingTargetGroups} * * @return the number sources in the moving group */ diff --git a/src/main/java/bigwarp/BigWarp.java b/src/main/java/bigwarp/BigWarp.java index eb393e81..e80ed662 100755 --- a/src/main/java/bigwarp/BigWarp.java +++ b/src/main/java/bigwarp/BigWarp.java @@ -3734,8 +3734,9 @@ public BoundingBoxEstimation getBoxEstimation() } /** - * Use getTps, getTpsBase, or getTransformation instead - * @return + * @deprecated Use getTps, getTpsBase, or getTransformation instead + * + * @return the {@link ThinPlateR2LogRSplineKernelTransform} iinnstance */ @Deprecated public ThinPlateR2LogRSplineKernelTransform getTransform() @@ -3980,7 +3981,7 @@ public File getBigwarpSettingsFolder() /** * Returns the {@link BigWarpAutoSaver}. * - * @return + * @return the {@link BigWarpAutoSaver} instance. */ public BigWarpAutoSaver getAutoSaver() { diff --git a/src/main/java/bigwarp/BigWarpData.java b/src/main/java/bigwarp/BigWarpData.java index c55aac5a..1d5a3465 100644 --- a/src/main/java/bigwarp/BigWarpData.java +++ b/src/main/java/bigwarp/BigWarpData.java @@ -225,7 +225,7 @@ public boolean isMoving( SourceAndConverter sac ) { } /** - * @Deprecated only handled maintaing the moving lists, now a no-op + * @deprecated only handled maintaing the moving lists, now a no-op */ @Deprecated public void wrapUp() diff --git a/src/main/java/bigwarp/BigWarpInit.java b/src/main/java/bigwarp/BigWarpInit.java index e60fe6a9..13144358 100644 --- a/src/main/java/bigwarp/BigWarpInit.java +++ b/src/main/java/bigwarp/BigWarpInit.java @@ -257,12 +257,12 @@ public static < T extends RealType< T > > void initSourceReal( final Source< T > } /** - * @return + * Initialize BigWarp. * - * @Deprecated Use - * {@link #createSources(BigWarpData, ImagePlus, int, int, boolean)} - * instaed, and pass output to - * {@link #add(BigWarpData, LinkedHashMap, RealTransform)} + * @return the number of sources + * + * @deprecated Use {@code createSources(BigWarpData,ImagePlus,int,int,boolean)} instead, and pass output to + * {@code add(BigWarpData,LinkedHashMap)} */ @Deprecated public static < T > int add( BigWarpData< T > bwdata, ImagePlus ip, int setupId, int numTimepoints, boolean isMoving ) @@ -315,9 +315,11 @@ public static < T > LinkedHashMap< Source< T >, SourceInfo > createSources( BigW } /** - * @return + * Initialize BigWarp. + * + * @return a {@link BigWarpData} instance * - * @Deprecated Use the output from one of the + * @deprecated Use the output from one of the * {{@link #createSources(BigWarpData, String, int, boolean)}} * to call {{@link #add(BigWarpData, LinkedHashMap)}} instead */ @@ -346,12 +348,13 @@ public static < T > BigWarpData< T > add( BigWarpData< T > bwdata, LinkedHashMap } /** - * @return + * Initialize BigWarp. * - * @Deprecated Use the output from one of the - * {{@link #createSources(BigWarpData, String, int, boolean)}} - * to call - * {{@link #add(BigWarpData, LinkedHashMap, RealTransform)}} + * @return a {@link BigWarpData} instance + * + * @deprecated Use the output from one of the + * {{@code createSources(BigWarpData, String, int, boolean)}} + * to call {{@code add(BigWarpData, LinkedHashMap, RealTransform)}} * instead */ @SuppressWarnings( { "unchecked", "rawtypes" } ) @@ -582,13 +585,13 @@ else if ( new File( uri ).isDirectory() ) } /** - * @return + * Initialize BigWarp. + * + * @return a {@link SpimData} instance * - * @Deprecated Use output from - * {@link #createSources(BigWarpData, boolean, int, String, String)} - * and add with - * {@link #add(BigWarpData, LinkedHashMap, RealTransform)} - * instead. + * @deprecated Use output from + * {@code createSources(BigWarpData, boolean, int, String, String)} and add with + * {@code add(BigWarpData, LinkedHashMap, RealTransform)} instead. */ @Deprecated public static < T > SpimData addToData( final BigWarpData< T > bwdata, final boolean isMoving, final int setupId, final String rootPath, final String dataset ) diff --git a/src/main/java/bigwarp/landmarks/LandmarkTableModel.java b/src/main/java/bigwarp/landmarks/LandmarkTableModel.java index 76f82674..37540aa1 100644 --- a/src/main/java/bigwarp/landmarks/LandmarkTableModel.java +++ b/src/main/java/bigwarp/landmarks/LandmarkTableModel.java @@ -1267,9 +1267,10 @@ public void loadCsv( File f, boolean invert ) throws IOException } /** - * Loads this table from a file - * @param f the file - * @param invert invert the moving and target point sets + * Loads this table from a file. + * + * @param invert if true, the moving and target point sets are inverted + * @param rows a list of strings containing rows of a csv file * @throws IOException an exception */ protected void loadCsvHelper( boolean invert, final List rows ) throws IOException diff --git a/src/main/java/bigwarp/source/PlateauSphericalMaskRealRandomAccessible.java b/src/main/java/bigwarp/source/PlateauSphericalMaskRealRandomAccessible.java index 24abafb8..7f2f2aed 100644 --- a/src/main/java/bigwarp/source/PlateauSphericalMaskRealRandomAccessible.java +++ b/src/main/java/bigwarp/source/PlateauSphericalMaskRealRandomAccessible.java @@ -101,14 +101,14 @@ public void setOverlays( final List< BigWarpMaskSphereOverlay > overlays ) { public static void main( String[] args ) { - long S = 50; - double[] center = new double[] { S, S, S }; - RealPoint pt = RealPoint.wrap( center ); + final long S = 50; + final double[] center = new double[] { S, S, S }; + final RealPoint pt = RealPoint.wrap( center ); - PlateauSphericalMaskRealRandomAccessible img = new PlateauSphericalMaskRealRandomAccessible( pt ); + final PlateauSphericalMaskRealRandomAccessible img = new PlateauSphericalMaskRealRandomAccessible( pt ); img.setRadius( 10 ); img.setSigma( 10 ); - Interval interval = Intervals.createMinSize( 0, 0, 0, 2 * S, 2 * S, 2 * S ); + final Interval interval = Intervals.createMinSize( 0, 0, 0, 2 * S, 2 * S, 2 * S ); // //// BdvOptions options = BdvOptions.options().screenScales( new double[] { 1 } ); // BdvOptions options = BdvOptions.options(); @@ -127,7 +127,7 @@ public static void main( String[] args ) //// bdv.getBdvHandle().getViewerPanel().getDisplay().addMouseListener( ml ); // double x = 50; - RealRandomAccess< DoubleType > access = img.realRandomAccess(); + final RealRandomAccess< DoubleType > access = img.realRandomAccess(); access.setPosition( center ); while ( x < 100 ) { @@ -337,12 +337,12 @@ public void fromJson( JsonObject json ) } /** - * Re.turns the sigma that makes a Gaussian shape most like a cosine with period T. + * Returns the sigma that makes a Gaussian shape most like a cosine with period T. *

* see https://gist.github.com/bogovicj/d212b236868c76798edfd11150b2c9a0 * * @param T the cosine period - * @return + * @return the appropriate sigma */ public static double gaussSigma( double T ) { @@ -363,7 +363,7 @@ public GaussianFalloff( PlateauSphericalMaskRealRandomAccessible mask ) public void accept( RealLocalizable x, DoubleType v ) { v.setZero(); - double r2 = squaredDistance( x, mask.center ); + final double r2 = squaredDistance( x, mask.center ); if ( r2 <= mask.plateauR2 ) v.setOne(); else @@ -403,7 +403,7 @@ else if ( r >= mask.plateauR + mask.sigma ) // final double t = (r2 - plateauR2); // final double r = Math.sqrt( r2 ); final double t = ( r - mask.plateauR ); - double val = 0.5 + 0.5 * Math.cos( t * PI / mask.sigma ); + final double val = 0.5 + 0.5 * Math.cos( t * PI / mask.sigma ); v.set( val ); } } @@ -463,7 +463,7 @@ public void write( final JsonWriter out, final RealPoint value ) throws IOExcept public RealPoint read( final JsonReader in ) throws IOException { in.beginArray(); - ArrayList< Double > pos = new ArrayList<>(); + final ArrayList< Double > pos = new ArrayList<>(); while ( in.hasNext() ) { pos.add( in.nextDouble() ); diff --git a/src/main/java/org/janelia/utility/geom/BoundingSphereRitter.java b/src/main/java/org/janelia/utility/geom/BoundingSphereRitter.java index 17a21bfa..95ced48a 100644 --- a/src/main/java/org/janelia/utility/geom/BoundingSphereRitter.java +++ b/src/main/java/org/janelia/utility/geom/BoundingSphereRitter.java @@ -3,10 +3,10 @@ import java.util.List; /** - * Estimates the smallest sphere that bounds given points. + * Estimates the smallest sphere that bounds given points. *

- * Ritter, Jack (1990), "An efficient bounding sphere", in Glassner, Andrew S. (ed.), Graphics Gems, San Diego, CA, US: Academic Press Professional, Inc., pp. 301–303, - * + * Ritter, Jack (1990), "An efficient bounding sphere", in Glassner, Andrew S. (ed.), Graphics Gems, San Diego, CA, US: Academic Press Professional, Inc., pp. 301–303, + * * @author John Bogovic * */ @@ -14,9 +14,9 @@ public class BoundingSphereRitter { /** - * Returns an estimate of the smallest {@link ImmutableSphere} that contains the input points. - * - * @param points a collection of points + * Returns an estimate of the smallest {@link Sphere} that contains the input points. + * + * @param points a collection of points * @return the bounding sphere */ public static Sphere boundingSphere( final List points ) @@ -45,13 +45,13 @@ public static Sphere boundingSphere( final List points ) for ( int d = 0; d < nd; d++ ) center[d] = 0.5 * ( x[d] + y[d] ); - Sphere sph = new Sphere( center, Math.sqrt( maxSqrDist ) / 2 ); + final Sphere sph = new Sphere( center, Math.sqrt( maxSqrDist ) / 2 ); boolean allCovered = false; int k = 0; while( !allCovered && k < 5) { allCovered = false; - for( double[] p : points ) + for( final double[] p : points ) { allCovered |= updateSphere( sph, p ); } @@ -59,10 +59,10 @@ public static Sphere boundingSphere( final List points ) } return sph; } - + /** * return the point in point farthest from p - * + * * @param points a list of points * @param p a base point * @return the point farthest from p @@ -82,19 +82,19 @@ public static double[] furthestFrom( final List points, double[] p ) } return points.get( maxIndex ); } - + /** * Changes the value of the input sphere such that it contains the given point p. * Returns true if the sphere was modified. - * + * * @param sphere * @param p * @return true if the sphere was changed */ public static boolean updateSphere( final Sphere sphere, final double[] p ) { - double sqrDist = GeomUtils.squaredDistance( sphere.getCenterArray(), p ); - double r = sphere.getRadius(); + final double sqrDist = GeomUtils.squaredDistance( sphere.getCenterArray(), p ); + final double r = sphere.getRadius(); if ( sqrDist <= r*r ) { return false; diff --git a/src/main/java/org/janelia/utility/geom/GeomUtils.java b/src/main/java/org/janelia/utility/geom/GeomUtils.java index affef38d..2917be9f 100644 --- a/src/main/java/org/janelia/utility/geom/GeomUtils.java +++ b/src/main/java/org/janelia/utility/geom/GeomUtils.java @@ -10,10 +10,10 @@ import net.imglib2.util.ValuePair; public class GeomUtils { - + /** * Finds the parameters of the smallest hypersphere containing the points. - * + * * @param pts a list of points * @return a pair containing the center and the squared distance */ @@ -25,7 +25,7 @@ public static Pair smallestEnclosingSphere( List pt // find pair of points with the largest distance for( int i = 0; i < pts.size(); i++) for( int j = i+1; j < pts.size(); j++) { - double d = squaredDistance( pts.get( i ), pts.get( j )); + final double d = squaredDistance( pts.get( i ), pts.get( j )); if( d < maxSqrDist ) { maxSqrDist = d; @@ -33,11 +33,11 @@ public static Pair smallestEnclosingSphere( List pt q = pts.get( j ); } } - + final RealPoint center = new RealPoint( p.numDimensions()); for( int d = 0; d < p.numDimensions(); d++ ) { - center.setPosition( + center.setPosition( 0.5 * p.getDoublePosition(d) + 0.5 * q.getDoublePosition(d), d ); } @@ -63,7 +63,7 @@ final public static double squaredDistance( final RealLocalizable position1, fin } return dist; - } + } final public static double squaredDistance( final double[] position1, final double[] position2 ) { @@ -86,9 +86,9 @@ public static AffineTransform2D fromScalesAngle( double... p ) public static AffineTransform2D fromScalesAngle( double sx, double sy, double tht ) { - AffineTransform2D t = new AffineTransform2D(); - double cosTht = Math.cos( tht ); - double sinTht = Math.sin( tht ); + final AffineTransform2D t = new AffineTransform2D(); + final double cosTht = Math.cos( tht ); + final double sinTht = Math.sin( tht ); t.set( sx * cosTht, -sx * sinTht, 0.0, sy * sinTht, sy * cosTht, 0.0 ); @@ -102,7 +102,7 @@ public static AffineTransform2D fromScalesAngle( double sx, double sy, double th * tht : the angle * * @param t the transformations - * @return + * @return the scales and angle [sx, sy, tht] */ public static double[] scalesAngle( final AffineTransform2D t ) { @@ -119,12 +119,6 @@ public static double[] scalesAngle( final AffineTransform2D t ) final double sy = sd * mcd; final double tht = Math.atan2( -b, a ); return new double[] { sx, sy, tht }; - -// final double tht1 = Math.atan2( -b, a ); -// final double tht2 = Math.atan2( c, d ); -// System.out.println( "tht1 : " + tht1 ); -// System.out.println( "tht2 : " + tht2 ); -// return new double[] { sx, sy, tht1, tht2 }; } /** @@ -134,12 +128,14 @@ public static double[] scalesAngle( final AffineTransform2D t ) * tht : the angle * * @param t the transformations - * @return + * @return the scales and angle [sx, sy, tht] */ - public static double[] scalesAngle( final AffineTransform2D t, final double[] center ) + public static double[] scalesAngle( final AffineTransform2D t, final double[] center ) { - final double a = t.get( 0, 0 ); final double b = t.get( 0, 1 ); - final double c = t.get( 1, 0 ); final double d = t.get( 1, 1 ); + // TODO why does the center arg do nothing? + + final double a = t.get( 0, 0 ); final double b = t.get( 0, 1 ); + final double c = t.get( 1, 0 ); final double d = t.get( 1, 1 ); // don't allow flips // final double sa = a >= 0 ? 1 : -1;