Skip to content

Commit

Permalink
Merge branch 'bvvpg'
Browse files Browse the repository at this point in the history
  • Loading branch information
tischi committed Dec 17, 2024
2 parents 6d3864d + 02ca186 commit 781a924
Show file tree
Hide file tree
Showing 20 changed files with 1,372 additions and 11 deletions.
10 changes: 10 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,16 @@
<artifactId>3D_Viewer</artifactId>
<version>4.0.5</version>
</dependency>
<dependency>
<groupId>nl.uu.science.cellbiology</groupId>
<artifactId>bvv-playground</artifactId>
<version>0.3.3</version>
</dependency>
<dependency>
<groupId>com.formdev</groupId>
<artifactId>flatlaf-jide-oss</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>org.scijava</groupId>
<artifactId>j3dcore</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*-
* #%L
* Fiji viewer for MoBIE projects
* %%
* Copyright (C) 2018 - 2024 EMBL
* %%
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* #L%
*/
package org.embl.mobie.command.context;

import org.embl.mobie.MoBIE;
import org.embl.mobie.command.CommandConstants;

import org.scijava.Initializable;
import org.scijava.plugin.Parameter;
import org.scijava.plugin.Plugin;
import sc.fiji.bdvpg.scijava.command.BdvPlaygroundActionCommand;

@Plugin(type = BdvPlaygroundActionCommand.class, menuPath = CommandConstants.CONTEXT_MENU_ITEMS_ROOT + "Configure BigVolumeViewer Rendering")
public class ConfigureBVVRenderingCommand implements BdvPlaygroundActionCommand, Initializable
{
static { net.imagej.patcher.LegacyInjector.preinit(); }

@Parameter( label = "Render width" )
public int renderWidth = 600;

@Parameter( label = "Render height" )
public int renderHeight = 600;

@Parameter( label = "Dither window size",
choices = { "none (always render full resolution)", "2x2", "3x3", "4x4", "5x5", "6x6", "7x7", "8x8" } )
public String dithering = "3x3";

@Parameter( label = "Number of dither samples",
description = "Pixels are interpolated from this many nearest neighbors when dithering. This is not very expensive, it's fine to turn it up to 8.",
min="1",
max="8",
style="slider")
public int numDitherSamples = 3;

@Parameter( label = "GPU cache tile size" )
public int cacheBlockSize = 32;

@Parameter( label = "GPU cache size (in MB)",
description = "The size of the GPU cache texture will match this as close as possible with the given tile size." )
public int maxCacheSizeInMB = 500;

@Parameter( label = "Camera distance",
description = "Distance from camera to z=0 plane. In units of pixel width." )
public double dCam = 3000;

@Parameter( label = "Clip distance far",
description = "Visible depth from z=0 further away from the camera. In units of pixel width.")
public double dClipFar = 1000;

@Parameter( label = "Clip distance near",
description = "Visible depth from z=0 closer to the camera. In units of pixel width. MUST BE SMALLER THAN CAMERA DISTANCE!")
public double dClipNear = 1000;


@Override
public void run()
{
MoBIE.getInstance().getViewManager().getBvvMobie().updateBVVRenderSettings();
}
}
1 change: 1 addition & 0 deletions src/main/java/org/embl/mobie/lib/bdv/view/SliceViewer.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ private void installContextMenuAndKeyboardShortCuts( )
actions.add( SourceAndConverterService.getCommandName( ManualTransformationCommand.class ) );
actions.add( SourceAndConverterService.getCommandName( EnterTransformationCommand.class ) );
actions.add( SourceAndConverterService.getCommandName( FlipCommand.class ) );
actions.add( SourceAndConverterService.getCommandName( ConfigureBVVRenderingCommand.class ) );
actions.add( UNDO_SEGMENT_SELECTIONS );
actions.add( LOAD_ADDITIONAL_VIEWS );
actions.add( SAVE_CURRENT_SETTINGS_AS_VIEW );
Expand Down
Loading

0 comments on commit 781a924

Please sign in to comment.