本文整理汇总了Java中bdv.viewer.ViewerOptions类的典型用法代码示例。如果您正苦于以下问题:Java ViewerOptions类的具体用法?Java ViewerOptions怎么用?Java ViewerOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ViewerOptions类属于bdv.viewer包,在下文中一共展示了ViewerOptions类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: main
import bdv.viewer.ViewerOptions; //导入依赖的package包/类
public static void main( String[] args )
{
new ImageJ();
SpimData spimData = twoAngles();
// crashes for version 2.0.0
// with version 2.2.0-SNAPSHOT it crashes when calling the brightness dialog, silently
// doesn't rotate afterwards
BigDataViewer.open( spimData, "Test 32bit", null, new ViewerOptions() );
}
开发者ID:PreibischLab,项目名称:BigStitcher,代码行数:11,代码来源:MinimalTest.java
示例2: BigWarpViewerFrame
import bdv.viewer.ViewerOptions; //导入依赖的package包/类
public BigWarpViewerFrame(
BigWarp bw,
final int width, final int height,
final List< SourceAndConverter< ? > > sources,
final BigWarpViewerSettings viewerSettings,
final CacheControl cache,
final String title,
final boolean isMoving,
final int[] movingIndexList,
final int[] targetIndexList )
{
this( bw, width, height, sources, viewerSettings, cache, ViewerOptions.options(), title, isMoving, movingIndexList, targetIndexList );
}
开发者ID:saalfeldlab,项目名称:bigwarp,代码行数:14,代码来源:BigWarpViewerFrame.java
示例3: installKeyboardActions
import bdv.viewer.ViewerOptions; //导入依赖的package包/类
protected void installKeyboardActions( final JComponent graphComponent )
{
final InputTriggerConfig inputTriggerConfig = BigDataViewer.getInputTriggerConfig( ViewerOptions.options() );
NavigationActions.installActionBindings( viewer.getKeybindings(), viewer.getViewerPanel(), inputTriggerConfig );
final InputMap inputMap = readPropertyFile();
final ActionMap actionMap = createActionMap();
viewer.getKeybindings().addActionMap( "mamut", actionMap );
viewer.getKeybindings().addInputMap( "mamut", inputMap );
}
开发者ID:fiji,项目名称:MaMuT,代码行数:12,代码来源:MamutKeyboardHandler.java
示例4: create
import bdv.viewer.ViewerOptions; //导入依赖的package包/类
@Override
public TrackMateModelView create( final Model model, final Settings settings, final SelectionModel selectionModel )
{
final SourceSettings ss = ( SourceSettings ) settings;
final List< SourceAndConverter< ? >> sources = ss.getSources();
final int numTimePoints = ss.nframes;
final CacheControl cache = ss.getCacheControl();
final Bookmarks bookmarks = new Bookmarks();
// Test if we have 2D images.
boolean is2D = true;
for ( final SourceAndConverter< ? > sac : sources )
{
final Source< ? > source = sac.getSpimSource();
for ( int t = 0; t < numTimePoints; t++ )
{
if ( source.isPresent( t ) )
{
final RandomAccessibleInterval< ? > level = source.getSource( t, 0 );
if ( level.dimension( 2 ) > 1 )
is2D = false;
break;
}
}
}
final ViewerOptions options = ViewerOptions.options();
if ( is2D )
options.transformEventHandlerFactory( BehaviourTransformEventHandlerPlanar.factory() );
return new MamutViewer( DEFAULT_WIDTH, DEFAULT_HEIGHT,
sources, numTimePoints, cache,
model, selectionModel,
options,
bookmarks );
}
开发者ID:fiji,项目名称:MaMuT,代码行数:37,代码来源:MamutViewerFactory.java
示例5: ViewSetupExplorerPanel
import bdv.viewer.ViewerOptions; //导入依赖的package包/类
public ViewSetupExplorerPanel( final ViewSetupExplorer< AS, X > explorer, final AS data, final String xml, final X io )
{
this.explorer = explorer;
this.listeners = new ArrayList< SelectedViewDescriptionListener< AS > >();
this.data = data;
this.xml = xml.replace( "\\", "/" ).replace( "//", "/" ).replace( "/./", "/" );
this.io = io;
this.isMac = System.getProperty( "os.name" ).toLowerCase().contains( "mac" );
this.selectedRows = new HashSet< BasicViewDescription< ? extends BasicViewSetup > >();
this.firstSelectedVD = null;
initComponent();
if ( Hdf5ImageLoader.class.isInstance( data.getSequenceDescription().getImgLoader() ) )
{
final BDVPopup bdvpopup = bdvPopup();
if ( bdvpopup != null )
{
bdvpopup.bdv = BigDataViewer.open( getSpimData(), xml(), IOFunctions.getProgressWriter(), ViewerOptions.options() );
// if ( !bdv.tryLoadSettings( panel.xml() ) ) TODO: this should work, but currently tryLoadSettings is protected. fix that.
InitializeViewerState.initBrightness( 0.001, 0.999, bdvpopup.bdv.getViewer(), bdvpopup.bdv.getSetupAssignments() );
// do not rotate BDV view by default
BDVPopup.initTransform( bdvpopup.bdv.getViewer() );
setFusedModeSimple( bdvpopup.bdv, data );
}
}
}
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:32,代码来源:ViewSetupExplorerPanel.java
示例6: createBDV
import bdv.viewer.ViewerOptions; //导入依赖的package包/类
public static BigDataViewer createBDV( final ExplorerWindow< ? , ? > panel , LinkOverlay lo)
{
if ( AbstractImgLoader.class.isInstance( panel.getSpimData().getSequenceDescription().getImgLoader() ) )
{
if ( JOptionPane.showConfirmDialog( null,
"Opening <SpimData> dataset that is not suited for interactive browsing.\n" +
"Consider resaving as HDF5 for better performance.\n" +
"Proceed anyways?",
"Warning",
JOptionPane.YES_NO_OPTION ) == JOptionPane.NO_OPTION )
return null;
}
boolean allViews2D = true;
@SuppressWarnings("unchecked")
final Collection< BasicViewDescription< ? > > viewDescriptions =
(Collection< BasicViewDescription< ? > >) panel.getSpimData().getSequenceDescription().getViewDescriptions().values();
for (final BasicViewDescription< ? > vd : viewDescriptions)
if (vd.isPresent() && vd.getViewSetup().hasSize() && vd.getViewSetup().getSize().dimension( 2 ) != 1)
{
allViews2D = false;
break;
}
final ViewerOptions options = ViewerOptions.options().accumulateProjectorFactory( MaximumProjectorARGB.factory );
if (allViews2D)
{
options.transformEventHandlerFactory(new BehaviourTransformEventHandlerPlanarFactory() );
}
BigDataViewer bdv = BigDataViewer.open( panel.getSpimData(),
"BigDataViewer",
null,
options );
BDVPopup.initTransform( bdv.getViewer() );
// if ( !bdv.tryLoadSettings( panel.xml() ) ) TODO: this should
// work, but currently tryLoadSettings is protected. fix that.
BDVPopup.initBrightness( 0.001, 0.999, bdv.getViewer().getState(), bdv.getSetupAssignments() );
FilteredAndGroupedExplorerPanel.setFusedModeSimple( bdv, panel.getSpimData() );
minMaxGroupByChannels( bdv, panel.getSpimData() );
colorByChannels( bdv, panel.getSpimData(), 0 );
Set<Class<? extends Entity>> groupingFactors = new HashSet<>();
groupingFactors.add( Channel.class );
groupingFactors.add( Illumination.class );
groupSourcesByFactors( bdv, panel.getSpimData(), groupingFactors );
FilteredAndGroupedExplorerPanel.updateBDV( bdv, panel.colorMode(), panel.getSpimData(), panel.firstSelectedVD(), ((GroupedRowWindow)panel).selectedRowsGroups());
bdv.getViewer().addTransformListener( lo );
bdv.getViewer().getDisplay().addOverlayRenderer( lo );
bdv.getViewerFrame().setVisible( true );
bdv.getViewer().requestRepaint();
return bdv;
}
开发者ID:PreibischLab,项目名称:BigStitcher,代码行数:62,代码来源:BDVPopupStitching.java
示例7: MamutViewerPanel
import bdv.viewer.ViewerOptions; //导入依赖的package包/类
public MamutViewerPanel( final List< SourceAndConverter< ? >> sources, final int numTimePoints, final CacheControl cache )
{
this( sources, numTimePoints, cache, ViewerOptions.options() );
}
开发者ID:fiji,项目名称:MaMuT,代码行数:5,代码来源:MamutViewerPanel.java
示例8: MamutViewer
import bdv.viewer.ViewerOptions; //导入依赖的package包/类
/**
*
* @param width
* width of the display window.
* @param height
* height of the display window.
* @param sources
* the {@link SourceAndConverter sources} to display.
* @param numTimePoints
* number of available timepoints.
* @param cache
* handle to cache. This is used to control io timing. Also, is
* is used to subscribe / unsubscribe to the cache as a consumer,
* so that eventually the io fetcher threads can be shut down.
* @param model
* the model to show in this view.
* @param selectionModel
* the selection model used to deal with selection.
* @param optional
* optional parameters. See
* {@link bdv.viewer.ViewerPanel#getOptionValues()}.
*/
public MamutViewer( final int width, final int height, final List< SourceAndConverter< ? > > sources, final int numTimePoints, final CacheControl cache,
final Model model, final SelectionModel selectionModel,
final ViewerOptions optional,
final Bookmarks bookmarks )
{
super( "MaMut Viewer", GuiUtil.getSuitableGraphicsConfiguration( GuiUtil.RGB_COLOR_MODEL ) );
final MessageOverlayAnimator msgOverlay = new MessageOverlayAnimator( DEFAULT_TEXT_DISPLAY_DURATION, DEFAULT_FADEINTIME, DEFAULT_FADEOUTTIME, DEFAULT_FONT );
viewerPanel = new MamutViewerPanel( sources, numTimePoints, cache, optional.width( width ).height( height ).msgOverlay( msgOverlay ) );
keybindings = new InputActionBindings();
this.model = model;
this.selectionModel = selectionModel;
this.logger = new MamutViewerLogger();
this.triggerbindings = new TriggerBehaviourBindings();
this.bookmarkEditor = new BookmarksEditor( viewerPanel, keybindings, bookmarks );
bookmarkEditor.setInputMapsToBlock( Arrays.asList( "all" ) );
getRootPane().setDoubleBuffered( true );
setPreferredSize( new Dimension( width, height ) );
add( viewerPanel, BorderLayout.CENTER );
pack();
setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE );
addWindowListener( new WindowAdapter()
{
@Override
public void windowClosing( final WindowEvent e )
{
viewerPanel.stop();
}
} );
SwingUtilities.replaceUIActionMap( getRootPane(), keybindings.getConcatenatedActionMap() );
SwingUtilities.replaceUIInputMap( getRootPane(), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, keybindings.getConcatenatedInputMap() );
final MouseAndKeyHandler mouseAndKeyHandler = new MouseAndKeyHandler();
mouseAndKeyHandler.setInputMap( triggerbindings.getConcatenatedInputTriggerMap() );
mouseAndKeyHandler.setBehaviourMap( triggerbindings.getConcatenatedBehaviourMap() );
viewerPanel.getDisplay().addHandler( mouseAndKeyHandler );
final TransformEventHandler< ? > tfHandler = viewerPanel.getDisplay().getTransformEventHandler();
if ( tfHandler instanceof BehaviourTransformEventHandler )
( ( BehaviourTransformEventHandler< ? > ) tfHandler ).install( triggerbindings );
this.visibilityAndGroupingDialog = new VisibilityAndGroupingDialog( this, viewerPanel.getVisibilityAndGrouping() );
this.recordMovieDialog = new MamutRecordMovieDialog( this, viewerPanel, new ProgressWriterLogger( logger ) );
recordMovieDialog.setLocationRelativeTo( this );
viewerPanel.getDisplay().addOverlayRenderer( recordMovieDialog );
this.recordMaxProjectionMovieDialog = new MamutRecordMaxProjectionDialog( this, this, new ProgressWriterLogger( logger ) );
recordMaxProjectionMovieDialog.setLocationRelativeTo( this );
viewerPanel.getDisplay().addOverlayRenderer( recordMaxProjectionMovieDialog );
setIconImage( MaMuT.MAMUT_ICON.getImage() );
setLocationByPlatform( true );
setVisible( true );
}
开发者ID:fiji,项目名称:MaMuT,代码行数:80,代码来源:MamutViewer.java
示例9: createBDV
import bdv.viewer.ViewerOptions; //导入依赖的package包/类
public static BigDataViewer createBDV( final ViewSetupExplorerPanel< ?, ? > panel )
{
BasicImgLoader il = panel.getSpimData().getSequenceDescription().getImgLoader();
if ( AbstractImgLoader.class.isInstance( il ) || StackImgLoader.class.isInstance( il ) )
{
if ( JOptionPane.showConfirmDialog( null,
"Opening <SpimData> dataset that is not suited for interactive browsing.\n" +
"Consider resaving as HDF5 for better performance.\n" +
"Proceed anyways?",
"Warning",
JOptionPane.YES_NO_OPTION ) == JOptionPane.NO_OPTION )
return null;
}
BigDataViewer bdv = BigDataViewer.open( panel.getSpimData(), panel.xml(), IOFunctions.getProgressWriter(), ViewerOptions.options() );
// if ( !bdv.tryLoadSettings( panel.xml() ) ) TODO: this should work, but currently tryLoadSettings is protected. fix that.
InitializeViewerState.initBrightness( 0.001, 0.999, bdv.getViewer(), bdv.getSetupAssignments() );
// do not rotate BDV view by default
BDVPopup.initTransform( bdv.getViewer() );
ViewSetupExplorerPanel.updateBDV( bdv, panel.colorMode(), panel.getSpimData(), panel.firstSelectedVD(), panel.selectedRows() );
// final ArrayList< InterestPointSource > interestPointSources = new ArrayList< InterestPointSource >();
// interestPointSources.add( new InterestPointSource()
// {
// private final ArrayList< RealPoint > points;
// {
// points = new ArrayList< RealPoint >();
// final Random rand = new Random();
// for ( int i = 0; i < 1000; ++i )
// points.add( new RealPoint( rand.nextDouble() * 1400, rand.nextDouble() * 800, rand.nextDouble() * 300 ) );
// }
//
// @Override
// public final Collection< ? extends RealLocalizable > getLocalCoordinates( final int timepointIndex )
// {
// return points;
// }
//
// @Override
// public void getLocalToGlobalTransform( final int timepointIndex, final AffineTransform3D transform )
// {
// transform.identity();
// }
// } );
// final InterestPointOverlay interestPointOverlay = new InterestPointOverlay( bdv.getViewer(), interestPointSources );
// bdv.getViewer().addRenderTransformListener( interestPointOverlay );
// bdv.getViewer().getDisplay().addOverlayRenderer( interestPointOverlay );
// bdv.getViewer().removeTransformListener( interestPointOverlay );
// bdv.getViewer().getDisplay().removeOverlayRenderer( interestPointOverlay );
return bdv;
}
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:55,代码来源:BDVPopup.java
示例10: getBDV
import bdv.viewer.ViewerOptions; //导入依赖的package包/类
public static Pair< BigDataViewer, Boolean > getBDV( final AbstractSpimData< ? > spimData, final Collection< ViewId > viewIdsToProcess )
{
final BDVPopup popup = ViewSetupExplorerPanel.bdvPopup();
BigDataViewer bdv;
boolean bdvIsLocal = false;
if ( popup == null || popup.panel == null )
{
// locally run instance
if ( AbstractImgLoader.class.isInstance( spimData.getSequenceDescription().getImgLoader() ) )
{
if ( JOptionPane.showConfirmDialog( null,
"Opening <SpimData> dataset that is not suited for interactive browsing.\n" +
"Consider resaving as HDF5 for better performance.\n" +
"Proceed anyways?",
"Warning",
JOptionPane.YES_NO_OPTION ) == JOptionPane.NO_OPTION )
return null;
}
bdv = BigDataViewer.open( spimData, "BigDataViewer", IOFunctions.getProgressWriter(), ViewerOptions.options() );
bdvIsLocal = true;
// if ( !bdv.tryLoadSettings( panel.xml() ) ) TODO: this should work, but currently tryLoadSettings is protected. fix that.
InitializeViewerState.initBrightness( 0.001, 0.999, bdv.getViewer(), bdv.getSetupAssignments() );
final List< BasicViewDescription< ? > > vds = new ArrayList< BasicViewDescription< ? > >();
for ( final ViewId viewId : viewIdsToProcess )
vds.add( spimData.getSequenceDescription().getViewDescriptions().get( viewId ) );
ViewSetupExplorerPanel.updateBDV( bdv, true, spimData, null, vds );
}
else if ( popup.bdv == null )
{
// if BDV was closed by the user
if ( popup.bdv != null && !popup.bdv.getViewerFrame().isVisible() )
popup.bdv = null;
try
{
bdv = popup.bdv = BDVPopup.createBDV( popup.panel );
}
catch (Exception e)
{
IOFunctions.println( "Could not run BigDataViewer: " + e );
e.printStackTrace();
bdv = popup.bdv = null;
}
}
else
{
bdv = popup.bdv;
}
return new ValuePair< BigDataViewer, Boolean >( bdv, bdvIsLocal );
}
开发者ID:fiji,项目名称:SPIM_Registration,代码行数:58,代码来源:BigDataViewerBoundingBox.java
注:本文中的bdv.viewer.ViewerOptions类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论