本文整理汇总了Java中mpicbg.spim.data.registration.ViewRegistration类的典型用法代码示例。如果您正苦于以下问题:Java ViewRegistration类的具体用法?Java ViewRegistration怎么用?Java ViewRegistration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ViewRegistration类属于mpicbg.spim.data.registration包,在下文中一共展示了ViewRegistration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getInitialTransforms
import mpicbg.spim.data.registration.ViewRegistration; //导入依赖的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 ] ));
}
示例2: FusionResult
import mpicbg.spim.data.registration.ViewRegistration; //导入依赖的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 );
}
示例3: 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 );
}
示例4: getValueAt
import mpicbg.spim.data.registration.ViewRegistration; //导入依赖的package包/类
@Override
public Object getValueAt( final int row, final int column )
{
if ( currentVD == null )
return column == 0 ? "No View Description selected" : "";
final ViewRegistration vr = viewRegistrations.getViewRegistration( currentVD );
if ( vr.getTransformList().isEmpty() )
{
return column == 0 ? "No transformations present" : "";
}
else
{
if ( column == 0 )
return vr.getTransformList().get( row ).getName();
else
return vr.getTransformList().get( row ).asAffine3D().getRowPackedCopy()[ column - 1 ];
}
}
示例5: numReorientated
import mpicbg.spim.data.registration.ViewRegistration; //导入依赖的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 );
}
示例6: exportImage
import mpicbg.spim.data.registration.ViewRegistration; //导入依赖的package包/类
@Override
public < T extends RealType< T > & NativeType< T > > boolean exportImage( final RandomAccessibleInterval<T> img, final BoundingBoxGUI bb, final TimePoint tp, final ViewSetup vs, final double min, final double max )
{
if ( appendToHdf5 != null )
return appendToHdf5.exportImage( img, bb, tp, vs, min, max );
// write the image
if ( !this.saver.exportImage( img, bb, tp, vs, min, max ) )
return false;
// update the registrations
final ViewRegistration vr = spimData.getViewRegistrations().getViewRegistration( new ViewId( tp.getId(), vs.getId() ) );
final double scale = bb.getDownSampling();
final AffineTransform3D m = new AffineTransform3D();
m.set( scale, 0.0f, 0.0f, bb.min( 0 ),
0.0f, scale, 0.0f, bb.min( 1 ),
0.0f, 0.0f, scale, bb.min( 2 ) );
final ViewTransform vt = new ViewTransformAffine( "fusion bounding box", m );
vr.getTransformList().clear();
vr.getTransformList().add( vt );
return true;
}
示例7: exportImage
import mpicbg.spim.data.registration.ViewRegistration; //导入依赖的package包/类
@Override
public < T extends RealType< T > & NativeType< T > > boolean exportImage( final RandomAccessibleInterval<T> img, final BoundingBoxGUI bb, final TimePoint tp, final ViewSetup vs, final double min, final double max )
{
// write the image
if ( !this.saver.exportImage( img, bb, tp, vs, min, max ) )
return false;
// update the registrations
final ViewRegistration vr = spimData.getViewRegistrations().getViewRegistration( new ViewId( tp.getId(), vs.getId() ) );
final double scale = bb.getDownSampling();
final AffineTransform3D m = new AffineTransform3D();
m.set( scale, 0.0f, 0.0f, bb.min( 0 ),
0.0f, scale, 0.0f, bb.min( 1 ),
0.0f, 0.0f, scale, bb.min( 2 ) );
final ViewTransform vt = new ViewTransformAffine( "fusion bounding box", m );
vr.getTransformList().clear();
vr.getTransformList().add( vt );
return true;
}
示例8: createViewRegistrations
import mpicbg.spim.data.registration.ViewRegistration; //导入依赖的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;
}
示例9: nonTranslationsEqual
import mpicbg.spim.data.registration.ViewRegistration; //导入依赖的package包/类
public static boolean nonTranslationsEqual(final ViewRegistration vr1, final ViewRegistration vr2)
{
final int n = vr1.getModel().numDimensions();
final AffineTransform3D dsTransform = new AffineTransform3D();
final Pair< AffineGet, TranslationGet > initialTransforms1 = getInitialTransforms( vr1, n == 2, dsTransform );
final Pair< AffineGet, TranslationGet > initialTransforms2 = getInitialTransforms( vr2, n == 2, dsTransform );
return allAlmostEqual( initialTransforms1.getA().getRowPackedCopy(), initialTransforms2.getA().getRowPackedCopy(), 0.01 );
}
示例10: getAccumulativeTransformForRawDataTransform
import mpicbg.spim.data.registration.ViewRegistration; //导入依赖的package包/类
public static AffineTransform3D getAccumulativeTransformForRawDataTransform(ViewRegistration viewRegistration,
AffineGet rawTransform)
{
final AffineTransform3D vrModel = viewRegistration.getModel();
final AffineTransform3D result = vrModel.inverse().copy();
result.preConcatenate( rawTransform ).preConcatenate( vrModel );
return result;
}
示例11: 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 );
}
示例12: assembleRegistrationNames
import mpicbg.spim.data.registration.ViewRegistration; //导入依赖的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;
}
示例13: 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 );
}
示例14: getLocalToGlobalTransform
import mpicbg.spim.data.registration.ViewRegistration; //导入依赖的package包/类
@Override
public void getLocalToGlobalTransform( final int timepointIndex, final AffineTransform3D transform )
{
if ( currentVD != null )
{
final ViewRegistration vr = panel.viewSetupExplorer.getSpimData().getViewRegistrations().getViewRegistration( currentVD );
vr.updateModel();
transform.set( vr.getModel() );
}
}
示例15: actionPerformed
import mpicbg.spim.data.registration.ViewRegistration; //导入依赖的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();
}