Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge bigdataviewer-vistools into bigdataviewer-core #65

Merged
merged 2 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 2 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,6 @@
[![](https://github.com/bigdataviewer/bigdataviewer-vistools/actions/workflows/build-main.yml/badge.svg)](https://github.com/bigdataviewer/bigdataviewer-vistools/actions/workflows/build-main.yml)

# bigdataviewer-vistools
Helpers to use BigDataViewer as a quick visualization tool in other projects.
This is intented to replace/augment `ImageJFunction.show()` from [imglib2-ij](https://github.com/imglib/imglib2-ij).
nothing here

Please note, that this is still in early stages of development.
Documentation is sparse.
API will break frequently in the foreseeable future.
### This project has been merged into [bigdataviewer-core](https://github.com/bigdataviewer/bigdataviewer-core).

## Usage

```
Random random = new Random();
Img<ARGBType> img = ArrayImgs.argbs(100, 100, 100);
img.forEach(t -> t.set(random.nextInt()));
Bdv bdv = BdvFunctions.show(img, "img");
```
creates a random 3D ARGB img and shows it in a BDV window.

All `BdvFunctions` methods will return some instance of `Bdv` which can be used to close the BDV window:
```
bdv.close()
```
or add more stuff to the same window:
```
BdvFunctions.show(img2, "img2", Bdv.options().addTo(bdv));
```
Via `bdv.getBdvHandle()` you can get access to the BDV `ViewerPanel` and `SetupAssignments` allowing more fine-grained
manipulations of BDV state.

The concrete `Bdv` instance returned from `BdvFunctions.show(img, "img")` in the above example is `BdvStackSource<ARGBType>` and
has additional methods, e.g., `removeFromBdv()` which removes `img` from the BDV window.

To display a 2D image, display a 3D image as a stack of 2D slices over time etc:
```
BdvFunctions.show(img2, "img2", Bdv.options().is2D());
```
The `is2D()` option is per Viewer window, not per stack. If it is set, the BDV navigation mouse and keybindings are set up for 2D, etc...

More fine-grained control can be achieved with `axisOrder()` option:
```
BdvFunctions.show(img2, "img2", Bdv.options().is2D().axisOrder(XYT))
```
`AxisOrder` specifies how the stack dimensions are interpreted.
For BDV with 3D navigation, the follwoing are useful: `XYZ, XYZC, XYZT, XYZCT, XYZTC`.
For BDV with 2D navigation, the following are useful: `XY, XYC, XYT, XYCT, XYTC`.
You should interpret `C` and `T` losely. The effect is that `T` will be mapped to the time slider of the BDV,
while `C` is mapped to BDV sources.
(This also means that you should not have images with a large `C` dimension.)

There is/will be stuff to add annotation overlays. Currently `BdvFunctions.showPoints()` is available.

Here is an example screenshot where several 3D stacks, a set of boundary points, and 3D ellipsoids fitted to the boundary points were added to a BDV window. It also shows how the usual BDV dialogs can be used to adjust visibility / brightness / colors of tbe individual sources.
![screenshot](screenshot.png)
40 changes: 1 addition & 39 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,7 @@
<!-- NB: Deploy releases to the SciJava Maven repository. -->
<releaseProfiles>sign,deploy-to-scijava</releaseProfiles>

<bigdataviewer-core.version>10.4.15</bigdataviewer-core.version>
<imglib2.version>7.0.2</imglib2.version>
<imglib2-cache.version>1.0.0-beta-18</imglib2-cache.version>
<imglib2-realtransform.version>4.0.3</imglib2-realtransform.version>
<bigdataviewer-core.version>10.5.0</bigdataviewer-core.version>
</properties>

<repositories>
Expand All @@ -140,40 +137,5 @@
<groupId>sc.fiji</groupId>
<artifactId>bigdataviewer-core</artifactId>
</dependency>
<dependency>
<groupId>net.imglib2</groupId>
<artifactId>imglib2</artifactId>
</dependency>
<dependency>
<groupId>net.imglib2</groupId>
<artifactId>imglib2-cache</artifactId>
</dependency>
<dependency>
<groupId>net.imglib2</groupId>
<artifactId>imglib2-realtransform</artifactId>
</dependency>
<dependency>
<groupId>org.scijava</groupId>
<artifactId>ui-behaviour</artifactId>
</dependency>

<!-- test dependencies -->
<!-- JUnit -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<!-- JMH -->
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Binary file removed screenshot.png
Binary file not shown.
145 changes: 0 additions & 145 deletions src/main/java/bdv/util/AbstractSource.java

This file was deleted.

Loading
Loading