Skip to content

Commit

Permalink
doc: javadoc corrections and updates
Browse files Browse the repository at this point in the history
  • Loading branch information
bogovicj committed Oct 9, 2023
1 parent 07fa755 commit 76f766b
Show file tree
Hide file tree
Showing 11 changed files with 80 additions and 79 deletions.
5 changes: 1 addition & 4 deletions src/main/java/bdv/gui/BigWarpInitDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/bdv/gui/BigWarpViewerFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/bdv/ij/BigWarpToDeformationFieldPlugIn.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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
*/
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/bdv/viewer/BigWarpViewerPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
* <p>
* Deprecated. use {@link BigWarp#createMovingTargetGroup()}
* @deprecated use {@link BigWarp#createMovingTargetGroups}
*
* @return the number sources in the moving group
*/
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/bigwarp/BigWarp.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -3980,7 +3981,7 @@ public File getBigwarpSettingsFolder()
/**
* Returns the {@link BigWarpAutoSaver}.
*
* @return
* @return the {@link BigWarpAutoSaver} instance.
*/
public BigWarpAutoSaver getAutoSaver()
{
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/bigwarp/BigWarpData.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
39 changes: 21 additions & 18 deletions src/main/java/bigwarp/BigWarpInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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" } )
Expand Down Expand Up @@ -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 )
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/bigwarp/landmarks/LandmarkTableModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<String[]> rows ) throws IOException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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 )
{
Expand Down Expand Up @@ -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.
* <p>
* see https://gist.github.com/bogovicj/d212b236868c76798edfd11150b2c9a0
*
* @param T the cosine period
* @return
* @return the appropriate sigma
*/
public static double gaussSigma( double T )
{
Expand All @@ -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
Expand Down Expand Up @@ -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 );
}
}
Expand Down Expand Up @@ -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() );
Expand Down
28 changes: 14 additions & 14 deletions src/main/java/org/janelia/utility/geom/BoundingSphereRitter.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@
import java.util.List;

/**
* Estimates the smallest sphere that bounds given points.
* Estimates the smallest sphere that bounds given points.
* <p>
* 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
*
*/
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<double[]> points )
Expand Down Expand Up @@ -45,24 +45,24 @@ public static Sphere boundingSphere( final List<double[]> 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 );
}
k++;
}
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
Expand All @@ -82,19 +82,19 @@ public static double[] furthestFrom( final List<double[]> 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;
Expand Down
Loading

0 comments on commit 76f766b

Please sign in to comment.