本文整理汇总了Java中mpicbg.spim.data.registration.ViewRegistration类的典型用法代码示例。如果您正苦于以下问题:Java ViewRegistration类的具体用法?Java ViewRegistration怎么用?Java ViewRegistration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ViewRegistration类属于mpicbg.spim.data.registration包,在下文中一共展示了ViewRegistration类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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 ] ));
}
开发者ID:PreibischLab,项目名称:BigStitcher,代码行数:31,代码来源:TransformTools.java
示例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 );
}
开发者ID:bigdataviewer,项目名称:bigdataviewer_fiji,代码行数:25,代码来源:FusionResult.java
示例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 );
}
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:23,代码来源:Apply_Transformation.java
示例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 ];
}
}
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:21,代码来源:RegistrationTableModel.java
示例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 );
}
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:26,代码来源:AutomaticReorientation.java
示例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;
}
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:26,代码来源:AppendSpimData2.java
示例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;
}
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:23,代码来源:ExportSpimData2TIFF.java
示例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;
}
开发者ID:bigdataviewer,项目名称:spimdata,代码行数:19,代码来源:SpimDataExample2.java
示例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 );
}
开发者ID:PreibischLab,项目名称:BigStitcher,代码行数:11,代码来源:TransformTools.java
示例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;
}
开发者ID:PreibischLab,项目名称:BigStitcher,代码行数:9,代码来源:OptimizeGloballyPopup.java
示例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 );
}
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:10,代码来源:Apply_Transformation.java
示例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;
}
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:29,代码来源:GUIHelper.java
示例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 );
}
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:35,代码来源:StackList.java
示例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() );
}
}
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:11,代码来源:InterestPointTableModel.java
示例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();
}
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:29,代码来源:RemoveTransformationPopup.java
示例16: copySelection
import mpicbg.spim.data.registration.ViewRegistration; //导入依赖的package包/类
protected void copySelection()
{
cache.clear();
if ( table.getSelectedRowCount() == 0 )
{
JOptionPane.showMessageDialog( table, "Nothing selected");
return;
}
else
{
final BasicViewDescription< ? > vd = tableModel.getCurrentViewDescription();
if ( vd == null )
{
JOptionPane.showMessageDialog( table, "No active viewdescription." );
return;
}
final ViewRegistration vr = tableModel.getViewRegistrations().getViewRegistration( vd );
for ( int row : table.getSelectedRows() )
{
cache.add( duplicate( vr.getTransformList().get( row ) ) );
System.out.println( "Copied row " + vr.getTransformList().get( row ).getName() );
}
}
}
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:29,代码来源:RegistrationExplorerPanel.java
示例17: delete
import mpicbg.spim.data.registration.ViewRegistration; //导入依赖的package包/类
protected void delete()
{
if ( table.getSelectedRowCount() == 0 )
{
JOptionPane.showMessageDialog( table, "Nothing selected." );
return;
}
final BasicViewDescription< ? > vd = tableModel.getCurrentViewDescription();
if ( vd == null )
{
JOptionPane.showMessageDialog( table, "No active viewdescription." );
return;
}
final int[] selectedRows = table.getSelectedRows();
Arrays.sort( selectedRows );
final ViewRegistration vr = tableModel.getViewRegistrations().getViewRegistration( vd );
for ( int i = selectedRows[ selectedRows.length - 1 ]; i >= selectedRows[ 0 ]; --i )
vr.getTransformList().remove( i );
if ( vr.getTransformList().isEmpty() )
vr.getTransformList().add( new ViewTransformAffine( null, new AffineTransform3D() ) );
vr.updateModel();
// update everything
tableModel.fireTableDataChanged();
}
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:33,代码来源:RegistrationExplorerPanel.java
示例18: cleanUp
import mpicbg.spim.data.registration.ViewRegistration; //导入依赖的package包/类
/**
* Called before the XML is potentially saved
*/
@Override
public boolean cleanUp()
{
if ( reorientate == 0 || reorientate == 1 )
{
// the spimdata registrations were changed
return true;
}
else if ( reorientate == 2 )
{
// remove the registrations we added
if ( viewIdsToApply == null )
{
IOFunctions.println( "Something went wrong, the viewIdsToApply list is null." );
}
else
{
for ( final ViewId viewId : viewIdsToApply )
{
final ViewDescription vd = spimData.getSequenceDescription().getViewDescription( viewId );
if ( !vd.isPresent() )
continue;
// get the registration
final ViewRegistration r = spimData.getViewRegistrations().getViewRegistration( viewId );
final List< ViewTransform > vtl = r.getTransformList();
vtl.remove( 0 );
r.updateModel();
}
}
}
return this.changedSpimDataObject;
}
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:39,代码来源:AutomaticReorientation.java
示例19: exportImage
import mpicbg.spim.data.registration.ViewRegistration; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public < T extends RealType< T > & NativeType< T > > boolean exportImage( RandomAccessibleInterval< T > img, BoundingBoxGUI bb, TimePoint tp, ViewSetup vs, double min, double max )
{
System.out.println( "exportImage2()" );
// write the image
final RandomAccessibleInterval< UnsignedShortType > ushortimg;
if ( ! UnsignedShortType.class.isInstance( Util.getTypeFromInterval( img ) ) )
ushortimg = convert( img, params );
else
ushortimg = ( RandomAccessibleInterval ) img;
final Partition partition = viewIdToPartition.get( new ViewId( tp.getId(), vs.getId() ) );
final ExportMipmapInfo mipmapInfo = perSetupExportMipmapInfo.get( vs.getId() );
final boolean writeMipmapInfo = true; // TODO: remember whether we already wrote it and write only once
final boolean deflate = params.getDeflate();
final ProgressWriter progressWriter = new SubTaskProgressWriter( this.progressWriter, 0.0, 1.0 ); // TODO
final int numThreads = Math.max( 1, Runtime.getRuntime().availableProcessors() - 2 );
WriteSequenceToHdf5.writeViewToHdf5PartitionFile( ushortimg, partition, tp.getId(), vs.getId(), mipmapInfo, writeMipmapInfo, deflate, null, null, numThreads, progressWriter );
// 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;
}
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:36,代码来源:ExportSpimData2HDF5.java
示例20: exportImage
import mpicbg.spim.data.registration.ViewRegistration; //导入依赖的package包/类
@SuppressWarnings( { "unchecked", "rawtypes" } )
@Override
public < T extends RealType< T > & NativeType< T > > boolean exportImage( RandomAccessibleInterval< T > img, BoundingBoxGUI bb, TimePoint tp, ViewSetup vs, double min, double max )
{
System.out.println( "exportImage2()" );
// write the image
final RandomAccessibleInterval< UnsignedShortType > ushortimg;
if ( ! UnsignedShortType.class.isInstance( Util.getTypeFromInterval( img ) ) )
ushortimg = ExportSpimData2HDF5.convert( img, params );
else
ushortimg = ( RandomAccessibleInterval ) img;
final Partition partition = viewIdToPartition.get( new ViewId( tp.getId(), vs.getId() ) );
final ExportMipmapInfo mipmapInfo = perSetupExportMipmapInfo.get( vs.getId() );
final boolean writeMipmapInfo = true; // TODO: remember whether we already wrote it and write only once
final boolean deflate = params.getDeflate();
final ProgressWriter progressWriter = new SubTaskProgressWriter( this.progressWriter, 0.0, 1.0 ); // TODO
final int numThreads = Math.max( 1, Runtime.getRuntime().availableProcessors() - 2 );
WriteSequenceToHdf5.writeViewToHdf5PartitionFile( ushortimg, partition, tp.getId(), vs.getId(), mipmapInfo, writeMipmapInfo, deflate, null, null, numThreads, progressWriter );
// 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;
}
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:37,代码来源:AppendSpimData2HDF5.java
注:本文中的mpicbg.spim.data.registration.ViewRegistration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论