• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AffineTransform3D类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



AffineTransform3D类属于net.imglib2.realtransform包,在下文中一共展示了AffineTransform3D类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: centerViewOn

import net.imglib2.realtransform.AffineTransform3D; //导入依赖的package包/类
public void centerViewOn( final Spot spot )
{
	final int tp = spot.getFeature( Spot.FRAME ).intValue();
	setTimepoint( tp );

	final AffineTransform3D t = new AffineTransform3D();
	state.getViewerTransform( t );
	final double[] spotCoords = new double[] { spot.getFeature( Spot.POSITION_X ), spot.getFeature( Spot.POSITION_Y ), spot.getFeature( Spot.POSITION_Z ) };

	// Translate view so that the target spot is in the middle of the
	// JFrame.
	final double dx = display.getWidth() / 2 - ( t.get( 0, 0 ) * spotCoords[ 0 ] + t.get( 0, 1 ) * spotCoords[ 1 ] + t.get( 0, 2 ) * spotCoords[ 2 ] );
	final double dy = display.getHeight() / 2 - ( t.get( 1, 0 ) * spotCoords[ 0 ] + t.get( 1, 1 ) * spotCoords[ 1 ] + t.get( 1, 2 ) * spotCoords[ 2 ] );
	final double dz = -( t.get( 2, 0 ) * spotCoords[ 0 ] + t.get( 2, 1 ) * spotCoords[ 1 ] + t.get( 2, 2 ) * spotCoords[ 2 ] );

	// But use an animator to do this smoothly.
	final double[] target = new double[] { dx, dy, dz };
	currentAnimator = new TranslationAnimator( t, target, 300 );
	currentAnimator.setTime( System.currentTimeMillis() );
	requestRepaint();
}
 
开发者ID:fiji,项目名称:MaMuT,代码行数:22,代码来源:MamutViewerPanel.java


示例17: create

import net.imglib2.realtransform.AffineTransform3D; //导入依赖的package包/类
public static FusionResult create(
		final SpimRegistrationSequence spimseq,
		final String filepath,
		final String filepattern,
		final int numSlices,
		final double sliceValueMin,
		final double sliceValueMax,
		final Map< Integer, AffineTransform3D > perTimePointFusionTransforms )
{
	// add one fused ViewSetup per channel in the SpimRegistrationSequence
	final List< Integer > channels = new ArrayList<>();
	for ( final BasicViewSetup setup : spimseq.getSequenceDescription().getViewSetupsOrdered() )
	{
		final int channel = setup.getAttribute( Channel.class ).getId();
		if ( ! channels.contains( channel ) )
			channels.add( channel );
	}
	final TimePoints timepoints = spimseq.getSequenceDescription().getTimePoints();
	return new FusionResult( filepath, filepattern, channels, timepoints, numSlices, sliceValueMin, sliceValueMax, perTimePointFusionTransforms );
}
 
开发者ID:bigdataviewer,项目名称:bigdataviewer_fiji,代码行数:21,代码来源:FusionResult.java


示例18: FusionResult

import net.imglib2.realtransform.AffineTransform3D; //导入依赖的package包/类
public FusionResult(
		final String filepath,
		final String filepattern,
		final TimePoints timepoints,
		final int numSlices,
		final double sliceValueMin,
		final double sliceValueMax,
		final Map< Integer, AffineTransform3D > perTimePointFusionTransforms )
{
	final HashMap< Integer, Integer > setupIdToChannelId = new HashMap<>();
	setupIdToChannelId.put( 0, 0 );
	final ImgLoader fusionLoader = new FusionImageLoader<>( filepath +"/" + filepattern, setupIdToChannelId, numSlices, new FusionImageLoader.Gray32ImagePlusLoader(), sliceValueMin, sliceValueMax );
	final int setupId = 0;
	final String name = "fused";
	final int timepointId = timepoints.getTimePointsOrdered().get( 0 ).getId();
	final Dimensions size = fusionLoader.getSetupImgLoader( setupId ).getImageSize( timepointId );
	final VoxelDimensions voxelSize = fusionLoader.getSetupImgLoader( setupId ).getVoxelSize( timepointId );
	final BasicViewSetup setup = new BasicViewSetup( setupId, name, size, voxelSize );
	desc = new SequenceDescriptionMinimal( timepoints, Entity.idMap( Arrays.asList( setup ) ), fusionLoader, null );
	final ArrayList< ViewRegistration > registrations = new ArrayList<>();
	for ( final TimePoint timepoint : timepoints.getTimePointsOrdered() )
		registrations.add( new ViewRegistration( timepoint.getId(), 0, perTimePointFusionTransforms.get( timepoint.getId() ) ) );
	regs = new ViewRegistrations( registrations );
}
 
开发者ID:bigdataviewer,项目名称:bigdataviewer_fiji,代码行数:25,代码来源:FusionResult.java


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


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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NopStmt类代码示例发布时间:2022-05-22
下一篇:
Java Wrapper类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap