@Override public AffineTransform3D getTransform() { synchronized ( affine ) { return affine.copy(); } }
@Override public AffineTransform3D getTransform() { synchronized ( affine ) { return affine.copy(); } }
@Override public AffineTransform3D getTransform() { synchronized ( affine ) { return affine.copy(); } }
public void addAngle(int id, int axis, double degrees) { AffineTransform3D t = new AffineTransform3D(); t.rotate( axis, Math.toRadians( degrees ) ); angleTransforms.put( id, t.copy() ); }
public void addChannel(int id, double[] shift) { AffineTransform3D t = new AffineTransform3D(); t.translate( shift ); channelTransforms.put( id, t.copy()); }
public static AffineTransform3D rotationAngleAxis(double angle, double[] axis) { double[] u = toUnit( axis ); double[] a = new double[12]; // https://en.wikipedia.org/wiki/Rotation_formalisms_in_three_dimensions a[0] = (1.0 - Math.cos( angle )) * Math.pow( u[0], 2 ) + Math.cos( angle ); a[1] = (1.0 - Math.cos( angle )) * u[0] * u[1] - u[2] * Math.sin( angle ); a[2] = (1.0 - Math.cos( angle )) * u[0] * u[2] + u[1] * Math.sin( angle ); a[4] = (1.0 - Math.cos( angle )) * u[0] * u[1] + u[2] * Math.sin( angle ); a[5] = (1.0 - Math.cos( angle )) * Math.pow( u[1], 2 ) + Math.cos( angle ); a[6] = (1.0 - Math.cos( angle )) * u[1] * u[2] - u[0] * Math.sin( angle ); a[8] = (1.0 - Math.cos( angle )) * u[0] * u[2] - u[1] * Math.sin( angle ); a[9] = (1.0 - Math.cos( angle )) * u[1] * u[2] + u[0] * Math.sin( angle ); a[10] = (1.0 - Math.cos( angle )) * Math.pow( u[2], 2 ) + Math.cos( angle ); final AffineTransform3D res = new AffineTransform3D(); res.set( a ); return res.copy(); }
public void addTimepoint(int id, double[] shift) { AffineTransform3D t = new AffineTransform3D(); t.translate( shift ); tpTransforms.put( id, t.copy()); }
/** * copy constructor * @param s */ protected ViewerState( final ViewerState s ) { sources = new ArrayList<>( s.sources.size() ); for ( final SourceState< ? > source : s.sources ) this.sources.add( source.copy( this ) ); unmodifiableSources = Collections.unmodifiableList( sources ); groups = new ArrayList<>( s.groups.size() ); for ( final SourceGroup group : s.groups ) groups.add( group.copy() ); unmodifiableGroups = Collections.unmodifiableList( groups ); numTimepoints = s.numTimepoints; viewerTransform = s.viewerTransform.copy(); interpolation = s.interpolation; displayMode = s.displayMode; currentSource = s.currentSource; currentGroup = s.currentGroup; currentTimepoint = s.currentTimepoint; }
public void addIllumination(int id, double[] shift) { AffineTransform3D t = new AffineTransform3D(); t.translate( shift ); illumTransforms.put( id, t.copy() ); }
public void addTile(int id, double[] shift) { AffineTransform3D t = new AffineTransform3D(); t.translate( shift ); tileTransforms.put( id, t.copy().inverse() ); }
public static enum ImgDataType { VIRTUAL, CACHED, PRECOMPUTED }; public static String[] imgDataTypeChoice = new String[]{ "Virtual", "Cached", "Precompute Image" };
model = model.copy(); TransformVirtual.scaleTransform( model, 1.0 / downsampling );
public static Pair< double[], AffineTransform3D > scaling( final Dimensions dim, final AffineTransform3D transformationModel ) { final AffineTransform3D transform = transformationModel.copy(); final AffineTransform3D mapBack = TransformationTools.computeMapBackModel( dim, new AffineTransform3D(), // identity TransformationTools.getModel( transform ), // current model new RigidModel3D() ); // what to use // reset translation mapBack.set( 0.0, 0, 3 ); mapBack.set( 0.0, 1, 3 ); mapBack.set( 0.0, 2, 3 ); //System.out.println( "MapBack: " + TransformationTools.printAffine3D( mapBack ) ); final AffineTransform3D atOrigin = transform.preConcatenate( mapBack ); //System.out.println( "At origin: " + TransformationTools.printAffine3D( atOrigin ) ); // there seems to be a bug in Transform3D, it does mix up the y/z dimensions sometimes // TransformationTools.getScaling( atOrigin, scale ); // the scale is approximately now the diagonal entries in the matrix // and we are only interested in the absolute value since it could be mirrored, in which case the scaling is negative return new ValuePair<>( new double[]{ Math.abs( atOrigin.get( 0, 0 ) ), Math.abs( atOrigin.get( 1, 1 ) ), Math.abs( atOrigin.get( 2, 2 ) ) }, mapBack ); }
model = model.copy(); TransformVirtual.scaleTransform( model, 1.0 / downsampling );
tr0 = tr0.copy(); new ViewRegistration( 0, 0, tr0 ); vrMap.put( view0, new ViewRegistration( 0, 0, tr0 ) ); tr1 = tr1.copy(); new ViewRegistration( 0, 1, tr1 ); vrMap.put( view1, new ViewRegistration( 0, 1, tr1 ) ); tr2 = tr2.copy(); new ViewRegistration( 0, 2, tr2 ); vrMap.put( view2, new ViewRegistration( 0, 2, tr2 ) );
transform = vr.getModel().copy(); final AffineTransform3D aniso = new AffineTransform3D(); aniso.set(
vr.preconcatenateTransform( new ViewTransformAffine( "Rotation from Metadata", rotation.copy() ));
source.getSourceTransform( timepoint, 0, sourceToGlobal ); final AffineTransform3D globalToSource = sourceToGlobal.inverse(); final AffineTransform3D cropToSource = globalToSource.copy(); cropToSource.concatenate( cropToGlobal );
public static void reCenterViews(final BigDataViewer viewer, final Collection<BasicViewDescription< ? >> selectedViews, final ViewRegistrations viewRegistrations) AffineTransform3D currentViewerTransform = viewer.getViewer().getDisplay().getTransformEventHandler().getTransform().copy(); final int cX = viewer.getViewer().getWidth() / 2; // size of the display area of the frame final int cY = viewer.getViewer().getHeight() / 2; // size of the display area of the frame