1 importClass( Packages
.lenscorrection
.DistortionCorrectionTask
);
2 importClass( Packages
.ini
.trakem2
.display
.Display
);
3 importClass( Packages
.ini
.trakem2
.display
.Patch
);
5 /** Remove all coordinate transforms from all patches in the layer set */
6 var layers
= Display
.getFront().getSelection().getLayer().getParent().getLayers();
7 for ( var i
= 0; i
< layers
.size(); ++i
)
9 var patches
= layers
.get( i
).getDisplayables( Patch
);
10 for ( var j
= 0; j
< patches
.size(); ++j
)
12 var patch
= patches
.get( j
);
13 patch
.setCoordinateTransform( null );
14 patch
.updateMipmaps();
18 /** Estimate and apply distortion correction model */
19 DistortionCorrectionTask
.correctDistortionFromSelection( Display
.getFront().getSelection() );