本文整理汇总了Java中net.imglib2.realtransform.AffineTransform3D.scale方法的典型用法代码示例。如果您正苦于以下问题:Java AffineTransform3D.scale方法的具体用法?Java AffineTransform3D.scale怎么用?Java AffineTransform3D.scale使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.imglib2.realtransform.AffineTransform3D
的用法示例。
在下文中一共展示了AffineTransform3D.scale方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setFov
import net.imglib2.realtransform.AffineTransform3D; //导入方法依赖的package包/类
public void setFov(final double fov) {
synchronized (viewer) {
final RealPoint currentCenter = new RealPoint(3);
viewer.displayToGlobalCoordinates(viewer.getWidth() / 2,
viewer.getHeight() / 2, currentCenter);
final AffineTransform3D viewerTransform = new AffineTransform3D();
viewer.getState().getViewerTransform(viewerTransform);
final double currentFov = Math.min(viewer.getWidth(), viewer.getHeight())
/ Affine3DHelpers.extractScale(viewerTransform, 0);
final double scale = currentFov / fov;
System.out.println("current fov is " + currentFov
+ " in smallest dimension, want " + fov + ", scale by "
+ scale);
viewerTransform.scale(scale);
viewer.setCurrentViewerTransform(viewerTransform);
goTo(currentCenter);
}
}
示例2: main
import net.imglib2.realtransform.AffineTransform3D; //导入方法依赖的package包/类
public static void main(String[] args)
{
AffineTransform3D scale = new AffineTransform3D();
scale.scale( 2.0 );
//scale.rotate( 0, 45 );
AffineTransform3D translate = new AffineTransform3D();
translate.translate( new double[] {100.0, 100.0, 100.0} );
AffineTransform3D translate2 = new AffineTransform3D();
translate2.translate( new double[] {200.0, 200.0, 200.0} );
AffineTransform3D conc = scale.copy().preConcatenate( translate );
scale.scale( 3.0 );
AffineTransform3D conc2 = scale.copy().preConcatenate( translate2 );
//System.out.println( scale );
//System.out.println( translate );
System.out.println( conc );
System.out.println( conc2 );
RealPoint p1 = new RealPoint( 3 );
conc.apply( p1, p1 );
RealPoint p2 = new RealPoint( 3 );
conc2.apply( p2, p2 );
System.out.println( p1 );
System.out.println( p2 );
AffineTransform3D everythingbuttraslation = conc.copy();
everythingbuttraslation.set( 0, 0, 3 );
everythingbuttraslation.set( 0, 1, 3 );
everythingbuttraslation.set( 0, 2, 3 );
AffineTransform3D everythingbuttraslation2 = conc2.copy();
everythingbuttraslation2.set( 0, 0, 3 );
everythingbuttraslation2.set( 0, 1, 3 );
everythingbuttraslation2.set( 0, 2, 3 );
double[] trans1 = conc.getTranslation();
double[] trans2 = conc2.getTranslation();
everythingbuttraslation.inverse().apply( trans1, trans1 );
everythingbuttraslation2.inverse().apply( trans2, trans2 );
System.out.println( new RealPoint( trans1 ) );
System.out.println( new RealPoint( trans2 ) );
System.out.println( mapBackTransform( everythingbuttraslation, everythingbuttraslation2 ) );
}