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


Java AffineTransform3D类代码示例

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


AffineTransform3D类属于net.imglib2.realtransform包,在下文中一共展示了AffineTransform3D类的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: 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);
		}

	}
 
开发者ID:saalfeldlab,项目名称:bigcat,代码行数:27,代码来源:AnnotationsController.java

示例4: LabelRestrictToSegmentController

import net.imglib2.realtransform.AffineTransform3D; //导入依赖的package包/类
public LabelRestrictToSegmentController(
		final ViewerPanel viewer,
		final RandomAccessibleInterval< LabelMultisetType > labels,
		final RandomAccessibleInterval< LongType > paintedLabels,
		final AffineTransform3D labelTransform,
		final FragmentSegmentAssignment assignment,
		final SelectionController selectionController,
		final Shape shape,
		final InputTriggerConfig config )
{
	this.viewer = viewer;
	this.labels = labels;
	this.paintedLabels = paintedLabels;
	this.labelTransform = labelTransform;
	this.assignment = assignment;
	this.selectionController = selectionController;
	this.shape = shape;
	inputAdder = config.inputTriggerAdder( inputTriggerMap, "restrict" );

	labelLocation = new RealPoint( 3 );

	new Intersect( "restrict", "shift R button1" ).register();
}
 
开发者ID:saalfeldlab,项目名称:bigcat,代码行数:24,代码来源:LabelRestrictToSegmentController.java

示例5: getVisibleIds

import net.imglib2.realtransform.AffineTransform3D; //导入依赖的package包/类
@Override
public synchronized TLongHashSet getVisibleIds()
{
	final TLongHashSet visibleIds = new TLongHashSet();
	final int w = viewer.getWidth();
	final int h = viewer.getHeight();
	final AffineTransform3D viewerTransform = new AffineTransform3D();
	viewer.getState().getViewerTransform( viewerTransform );
	IntervalView< LabelMultisetType > screenLabels =
			Views.interval(
					Views.hyperSlice(
							RealViews.affine( labels, viewerTransform ), 2, 0 ),
					new FinalInterval( w, h ) );

	for ( final LabelMultisetType pixel : Views.iterable( screenLabels ) )
	{
		for ( final Entry< Label > entry : pixel.entrySet() )
				visibleIds.add( entry.getElement().id() );
	}

	return visibleIds;
}
 
开发者ID:saalfeldlab,项目名称:bigcat,代码行数:23,代码来源:LabelMultiSetIdPicker.java

示例6: 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

示例7: getInterpolatedSource

import net.imglib2.realtransform.AffineTransform3D; //导入依赖的package包/类
@Override
public RealRandomAccessible< T > getInterpolatedSource( final int t, final int level, final Interpolation method )
{
	if( isTransformed )
	{
		final AffineTransform3D transform = new AffineTransform3D();
		source.getSourceTransform( t, level, transform );
		final RealRandomAccessible< T > sourceRealAccessible = RealViews.affineReal( source.getInterpolatedSource( t, level, method ), transform );
		if( xfm == null )
			return sourceRealAccessible;
		else
			return new RealTransformRealRandomAccessible< T, InverseRealTransform >( sourceRealAccessible, xfm );
	}
	else
	{
		return source.getInterpolatedSource( t, level, method );
	}
}
 
开发者ID:saalfeldlab,项目名称:bigwarp,代码行数:19,代码来源:WarpedSource.java

示例8: BigWarpViewerPanel

import net.imglib2.realtransform.AffineTransform3D; //导入依赖的package包/类
public BigWarpViewerPanel( final List< SourceAndConverter< ? > > sources, final BigWarpViewerSettings viewerSettings, final CacheControl cache, final ViewerOptions optional, boolean isMoving, 
		int[] movingSourceIndexList, int[] targetSourceIndexList  )
{
	super( sources, 1, cache, optional );
	this.sources = sources;
	this.viewerSettings = viewerSettings;
	options = optional;
	this.isMoving = isMoving;
	this.updateOnDrag = !isMoving; // update on drag only for the fixed
									// image by default
	this.movingSourceIndexList = movingSourceIndexList;
	this.targetSourceIndexList = targetSourceIndexList;
	destXfm = new AffineTransform3D();

	updateGrouping();
}
 
开发者ID:saalfeldlab,项目名称:bigwarp,代码行数:17,代码来源:BigWarpViewerPanel.java

示例9: 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

示例10: setTransform

import net.imglib2.realtransform.AffineTransform3D; //导入依赖的package包/类
@Override
public void setTransform( AffineTransform3D transform ) 
{
	synchronized ( affine3d ) 
	{
		affine3d.set( 
				transform.get( 0, 0 ), transform.get( 0, 1 ), 0.0, transform.get( 0, 3 ), 
				transform.get( 1, 0 ), transform.get( 1, 1 ), 0.0, transform.get( 1, 3 ),
				0.0, 0.0, 1.0, 0.0);
		
		AffineTransform2D tmp2dxfm = new AffineTransform2D();
		tmp2dxfm.set( 	transform.get( 0, 0 ), transform.get( 0, 1 ), transform.get( 0, 3 ),
						transform.get( 1, 0 ), transform.get( 1, 1 ), transform.get( 1, 3 ));
		handler2d.setTransform(tmp2dxfm);
	}
}
 
开发者ID:saalfeldlab,项目名称:bigwarp,代码行数:17,代码来源:TransformHandler3DWrapping2D.java

示例11: matchWindowTransforms

import net.imglib2.realtransform.AffineTransform3D; //导入依赖的package包/类
/**
 * Changes the view transformation of 'panelToChange' to match that of 'panelToMatch' 
 * @param panelToChange the viewer panel whose transform will change
 * @param panelToMatch the viewer panel the transform will come from
 * @param toPreconcat currently unused
 */
protected void matchWindowTransforms( final BigWarpViewerPanel panelToChange, final BigWarpViewerPanel panelToMatch, final AffineTransform3D toPreconcat )
{
	panelToChange.showMessage( "Aligning" );
	panelToMatch.showMessage( "Matching alignment" );

	// get the transform from panelToMatch
	final AffineTransform3D viewXfm = new AffineTransform3D();
	panelToMatch.getState().getViewerTransform( viewXfm );

	// change transform of panelToChange
	panelToChange.animateTransformation( viewXfm );

	final AffineTransform3D resXfm = new AffineTransform3D();
	panelToChange.getState().getViewerTransform( resXfm );

}
 
开发者ID:saalfeldlab,项目名称:bigwarp,代码行数:23,代码来源:BigWarp.java

示例12: matchOtherViewerPanelToActive

import net.imglib2.realtransform.AffineTransform3D; //导入依赖的package包/类
public void matchOtherViewerPanelToActive()
{
	BigWarpViewerPanel panelToChange;
	BigWarpViewerPanel panelToMatch;

	AffineTransform3D toPreconcat = null;

	if ( viewerFrameP.isActive() )
	{
		panelToChange = viewerQ;
		panelToMatch = viewerP;
	}
	else if ( viewerFrameQ.isActive() )
	{
		panelToChange = viewerP;
		panelToMatch = viewerQ;
		toPreconcat = fixedViewXfm;
	}
	else
		return;

	matchWindowTransforms( panelToChange, panelToMatch, toPreconcat );
}
 
开发者ID:saalfeldlab,项目名称:bigwarp,代码行数:24,代码来源:BigWarp.java

示例13: matchActiveViewerPanelToOther

import net.imglib2.realtransform.AffineTransform3D; //导入依赖的package包/类
public void matchActiveViewerPanelToOther()
{
	BigWarpViewerPanel panelToChange;
	BigWarpViewerPanel panelToMatch;

	AffineTransform3D toPreconcat = null;

	if ( viewerFrameP.isActive() )
	{
		panelToChange = viewerP;
		panelToMatch = viewerQ;
		toPreconcat = fixedViewXfm;
	}
	else if ( viewerFrameQ.isActive() )
	{
		panelToChange = viewerQ;
		panelToMatch = viewerP;
	}
	else
		return;

	matchWindowTransforms( panelToChange, panelToMatch, toPreconcat );
}
 
开发者ID:saalfeldlab,项目名称:bigwarp,代码行数:24,代码来源:BigWarp.java

示例14: 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

示例15: createModel

import net.imglib2.realtransform.AffineTransform3D; //导入依赖的package包/类
protected Model createModel( final File tgmmFolder, final SpimDataMinimal spimData, final int setupID, final RealInterval interval )
{
	final List< AffineTransform3D > transforms = pickTransform( spimData, setupID );

	final TGMMImporter2 importer = new TGMMImporter2( tgmmFolder, transforms, TGMMImporter2.DEFAULT_PATTERN, logger, interval, 0, Integer.MAX_VALUE );
	if ( !importer.checkInput() || !importer.process() )
	{
		logger.error( importer.getErrorMessage() );
		return new Model();
	}
	final Model model = importer.getResult();

	/*
	 * Hack to set the POSITION_T feature of imported spots.
	 */
	final Settings settings = new Settings();
	settings.dt = 1;
	final TrackMate trackmate = new TrackMate( model, settings );
	final ResetSpotTimeFeatureAction action = new ResetSpotTimeFeatureAction();
	action.execute( trackmate );

	return model;
}
 
开发者ID:fiji,项目名称:MaMuT,代码行数:24,代码来源:LoadTGMMAnnotationPlugIn.java


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