当前位置: 首页>>代码示例>>Java>>正文


Java AffineTransform3D.set方法代码示例

本文整理汇总了Java中net.imglib2.realtransform.AffineTransform3D.set方法的典型用法代码示例。如果您正苦于以下问题:Java AffineTransform3D.set方法的具体用法?Java AffineTransform3D.set怎么用?Java AffineTransform3D.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.imglib2.realtransform.AffineTransform3D的用法示例。


在下文中一共展示了AffineTransform3D.set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getInitialTransforms

import net.imglib2.realtransform.AffineTransform3D; //导入方法依赖的package包/类
/**
 * 
 * @param vr the ViewRegistration to decompose
 * @param is2d true or false
 * @param dsCorrectionT downsampling correction 
 * @return (1) the ViewRegistration without Translation part and the translation, with the inverse of (1) and dsCorrection applied
 */
public static Pair<AffineGet, TranslationGet> getInitialTransforms( final ViewRegistration vr, final boolean is2d, final AffineTransform3D dsCorrectionT )
{
	AffineTransform3D model = vr.getModel().copy();
	
	// get model without translation (last column set to 0)
	AffineTransform3D modelWithoutTranslation = model.copy();
	modelWithoutTranslation.set( 0, 0, 3 );
	modelWithoutTranslation.set( 0, 1, 3 );
	modelWithoutTranslation.set( 0, 2, 3 );
	
	// the translation with inverse of other part of model applied
	final double[] target = model.getTranslation();
	modelWithoutTranslation.applyInverse( target, target );
	
	// we go from big to downsampled, thats why the inverse
	dsCorrectionT.applyInverse( target, target );
	
	
	if ( is2d )
		return new ValuePair<>(modelWithoutTranslation, new Translation2D( target[ 0 ], target[ 1 ] ));
	else
		return new ValuePair<>(modelWithoutTranslation, new Translation3D( target[ 0 ], target[ 1 ], target[ 2 ] ));
}
 
开发者ID:PreibischLab,项目名称:BigStitcher,代码行数:31,代码来源:TransformTools.java

示例2: main

import net.imglib2.realtransform.AffineTransform3D; //导入方法依赖的package包/类
public static void main(String[] args)
{
	Interval start = new FinalInterval( new long[] {0,0,0},  new long[] {100, 100, 1});
	List<Interval> res = generateTileList( start, 3, 3, 0.2 );
	for (Interval i : res){
		System.out.println("(" + Long.toString( i.min( 0 )) + "," + Long.toString( i.min( 1 )) + ")");
	}
	
	final AffineTransform3D m = new AffineTransform3D();
	double scale = 300;
	m.set( scale, 0.0f, 0.0f, 0.0f, 
		   0.0f, scale, 0.0f, 0.0f,
		   0.0f, 0.0f, scale, 0.0f );
	
	FractalSpimDataGenerator fsdg = new FractalSpimDataGenerator(3);
	fsdg.addFractal( m );
	
	BigDataViewer.open(  fsdg.generateSpimData( res ), "", null, null );
	
	/*
	new ImageJ();
	RandomAccessibleInterval< LongType > rai = new FractalSpimDataGenerator( new AffineTransform2D() ).getImage( res.get( 0 ) );
	ImageJFunctions.show( rai );
	*/
}
 
开发者ID:PreibischLab,项目名称:BigStitcher,代码行数:26,代码来源:FractalSpimDataGenerator.java

示例3: createMipmapTransforms

import net.imglib2.realtransform.AffineTransform3D; //导入方法依赖的package包/类
public  AffineTransform3D[] createMipmapTransforms()
{
	final AffineTransform3D[] mipmapTransforms = new AffineTransform3D[ numScales ];
	for ( int l = 0; l < numScales; ++l )
	{
		final int si = 1 << l;

		final AffineTransform3D mipmapTransform = new AffineTransform3D();

		mipmapTransform.set( si * scaleX, 0, 0 );
		mipmapTransform.set( si * scaleY, 1, 1 );
		mipmapTransform.set( si * scaleZ, 2, 2 );

		final double offset = 0.5 * ( si - 1 );

		mipmapTransform.set( offset * scaleX, 0, 3 );
		mipmapTransform.set( offset * scaleY, 1, 3 );
		mipmapTransform.set( offset * scaleZ, 2, 3 );

		mipmapTransforms[ l ] = mipmapTransform;
	}

	return mipmapTransforms;
}
 
开发者ID:saalfeldlab,项目名称:bigcat,代码行数:25,代码来源:AbstractKnossosImageLoader.java

示例4: get

import net.imglib2.realtransform.AffineTransform3D; //导入方法依赖的package包/类
@Override
public AffineTransform3D get( final double t )
{
	final AffineTransform3D transform = new AffineTransform3D();
	transform.set( transformStart );

	// center shift
	transform.set( transform.get( 0, 3 ) - cX, 0, 3 );
	transform.set( transform.get( 1, 3 ) - cY, 1, 3 );

	// rotate
	final AffineTransform3D tAddCurrent = Rotation2DHelpers.rotationToTransform( totalAngle * t );
	transform.preConcatenate( tAddCurrent );

	// center un-shift
	transform.set( transform.get( 0, 3 ) + cX, 0, 3 );
	transform.set( transform.get( 1, 3 ) + cY, 1, 3 );
	

	return transform;
}
 
开发者ID:saalfeldlab,项目名称:bigwarp,代码行数:22,代码来源:RotationAnimator2D.java

示例5: resetView

import net.imglib2.realtransform.AffineTransform3D; //导入方法依赖的package包/类
public void resetView()
{
	final RandomAccessibleInterval< ? > interval = getSources().get( 1 ).getSpimSource().getSource( 0, 0 );

	final AffineTransform3D viewXfm = new AffineTransform3D();
	viewXfm.identity();
	viewXfm.set( -interval.min( 2 ), 2, 3 );

	if ( viewerFrameP.isActive() )
	{
		if ( viewerP.getOverlay().getIsTransformed() )
			viewerP.animateTransformation( initialViewQ );
		else
			viewerP.animateTransformation( initialViewP );
	}
	else if ( viewerFrameQ.isActive() )
		viewerQ.animateTransformation( initialViewQ );
}
 
开发者ID:saalfeldlab,项目名称:bigwarp,代码行数:19,代码来源:BigWarp.java

示例6: exportImage

import net.imglib2.realtransform.AffineTransform3D; //导入方法依赖的package包/类
@Override
public < T extends RealType< T > & NativeType< T > > boolean exportImage( final RandomAccessibleInterval<T> img, final BoundingBoxGUI bb, final TimePoint tp, final ViewSetup vs, final double min, final double max )
{
	// write the image
	if ( !this.saver.exportImage( img, bb, tp, vs, min, max ) )
		return false;

	// update the registrations
	final ViewRegistration vr = spimData.getViewRegistrations().getViewRegistration( new ViewId( tp.getId(), vs.getId() ) );
	
	final double scale = bb.getDownSampling();
	final AffineTransform3D m = new AffineTransform3D();
	m.set( scale, 0.0f, 0.0f, bb.min( 0 ), 
		   0.0f, scale, 0.0f, bb.min( 1 ),
		   0.0f, 0.0f, scale, bb.min( 2 ) );
	final ViewTransform vt = new ViewTransformAffine( "fusion bounding box", m );

	vr.getTransformList().clear();
	vr.getTransformList().add( vt );
	
	return true;
}
 
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:23,代码来源:ExportSpimData2TIFF.java

示例7: rotationCentered

import net.imglib2.realtransform.AffineTransform3D; //导入方法依赖的package包/类
/**
 * Computes a rotation about an input center point
 * 
 * @param axis
 * @param angle in radians
 * @param center
 * @return
 */
public static AffineTransform3D rotationCentered( int axis, double angle, double[] center)
{
	/******************************/
	AffineTransform3D xfm = new AffineTransform3D();
	xfm.rotate( axis, angle );

	int ndims = center.length;
	double[] target = new double[ ndims ];
	
	xfm.apply( center, target );
	
	double[] diff = ArrayUtil.subtract( center, target );

	for (int i = 0; i < ndims; i++) {
		xfm.set(diff[i], i, ndims);
	}
	/******************************/

	return xfm;	
}
 
开发者ID:bogovicj,项目名称:hhmi-exp,代码行数:29,代码来源:TransformTools.java

示例8: setModelToCalibration

import net.imglib2.realtransform.AffineTransform3D; //导入方法依赖的package包/类
public static void setModelToCalibration( final SpimData spimData, final ViewId viewId, final double minResolution )
{
	setModelToIdentity( spimData, viewId );
	
	final ViewRegistrations viewRegistrations = spimData.getViewRegistrations();
	final ViewRegistration r = viewRegistrations.getViewRegistration( viewId );
	
	final ViewDescription viewDescription = spimData.getSequenceDescription().getViewDescription( 
			viewId.getTimePointId(), viewId.getViewSetupId() );

	VoxelDimensions voxelSize = ViewSetupUtils.getVoxelSizeOrLoad( viewDescription.getViewSetup(), viewDescription.getTimePoint(), spimData.getSequenceDescription().getImgLoader() );
	final double calX = voxelSize.dimension( 0 ) / minResolution;
	final double calY = voxelSize.dimension( 1 ) / minResolution;
	final double calZ = voxelSize.dimension( 2 ) / minResolution;
	
	final AffineTransform3D m = new AffineTransform3D();
	m.set( calX, 0.0f, 0.0f, 0.0f, 
		   0.0f, calY, 0.0f, 0.0f,
		   0.0f, 0.0f, calZ, 0.0f );
	final ViewTransform vt = new ViewTransformAffine( "calibration", m );
	r.preconcatenateTransform( vt );
}
 
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:23,代码来源:Apply_Transformation.java

示例9: exportImage

import net.imglib2.realtransform.AffineTransform3D; //导入方法依赖的package包/类
@Override
public < T extends RealType< T > & NativeType< T > > boolean exportImage( final RandomAccessibleInterval<T> img, final BoundingBoxGUI bb, final TimePoint tp, final ViewSetup vs, final double min, final double max )
{
	if ( appendToHdf5 != null )
		return appendToHdf5.exportImage( img, bb, tp, vs, min, max );

	// write the image
	if ( !this.saver.exportImage( img, bb, tp, vs, min, max ) )
		return false;

	// update the registrations
	final ViewRegistration vr = spimData.getViewRegistrations().getViewRegistration( new ViewId( tp.getId(), vs.getId() ) );

	final double scale = bb.getDownSampling();
	final AffineTransform3D m = new AffineTransform3D();
	m.set( scale, 0.0f, 0.0f, bb.min( 0 ),
		   0.0f, scale, 0.0f, bb.min( 1 ),
		   0.0f, 0.0f, scale, bb.min( 2 ) );
	final ViewTransform vt = new ViewTransformAffine( "fusion bounding box", m );

	vr.getTransformList().clear();
	vr.getTransformList().add( vt );

	return true;
}
 
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:26,代码来源:AppendSpimData2.java

示例10: getAffineTransform3D

import net.imglib2.realtransform.AffineTransform3D; //导入方法依赖的package包/类
public static AffineTransform3D getAffineTransform3D( final Element parent, final String name, final AffineTransform3D defaultValue )
{
	final double[] values = getDoubleArray( parent, name, null );
	if ( values == null )
	{
		return defaultValue;
	}
	else if ( values.length == 12 )
	{
		final AffineTransform3D a = new AffineTransform3D();
		a.set( values );
		return a;
	}
	else
		throw new NumberFormatException( "Inappropriate parameters for " + AffineTransform3D.class.getCanonicalName() );
}
 
开发者ID:bigdataviewer,项目名称:spimdata,代码行数:17,代码来源:XmlHelpers.java

示例11: createViewRegistrations

import net.imglib2.realtransform.AffineTransform3D; //导入方法依赖的package包/类
public static ViewRegistrations createViewRegistrations()
{
	final HashMap< ViewId, ViewRegistration > registrations = new HashMap< ViewId, ViewRegistration >();

	registrations.put( new ViewId( 21, 1 ), new ViewRegistration( 21, 1 ) );

	final AffineTransform3D t00 = new AffineTransform3D();
	t00.set( 1, 0, 0, 1.3, 0, 1, 0, 1.3, 0, 0, 1, 2.3 );
	registrations.put( new ViewId( 1, 0 ), new ViewRegistration( 0, 0, t00 ) );

	final ArrayList< ViewTransform > list = new ArrayList< ViewTransform >();
	list.add( new ViewTransformAffine( null, t00 ) );
	list.add( new ViewTransformAffine( "identity", new AffineTransform3D() ) );
	registrations.put( new ViewId( 41, 1 ), new ViewRegistration( 41, 1, list ) );

	final ViewRegistrations viewRegistrations = new ViewRegistrations( registrations );
	return viewRegistrations;
}
 
开发者ID:bigdataviewer,项目名称:spimdata,代码行数:19,代码来源:SpimDataExample2.java

示例12: getTile

import net.imglib2.realtransform.AffineTransform3D; //导入方法依赖的package包/类
public void getTile( final AffineTransform3D viewTransform, final int t, final int tileW, final int tileH, final double screenScale, final Interpolation interpolation, final OutputStream os ) throws IOException
{
	final AffineTransform3D screenScaleTransform = new AffineTransform3D();
	screenScaleTransform.set( screenScale, 0, 0 );
	screenScaleTransform.set( screenScale, 1, 1 );
	screenScaleTransform.set( 0.5 * screenScale - 0.5, 0, 3 );
	screenScaleTransform.set( 0.5 * screenScale - 0.5, 1, 3 );
	viewTransform.preConcatenate( screenScaleTransform );

	state.setViewerTransform( viewTransform );
	state.setCurrentTimepoint( t );
	state.setInterpolation( interpolation );
	renderer.paint( state, ( int ) ( screenScale * tileW ), ( int ) ( screenScale * tileH ) );

	final ImageOutputStream ios = ImageIO.createImageOutputStream( os );
	jpegWriter.setOutput( ios );
	jpegWriter.write( null, new IIOImage( renderer.getBufferedImage(), null, null ), param );
	ios.close();
}
 
开发者ID:tpietzsch,项目名称:TileServer,代码行数:20,代码来源:TileGenerator.java

示例13: getAffine

import net.imglib2.realtransform.AffineTransform3D; //导入方法依赖的package包/类
@Override
public AffineGet getAffine(double[] p)
{
	final AffineTransform3D res = new AffineTransform3D();
	for (int i = 0; i < n; ++i)
		res.set( p[i], i, n );
	return res;
}
 
开发者ID:PreibischLab,项目名称:BigStitcher,代码行数:9,代码来源:TranslationWarp.java

示例14: decomposeIntoAffineAndTranslation

import net.imglib2.realtransform.AffineTransform3D; //导入方法依赖的package包/类
public static Pair<AffineGet, AffineGet> decomposeIntoAffineAndTranslation(AffineGet tr)
{
	AffineTransform3D t = new AffineTransform3D();
	t.set( tr.getRowPackedCopy() );
	t.set( 0, 0, 3 );
	t.set( 0, 1, 3 );
	t.set( 0, 2, 3 );
	AffineTransform3D tt = new AffineTransform3D();
	tt.set( tr.get( 0, 3 ), 0, 3 );
	tt.set( tr.get( 1, 3 ), 1, 3 );
	tt.set( tr.get( 2, 3 ), 2, 3 );
	
	return new ValuePair< AffineGet, AffineGet >( t, tt );
}
 
开发者ID:PreibischLab,项目名称:BigStitcher,代码行数:15,代码来源:TransformTools.java

示例15: createTranslation

import net.imglib2.realtransform.AffineTransform3D; //导入方法依赖的package包/类
public static AffineTransform3D createTranslation( final double tx, final double ty, final double tz )
{
	final AffineTransform3D translation = new AffineTransform3D();

	translation.set( tx, 0, 3 );
	translation.set( ty, 1, 3 );
	translation.set( tz, 2, 3 );

	return translation;
}
 
开发者ID:PreibischLab,项目名称:BigStitcher,代码行数:11,代码来源:TransformTools.java


注:本文中的net.imglib2.realtransform.AffineTransform3D.set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。