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

Java ViewRegistrations类代码示例

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

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



ViewRegistrations类属于mpicbg.spim.data.registration包,在下文中一共展示了ViewRegistrations类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: FusionResult

import mpicbg.spim.data.registration.ViewRegistrations; //导入依赖的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


示例2: setModelToCalibration

import mpicbg.spim.data.registration.ViewRegistrations; //导入依赖的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


示例3: numReorientated

import mpicbg.spim.data.registration.ViewRegistrations; //导入依赖的package包/类
protected Pair< Integer, Integer > numReorientated()
{
	final ViewRegistrations vrs = spimData.getViewRegistrations();

	int isReorientated = 0;
	int sumViews = 0;

	for ( final ViewId viewId : viewIdsToProcess )
	{
		final ViewDescription vd = spimData.getSequenceDescription().getViewDescription( viewId );
		
		if ( !vd.isPresent() )
			continue;

		final ViewRegistration vr = vrs.getViewRegistration( viewId );
		final ViewTransform vt = vr.getTransformList().get( 0 );

		++sumViews;

		if ( vt.hasName() && vt.getName().startsWith( reorientationDescription ) )
				++isReorientated;
	}

	return new ValuePair< Integer, Integer >( isReorientated, sumViews );
}
 
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:26,代码来源:AutomaticReorientation.java


示例4: createViewRegistrations

import mpicbg.spim.data.registration.ViewRegistrations; //导入依赖的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


示例5: filterNonOverlappingPairs

import mpicbg.spim.data.registration.ViewRegistrations; //导入依赖的package包/类
/**
 * 
 * @param pairs list of potentially overlapping pairs of view groups, this will be modified!
 * @param vrs the view registrations
 * @param sd the sequence description
 * @param <V> view id type
 * @return list of the pairs that were removed
 */
public static <V extends ViewId> List< Pair< Group< V >, Group< V > > > filterNonOverlappingPairs(
		List< Pair<  Group< V >,  Group< V > > > pairs,
		final ViewRegistrations vrs,
		final AbstractSequenceDescription< ?, ? extends BasicViewDescription< ? >, ? > sd
		)
{
	
	final List< Pair<  Group< V >,  Group< V > > > removedPairs = new ArrayList<>();
	
	for (int i = pairs.size() - 1; i >= 0; i--)
	{
		final List<Set<V>> pairAsGroups = new ArrayList<>();
		pairAsGroups.add( pairs.get( i ).getA().getViews() );
		pairAsGroups.add( pairs.get( i ).getB().getViews() );
		
		final BoundingBoxMaximalGroupOverlap< V > ibbd = new BoundingBoxMaximalGroupOverlap< V >(pairAsGroups, sd, vrs);
		BoundingBox bb = ibbd.estimate( "max overlap" );
		
		if (bb == null)
		{
			removedPairs.add( pairs.get( i ) );
			pairs.remove( i );
		}
		
	}
	
	return removedPairs;
	
}
 
开发者ID:PreibischLab,项目名称:BigStitcher,代码行数:38,代码来源:TransformationTools.java


示例6: getCopyWithMissingViews

import mpicbg.spim.data.registration.ViewRegistrations; //导入依赖的package包/类
public static SpimData2 getCopyWithMissingViews(SpimData data, Collection< ? extends ViewId > missingViews, boolean ignoreOldMissingViews)
{
	final File basePath = data.getBasePath();
	final ViewRegistrations viewRegistrations = data.getViewRegistrations();
	
	final SequenceDescription sdOld = data.getSequenceDescription();
	
	final List<ViewId> missingViewsList = new ArrayList<>( missingViews );
	
	if (!ignoreOldMissingViews && sdOld.getMissingViews() != null )
		sdOld.getMissingViews().getMissingViews().forEach( mv -> missingViewsList.add( mv ) );
	
	final SequenceDescription sequenceDescription = 
			new SequenceDescription( 
					sdOld.getTimePoints(),
					sdOld.getViewSetupsOrdered(),
					sdOld.getImgLoader(),
					new MissingViews( missingViewsList ) );
	
	final ViewInterestPoints viewsInterestPoints = SpimData2.class.isInstance( data ) ? ((SpimData2)data).getViewInterestPoints() : new ViewInterestPoints();
	if (!(SpimData2.class.isInstance( data )))
		viewsInterestPoints.createViewInterestPoints( data.getSequenceDescription().getViewDescriptions() );
	
	final BoundingBoxes boundingBoxes = SpimData2.class.isInstance( data ) ? ((SpimData2)data).getBoundingBoxes() : new BoundingBoxes();
	final PointSpreadFunctions psfs = SpimData2.class.isInstance( data ) ? ((SpimData2)data).getPointSpreadFunctions() : new PointSpreadFunctions();
	final StitchingResults stitchingResults = SpimData2.class.isInstance( data ) ? ((SpimData2)data).getStitchingResults() : new StitchingResults();
			
	final SpimData2 dataNew = new SpimData2( basePath, sequenceDescription, viewRegistrations, viewsInterestPoints, boundingBoxes, psfs, stitchingResults );
	return dataNew;
}
 
开发者ID:PreibischLab,项目名称:BigStitcher,代码行数:31,代码来源:SelectIlluminationPopup.java


示例7: createModel

import mpicbg.spim.data.registration.ViewRegistrations; //导入依赖的package包/类
protected Model createModel( final File tgmmFolder, final SpimDataMinimal spimData, final int setupID, final RealInterval interval, final int tFrom, final int tTo )
{

	final SequenceDescriptionMinimal seq = spimData.getSequenceDescription();
	final ViewRegistrations regs = spimData.getViewRegistrations();
	final List< AffineTransform3D > transforms = new ArrayList< AffineTransform3D >( seq.getTimePoints().size() );
	for ( final TimePoint t : seq.getTimePoints().getTimePointsOrdered() )
	{
		transforms.add( regs.getViewRegistration( t.getId(), setupID ).getModel() );
	}

	final TGMMImporter2 importer = new TGMMImporter2( tgmmFolder, transforms, TGMMImporter2.DEFAULT_PATTERN, logger, interval, tFrom, tTo );
	if ( !importer.checkInput() || !importer.process() )
	{
		logger.error( importer.getErrorMessage() );
	}
	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,代码行数:30,代码来源:ImportTGMMAnnotationPlugin_.java


示例8: pickTransform

import mpicbg.spim.data.registration.ViewRegistrations; //导入依赖的package包/类
protected List< AffineTransform3D > pickTransform( final SpimDataMinimal spimData, final int setupID )
{
	final SequenceDescriptionMinimal seq = spimData.getSequenceDescription();
	final ViewRegistrations regs = spimData.getViewRegistrations();
	final List< AffineTransform3D > transforms = new ArrayList< AffineTransform3D >( seq.getTimePoints().size() );
	for ( final TimePoint t : seq.getTimePoints().getTimePointsOrdered() )
	{
		transforms.add( regs.getViewRegistration( t.getId(), setupID ).getModel() );
	}
	return transforms;
}
 
开发者ID:fiji,项目名称:MaMuT,代码行数:12,代码来源:LoadTGMMAnnotationPlugIn.java


示例9: preConcatenateTransform

import mpicbg.spim.data.registration.ViewRegistrations; //导入依赖的package包/类
public static void preConcatenateTransform( final SpimData spimData, final ViewId viewId, final AffineTransform3D model, final String name )
{
	final ViewRegistrations viewRegistrations = spimData.getViewRegistrations();

	// update the view registration
	final ViewRegistration vr = viewRegistrations.getViewRegistration( viewId );
	final ViewTransform vt = new ViewTransformAffine( name, model );
	vr.preconcatenateTransform( vt );
}
 
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:10,代码来源:Apply_Transformation.java


示例10: assembleRegistrationNames

import mpicbg.spim.data.registration.ViewRegistrations; //导入依赖的package包/类
public static HashMap< String, Integer > assembleRegistrationNames( final SpimData data, final List< ViewId > viewIds )
{
	final ViewRegistrations vr = data.getViewRegistrations();
	final SequenceDescription sd = data.getSequenceDescription();

	final HashMap< String, Integer > names = new HashMap< String, Integer >();

	for ( final ViewId viewId: viewIds )
	{
		final ViewDescription vd = sd.getViewDescription( viewId );

		if ( !vd.isPresent() )
			continue;

		final ViewRegistration r = vr.getViewRegistration( vd );
		final String rName = r.getTransformList().get( 0 ).getName();

		if ( rName != null )
		{
			if ( names.containsKey( rName ) )
				names.put( rName, names.get( rName ) + 1 );
			else
				names.put( rName, 1 );
		}
	}

	return names;
}
 
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:29,代码来源:GUIHelper.java


示例11: createDataset

import mpicbg.spim.data.registration.ViewRegistrations; //导入依赖的package包/类
@Override
public SpimData2 createDataset()
{
	// collect all the information
	if ( !queryInformation() )
		return null;
	
	// assemble timepints, viewsetups, missingviews and the imgloader
	final TimePoints timepoints = this.createTimePoints();
	final ArrayList< ViewSetup > setups = this.createViewSetups();
	final MissingViews missingViews = this.createMissingViews();
	
	// instantiate the sequencedescription
	final SequenceDescription sequenceDescription = new SequenceDescription( timepoints, setups, null, missingViews );
	final ImgLoader imgLoader = createAndInitImgLoader( ".", new File( directory ), imgFactory, sequenceDescription );
	sequenceDescription.setImgLoader( imgLoader );

	// get the minimal resolution of all calibrations
	final double minResolution = Apply_Transformation.assembleAllMetaData(
			sequenceDescription,
			sequenceDescription.getViewDescriptions().values() );

	IOFunctions.println( "Minimal resolution in all dimensions over all views is: " + minResolution );
	IOFunctions.println( "(The smallest resolution in any dimension; the distance between two pixels in the output image will be that wide)" );
	
	// create the initial view registrations (they are all the identity transform)
	final ViewRegistrations viewRegistrations = createViewRegistrations( sequenceDescription.getViewDescriptions(), minResolution );
	
	// create the initial view interest point object
	final ViewInterestPoints viewInterestPoints = new ViewInterestPoints();
	viewInterestPoints.createViewInterestPoints( sequenceDescription.getViewDescriptions() );

	// finally create the SpimData itself based on the sequence description and the view registration
	final SpimData2 spimData = new SpimData2( new File( directory ), sequenceDescription, viewRegistrations, viewInterestPoints, new BoundingBoxes() );

	return spimData;
}
 
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:38,代码来源:StackList.java


示例12: createViewRegistrations

import mpicbg.spim.data.registration.ViewRegistrations; //导入依赖的package包/类
/**
 * Assembles the {@link ViewRegistration} object consisting of a list of {@link ViewRegistration}s for all {@link ViewDescription}s that are present
 * 
 * @param viewDescriptionList
 * @param minResolution - the smallest resolution in any dimension (distance between two pixels in the output image will be that wide)
 * @return
 */
protected static ViewRegistrations createViewRegistrations( final Map< ViewId, ViewDescription > viewDescriptionList, final double minResolution )
{
	final HashMap< ViewId, ViewRegistration > viewRegistrationList = new HashMap< ViewId, ViewRegistration >();
	
	for ( final ViewDescription viewDescription : viewDescriptionList.values() )
		if ( viewDescription.isPresent() )
		{
			final ViewRegistration viewRegistration = new ViewRegistration( viewDescription.getTimePointId(), viewDescription.getViewSetupId() );
			
			final VoxelDimensions voxelSize = viewDescription.getViewSetup().getVoxelSize(); 

			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 );
			viewRegistration.preconcatenateTransform( vt );
			
			viewRegistrationList.put( viewRegistration, viewRegistration );
		}
	
	return new ViewRegistrations( viewRegistrationList );
}
 
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:35,代码来源:StackList.java


示例13: actionPerformed

import mpicbg.spim.data.registration.ViewRegistrations; //导入依赖的package包/类
@Override
public void actionPerformed( final ActionEvent e )
{
	if ( panel == null )
	{
		IOFunctions.println( "Panel not set for " + this.getClass().getSimpleName() );
		return;
	}

	//final AbstractSpimData< ? > data = (AbstractSpimData< ? >)panel.getSpimData();
	final List< ViewId > viewIds = panel.selectedRowsViewId();

	final ViewRegistrations vr = panel.getSpimData().getViewRegistrations();
	for ( final ViewId viewId : viewIds )
	{
		final ViewRegistration v = vr.getViewRegistrations().get( viewId );
		
		if ( index == 0 )
			v.getTransformList().remove( 0 );
		else
			v.getTransformList().remove( v.getTransformList().size() - 1 );

		v.updateModel();
	}

	panel.updateContent();
	ViewSetupExplorerPanel.bdvPopup().updateBDV();
}
 
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:29,代码来源:RemoveTransformationPopup.java


示例14: RegistrationTableModel

import mpicbg.spim.data.registration.ViewRegistrations; //导入依赖的package包/类
public RegistrationTableModel( final ViewRegistrations viewRegistrations, final RegistrationExplorerPanel panel )
{
	this.columnNames = new ArrayList< String >();
	this.panel = panel;
	this.columnNames.add( "Transformation Name" );
	
	for ( int row = 0; row < 3; ++row )
		for ( int col = 0; col < 4; ++ col )
			this.columnNames.add( "m" + row + "" + col );
	
	this.viewRegistrations = viewRegistrations;
	this.currentVD = null;
}
 
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:14,代码来源:RegistrationTableModel.java


示例15: RegistrationExplorerPanel

import mpicbg.spim.data.registration.ViewRegistrations; //导入依赖的package包/类
public RegistrationExplorerPanel( final ViewRegistrations viewRegistrations, final RegistrationExplorer< ?, ? > explorer )
{
	this.cache = new ArrayList< ViewTransform >();
	this.explorer = explorer;

	initComponent( viewRegistrations );
}
 
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:8,代码来源:RegistrationExplorerPanel.java


示例16: initComponent

import mpicbg.spim.data.registration.ViewRegistrations; //导入依赖的package包/类
public void initComponent( final ViewRegistrations viewRegistrations )
{
	tableModel = new RegistrationTableModel( viewRegistrations, this );

	table = new JTable();
	table.setModel( tableModel );
	table.setSurrendersFocusOnKeystroke( true );
	table.setSelectionMode( ListSelectionModel.SINGLE_INTERVAL_SELECTION );
	
	final DefaultTableCellRenderer centerRenderer = new DefaultTableCellRenderer();
	centerRenderer.setHorizontalAlignment( JLabel.CENTER );
	
	// center all columns
	for ( int column = 0; column < tableModel.getColumnCount(); ++column )
		table.getColumnModel().getColumn( column ).setCellRenderer( centerRenderer );

	table.setPreferredScrollableViewportSize( new Dimension( 1020, 300 ) );
	table.getColumnModel().getColumn( 0 ).setPreferredWidth( 300 );
	for ( int i = 1; i < table.getColumnCount(); ++i )
		table.getColumnModel().getColumn( i ).setPreferredWidth( 100 );
	final Font f = table.getFont();
	
	table.setFont( new Font( f.getName(), f.getStyle(), 11 ) );
	
	this.setLayout( new BorderLayout() );
	this.label = new JLabel( "View Description --- " );
	this.add( label, BorderLayout.NORTH );
	this.add( new JScrollPane( table ), BorderLayout.CENTER );
	
	addPopupMenu( table );
}
 
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:32,代码来源:RegistrationExplorerPanel.java


示例17: SpimData2

import mpicbg.spim.data.registration.ViewRegistrations; //导入依赖的package包/类
public SpimData2(
		final File basePath,
		final SequenceDescription sequenceDescription,
		final ViewRegistrations viewRegistrations,
		final ViewInterestPoints viewsInterestPoints,
		final BoundingBoxes boundingBoxes )
{
	super( basePath, sequenceDescription, viewRegistrations );

	this.viewsInterestPoints = viewsInterestPoints;
	this.boundingBoxes = boundingBoxes;
}
 
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:13,代码来源:SpimData2.java


示例18: exampleViewRegistrations

import mpicbg.spim.data.registration.ViewRegistrations; //导入依赖的package包/类
public static void exampleViewRegistrations() throws SpimDataException, IOException
{
	final XmlIoViewRegistrations io = new XmlIoViewRegistrations();
	final ViewRegistrations registrations = createViewRegistrations();
	final Document doc = new Document( io.toXml( registrations ) );
	new XMLOutputter( Format.getPrettyFormat() ).output( doc, System.out );

	final ViewRegistrations fromXml = io.fromXml( doc.getRootElement() );
	new XMLOutputter( Format.getPrettyFormat() ).output( new Document( new XmlIoViewRegistrations().toXml( fromXml ) ), System.out );
}
 
开发者ID:bigdataviewer,项目名称:spimdata,代码行数:11,代码来源:SpimDataExample2.java


示例19: reCenterViews

import mpicbg.spim.data.registration.ViewRegistrations; //导入依赖的package包/类
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

	IOFunctions.println( viewer.getViewer().getWidth() + " " + viewer.getViewer().getHeight() );

	final HashMap< BasicViewDescription< ? >, Dimensions > dimensions = new HashMap<>();
	final HashMap< BasicViewDescription< ? >, AffineTransform3D > registrations = new HashMap<>();

	for ( final BasicViewDescription< ? > view : selectedViews )
	{
		viewRegistrations.getViewRegistration( view ).updateModel();
		registrations.put( view, viewRegistrations.getViewRegistration( view ).getModel() );
		dimensions.put( view, view.getViewSetup().getSize() );
	}

	final BoundingBox bb = new BoundingBoxMaximal( selectedViews, dimensions, registrations ).estimate( "max" );
	final double[] com = new double[] {
			( bb.max( 0 ) - bb.min( 0 ) )/2 + bb.min( 0 ),
			( bb.max( 1 ) - bb.min( 1 ) )/2 + bb.min( 1 ),
			( bb.max( 2 ) - bb.min( 2 ) )/2 + bb.min( 2 ) };

	final RealInterval bounds = currentViewerTransform.estimateBounds( bb );
	IOFunctions.println( TransformTools.printRealInterval( bounds ));

	double currentScale = Math.max( 
			( bounds.realMax( 0 ) - bounds.realMin( 0 ) ) / viewer.getViewer().getWidth(),
			( bounds.realMax( 1 ) - bounds.realMin( 1 ) ) / viewer.getViewer().getHeight() );

	final Scale3D scale = new Scale3D( 1.0/currentScale, 1.0/currentScale, 1.0/currentScale );

	// ignore old translation
	currentViewerTransform.set( 0, 0, 3 );
	currentViewerTransform.set( 0, 1, 3 );
	currentViewerTransform.set( 0, 2, 3 );

	currentViewerTransform.preConcatenate( scale );

	// to screen units
	currentViewerTransform.apply( com, com );

	// reset translational part
	currentViewerTransform.set( -com[0] + cX , 0, 3 );
	currentViewerTransform.set( -com[1] + cY , 1, 3 );

	// check if all selected views are 2d
	boolean allViews2D = true;
	for (final BasicViewDescription< ? > vd : selectedViews)
		if (vd.isPresent() && vd.getViewSetup().hasSize() && vd.getViewSetup().getSize().dimension( 2 ) != 1)
		{
			allViews2D = false;
			break;
		}

	// do not move in z if we have 2d data
	if (allViews2D)
		currentViewerTransform.set( 0, 2, 3 );
	else
		currentViewerTransform.set( -com[2], 2, 3 );

	viewer.getViewer().setCurrentViewerTransform( currentViewerTransform );
}
 
开发者ID:PreibischLab,项目名称:BigStitcher,代码行数:65,代码来源:TransformationTools.java


示例20: computeStitchingNonEqualTransformations

import mpicbg.spim.data.registration.ViewRegistrations; //导入依赖的package包/类
public static < T extends RealType< T > > Pair<Pair< AffineGet, Double >, RealInterval> computeStitchingNonEqualTransformations(
		final Group<? extends ViewId> viewIdsA,
		final Group<? extends ViewId> viewIdsB,
		final ViewRegistrations vrs,
		final PairwiseStitchingParameters params,
		final AbstractSequenceDescription< ?,? extends BasicViewDescription<?>, ? > sd,
		final GroupedViewAggregator gva,
		final long[] downsampleFactors,
		final ExecutorService service )
{

	final double[] downsampleDbl = new double[downsampleFactors.length];
	for (int d = 0; d < downsampleFactors.length; d++)
		downsampleDbl[d] = downsampleFactors[d];

	// get Overlap Bounding Box
	final List<List<ViewId>> views = new ArrayList<>();
	views.add( new ArrayList<>(viewIdsA.getViews()) );
	views.add( new ArrayList<>(viewIdsB.getViews()) );
	BoundingBoxMaximalGroupOverlap< ViewId > bbDet = new BoundingBoxMaximalGroupOverlap<ViewId>( views, sd, vrs );
	BoundingBox bbOverlap = bbDet.estimate( "Max Overlap" );

	
	List<RandomAccessibleInterval< FloatType >> raiOverlaps = new ArrayList<>();		
	for (List< ViewId > tileViews : views)
	{
		// wrap every view id (corresponding e.g. to different channels, illums,.. ) in list
		List<List< ViewId >> wrapped = tileViews.stream().map( v -> {
			ArrayList< ViewId > wrp = new ArrayList<ViewId>();
			wrp.add( v );
			return wrp;} ).collect( Collectors.toList() );

		// open all of them "virtually fused"
		List< RandomAccessibleInterval< FloatType > > openFused = 
				DisplayOverlapTestPopup.openVirtuallyFused( sd, vrs, wrapped, bbOverlap, downsampleDbl );

		// aggregate the group into one image
		RandomAccessibleInterval< FloatType > raiI = gva.aggregate( 
				openFused, 
				tileViews,
				sd );

		raiOverlaps.add(raiI);
	}

	// the overlap in both images
	final RandomAccessibleInterval< FloatType > img1 = raiOverlaps.get(0);
	final RandomAccessibleInterval< FloatType > img2 = raiOverlaps.get(1);
	
	// compute phase correlation shift (passing (0,0,..) translations prevents any overlap correction inside)
	final Pair< Translation, Double > result = PairwiseStitching.getShift(
			img1,
			img2,
			new Translation( img1.numDimensions() ),
			new Translation( img1.numDimensions() ),
			params,
			service );

	if (result == null)
		return null;

	for (int i = 0; i< result.getA().numDimensions(); ++i)			
		result.getA().set( result.getA().get(i, result.getA().numDimensions()) * downsampleFactors[i], i ); 

	// TODO (?): Different translational part of downsample Transformations should be considered via TransformTools.getInitialTransforms
	// we probalbly do not have to correct for them ?
	final AffineTransform3D vr = vrs.getViewRegistration(viewIdsB.iterator().next()).getModel();		
	final AffineTransform resCorrected = new AffineTransform( result.getA().numDimensions() );
	resCorrected.set( result.getA() );

	System.out.println("shift: " + Util.printCoordinates(result.getA().getTranslationCopy()));
	System.out.print("cross-corr: " + result.getB());

	return new ValuePair<>( new ValuePair<>( resCorrected, result.getB() ), bbOverlap );
}
 
开发者ID:PreibischLab,项目名称:BigStitcher,代码行数:76,代码来源:TransformationTools.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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