Skip to content

Commit

Permalink
feat: correct loading of transform mask from project
Browse files Browse the repository at this point in the history
* adds more complete method to set transform mask properties
  • Loading branch information
bogovicj committed Nov 28, 2023
1 parent f69a4d0 commit b944b3d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
14 changes: 14 additions & 0 deletions src/main/java/bigwarp/BigWarp.java
Original file line number Diff line number Diff line change
Expand Up @@ -2489,6 +2489,20 @@ public void setTransformMaskProperties( final FalloffShape falloffShape,
mask.setCenter( center );
}

public void setTransformMaskProperties( final FalloffShape falloffShape,
final double squaredRadius,
final double squaredSigma,
double[] center )
{
warpVisDialog.maskOptionsPanel.getMaskFalloffTypeDropdown().setSelectedItem(falloffShape);

final PlateauSphericalMaskRealRandomAccessible mask = getTransformPlateauMaskSource().getRandomAccessible();
mask.setFalloffShape( falloffShape );
mask.setSquaredRadius( squaredRadius );
mask.setSquaredSigma( squaredSigma );
mask.setCenter( center );
}

public void importTransformMaskSourceDialog() {

final JFileChooser fileChooser = new JFileChooser();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public void setSigma( double sigma )

public void setSquaredSigma( double squaredSigma )
{
setSigma( Math.sqrt( sqrSigma ));
setSigma( Math.sqrt( squaredSigma ));
}

public void incSquaredSigma( double increment )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public static void read( final BigWarp< ? > bw, final JsonObject json )
bw.setTransformMaskProperties(
maskFromJson.getFallOffShape(),
maskFromJson.getSquaredRadius(),
maskFromJson.getSquaredSigma(),
maskFromJson.getCenter().positionAsDoubleArray());
}else
bw.connectMaskSource();
Expand Down

0 comments on commit b944b3d

Please sign in to comment.