本文整理汇总了Java中mpicbg.spim.data.registration.ViewRegistration.preconcatenateTransform方法的典型用法代码示例。如果您正苦于以下问题:Java ViewRegistration.preconcatenateTransform方法的具体用法?Java ViewRegistration.preconcatenateTransform怎么用?Java ViewRegistration.preconcatenateTransform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mpicbg.spim.data.registration.ViewRegistration
的用法示例。
在下文中一共展示了ViewRegistration.preconcatenateTransform方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setModelToCalibration
import mpicbg.spim.data.registration.ViewRegistration; //导入方法依赖的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 );
}
示例2: preConcatenateTransform
import mpicbg.spim.data.registration.ViewRegistration; //导入方法依赖的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 );
}
示例3: createViewRegistrations
import mpicbg.spim.data.registration.ViewRegistration; //导入方法依赖的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 );
}
示例4: twoAngles
import mpicbg.spim.data.registration.ViewRegistration; //导入方法依赖的package包/类
public static SpimData twoAngles()
{
final ArrayList< ViewSetup > setups = new ArrayList< ViewSetup >();
final ArrayList< ViewRegistration > registrations = new ArrayList< ViewRegistration >();
final Channel c0 = new Channel( 0, "test" );
final Angle a0 = new Angle( 0 );
final Angle a1 = new Angle( 1 );
final Illumination i0 = new Illumination( 0 );
final Dimensions d0 = new FinalDimensions( 512l, 512l, 86l );
final VoxelDimensions vd0 = new FinalVoxelDimensions( "px", 0.4566360, 0.4566360, 2.0000000 );
setups.add( new ViewSetup( 0, "setup 0", d0, vd0, c0, a0, i0 ) );
setups.add( new ViewSetup( 1, "setup 1", d0, vd0, c0, a1, i0 ) );
final ArrayList< TimePoint > t = new ArrayList< TimePoint >();
t.add( new TimePoint( 0 ) );
final TimePoints timepoints = new TimePoints( t );
final ArrayList< ViewId > missing = new ArrayList< ViewId >();
final MissingViews missingViews = new MissingViews( missing );
final ImgLoader imgLoader = new ImgLoader()
{
@Override
public SetupImgLoader< ? > getSetupImgLoader( int setupId )
{
return new MySetupImgLoader( setupId );
}
};
for ( final ViewSetup vs : setups )
{
final ViewRegistration vr = new ViewRegistration( t.get( 0 ).getId(), vs.getId() );
final double minResolution = Math.min( Math.min( vs.getVoxelSize().dimension( 0 ), vs.getVoxelSize().dimension( 1 ) ), vs.getVoxelSize().dimension( 2 ) );
final double calX = vs.getVoxelSize().dimension( 0 ) / minResolution;
final double calY = vs.getVoxelSize().dimension( 1 ) / minResolution;
final double calZ = vs.getVoxelSize().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 );
vr.preconcatenateTransform( vt );
vr.updateModel();
registrations.add( vr );
}
final SequenceDescription sd = new SequenceDescription( timepoints, setups, imgLoader, missingViews );
final SpimData data = new SpimData( new File( "" ), sd, new ViewRegistrations( registrations ) );
return data;
}
示例5: applyToData
import mpicbg.spim.data.registration.ViewRegistration; //导入方法依赖的package包/类
public static void applyToData(Map<ViewId, Translation3D> locations, boolean pixelUnits, boolean keepRotation,
AbstractSpimData< ? > data)
{
if (data == null)
return;
final Map< ViewId, Translation3D > transformsForData = getTransformsForData( locations, pixelUnits, data );
final Collection< BasicViewDescription< ? > > vds = (Collection< BasicViewDescription< ? > >) data.getSequenceDescription().getViewDescriptions().values();
for ( BasicViewDescription< ? > vd : vds )
{
if (!vd.isPresent())
continue;
if (!transformsForData.containsKey( vd ))
continue;
final ViewRegistration vr = data.getViewRegistrations().getViewRegistration( vd );
final ViewTransform vtCalib = vr.getTransformList().get( vr.getTransformList().size() - 1 );
final AffineTransform3D calib = new AffineTransform3D();
calib.set( vr.getTransformList().get( vr.getTransformList().size() - 1 ).asAffine3D().getRowPackedCopy() );
vr.getTransformList().clear();
vr.preconcatenateTransform( vtCalib );
final AffineTransform3D tr = new AffineTransform3D();
tr.set( transformsForData.get( vd ).getRowPackedCopy() );
ViewTransformAffine vtTC = new ViewTransformAffine( "Translation from Tile Configuration", tr );
vr.preconcatenateTransform( vtTC );
if (keepRotation)
{
AffineTransform3D rotation = new AffineTransform3D();
Pair< Double, Integer > rotAngleAndAxis = RegularTranformHelpers.getRoatationFromMetadata( vd.getViewSetup().getAttribute( Angle.class ) );
if (rotAngleAndAxis != null)
{
rotation.rotate( rotAngleAndAxis.getB(), rotAngleAndAxis.getA() );
vr.preconcatenateTransform( new ViewTransformAffine( "Rotation from Metadata", rotation.copy() ));
}
}
vr.updateModel();
}
}
示例6: actionPerformed
import mpicbg.spim.data.registration.ViewRegistration; //导入方法依赖的package包/类
private void actionPerformed( final ActionEvent e )
{
if ( panel == null )
{
IOFunctions.println( "Panel not set for " + this.getClass().getSimpleName() );
return;
}
final List< ViewId > viewIds = panel.selectedRowsViewId();
final ViewRegistrations vr = panel.getSpimData().getViewRegistrations();
ViewerState state = ViewSetupExplorerPanel.bdvPopup().bdv.getViewer().getState();
for ( SourceState< ? > s : state.getSources() )
{
if ( s.getSpimSource() instanceof TransformedSource )
{
TransformedSource< ? > transformedSource = ( TransformedSource< ? > ) s.getSpimSource();
if ( transformedSource.getWrappedSource() instanceof AbstractSpimSource )
{
int setupId = ( ( AbstractSpimSource< ? > ) transformedSource.getWrappedSource() ).getSetupId();
AffineTransform3D manual = new AffineTransform3D();
transformedSource.getFixedTransform( manual );
for ( final ViewId viewId : viewIds )
{
if ( viewId.getViewSetupId() == setupId )
{
final ViewRegistration v = vr.getViewRegistrations().get( viewId );
final ViewTransform vt = new ViewTransformAffine( "baked bdv manual transform", manual );
v.preconcatenateTransform( vt );
// v.updateModel();
}
}
}
transformedSource.setFixedTransform( new AffineTransform3D() );
}
}
panel.updateContent();
ViewSetupExplorerPanel.bdvPopup().updateBDV();
}