mpicbg.models.TranslationModel3D Java Examples

The following examples show how to use mpicbg.models.TranslationModel3D. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SPIMConfiguration.java    From SPIM_Registration with GNU General Public License v2.0 5 votes vote down vote up
public AbstractAffineModel3D getModel()
  {
if ( transformationModel.equals( "Translation" ) )
	return new TranslationModel3D();
else if ( transformationModel.equals( "Rigid" ) )
	return new RigidModel3D();
else
	return new AffineModel3D();
  }
 
Example #2
Source File: TransformationTools.java    From BigStitcher with GNU General Public License v2.0 4 votes vote down vote up
public static void main( String[] args )
{
	final SpimData d = GenerateSpimData.grid3x2();
	final SequenceDescription sd = d.getSequenceDescription();

	// select views to process
	final List< ViewId > rawViewIds = new ArrayList< ViewId >();
	rawViewIds.addAll( sd.getViewDescriptions().keySet() );
	Collections.sort( rawViewIds );

	// take together all views where the all attributes are the same except channel (i.e. group the channels)
	final List< Group<ViewId> > viewIds = Group.groupByChannel( rawViewIds, sd );

	// define fixed tiles
	final ArrayList< ViewId > fixedViews = new ArrayList< ViewId >();
	fixedViews.addAll( viewIds.get( 0 ).getViews() );

	final long[] downsamplingFactors = new long[] {2,2,1};

	final List<Pair<Group<ViewId>, Group<ViewId>>> pairs = new ArrayList<>();
	for (int i = 0; i < viewIds.size(); i++)
		for (int j = i+1; j< viewIds.size(); j++)
			pairs.add( new ValuePair<>( viewIds.get( i ), viewIds.get( j ) ) );		
	
	final GroupedViewAggregator gva = new GroupedViewAggregator();
	gva.addAction( ActionType.AVERAGE, Channel.class, null );
	
	// compute pairwise shifts
	final ArrayList< PairwiseStitchingResult <ViewId>> results = computePairs( pairs,
															new PairwiseStitchingParameters(), 
															d.getViewRegistrations(),
															d.getSequenceDescription() ,
															gva,
															downsamplingFactors);

	results.forEach( r -> System.out.println( r.getTransform() ) );
	
	for ( final ViewId v : fixedViews )
		System.out.println( "Fixed: " + v );

	GlobalOpt.compute( 
			new TranslationModel3D(),
			new ImageCorrelationPointMatchCreator( results, 0.5 ),
			new ConvergenceStrategy( 5.0 ),
			fixedViews,
			viewIds );


}