Skip to content

Commit 0963e38

Browse files
authored
Updates bigdataviewer-playground documentation and adds warpy documentation
1 parent b006680 commit 0963e38

File tree

48 files changed

+950
-292
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+950
-292
lines changed

_pages/plugins/bdv/playground-manual-registration.md renamed to _pages/plugins/bdv/playground/bdv-playground-manual-registration.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Manual Registration with BigDataViewer Playground
2+
title: Tuto - Manual Registration
33
artifact: sc.fiji:bigdataviewer-playground
44
nav-links: true
55
toc: true
@@ -12,20 +12,20 @@ toc: true
1212

1313
{% include notice icon="warning"
1414
content="There is a bug : do not show the cross overlay to follow this tutorial." %}
15-
Please follow [these instructions](/plugins/bdv/playground) to create a synchronized ortho bdv/bvv viewer. In short:
16-
* [Create a bdv ortho viewer with synchronized states](/plugins/bdv/playground#using-bigdataviewer-orthoviewer)
15+
Please follow [these instructions](/plugins/bdv/playground/bdv-playground-visualize) to create a synchronized ortho bdv/bvv viewer. In short:
16+
* [Create a bdv ortho viewer with synchronized states](/plugins/bdv/playground/bdv-playground-visualize#using-bigdataviewer-orthoviewer)
1717

1818
## OPTIONAL link a BVV Ortho viewer, possible only with 16 bits data
19-
* [Create a bvv ortho viewer with synchronized states](/plugins/bdv/playground#using-bigvolumerviewer-orthoviewer)
20-
* [Synchronize the front view of the bvv and bdv ortho viewer](/bdv/playground#synchronization-of-viewers-location)
19+
* [Create a bvv ortho viewer with synchronized states](/plugins/bdv/playground/bdv-playground-visualize#using-bigvolumerviewer-orthoviewer)
20+
* [Synchronize the front view of the bvv and bdv ortho viewer](/plugins/bdv/playground/bdv-playground-visualize#synchronization-of-viewers-location)
2121
* Synchronize the states between the front view of the bvv and bdv ortho viewer
2222

2323
You should get these two windows:
2424
{% include img name="bdv ortho viewer command" src="/media/plugins/bdv/playground/bdvpg-sync-states-views.png" %}
2525

2626
# Open the xml bdv dataset
2727

28-
Proceed as [explained here](/plugins/bdv/playground#open-a-bigdataviewer-xml-dataset).
28+
Proceed as [explained here](/plugins/bdv/playground/bdv-playground-open-dataset).
2929

3030
If you need to register multiple images between them, you can add them in one viewer with a right-click in the tree view or
3131
* with {% include bc path="Plugins|BigDataViewer-Playground|BDV|BDV - Show Sources"%} for bdv
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
---
2+
title: 1 - Create/open
3+
artifact: sc.fiji:bigdataviewer-playground
4+
nav-links: true
5+
toc: true
6+
---
7+
8+
Several options are available. Note that there's a difference between opening and visualising an image. Images opened in bigdataviewer-playground are not visualized directly, but are sorted into a hierarchical tree displayed into an extra window. From this tree, images can be displayed using the right click contextual menu (see next section).
9+
10+
## Open a XML BDV Dataset
11+
12+
A BigDataViewer dataset is an xml file which links to raw data and which contains additional metadata (positions, voxel size, channel descriptions etc.). These datasets can be generated by other BigDataViewer plugins such as BigStitcher, and bigdataviewer playground also provides a way to generate an xml bdv dataset.
13+
14+
Such datasets can be opened in bigdataviewer playground either via the command:
15+
16+
`Plugins › BigDataViewer-Playground › BDVDataset › Open XML BDV Datasets`
17+
18+
(type *open xml bdv* into the search bar) or can be directly dragged and dropped into the bigdataviewer playground window (this window can be made visible with `Plugins › BigDataViewer-Playground › Show Bdv Playground Window`).
19+
20+
An xml bdv dataset contains the information used to load the images ([the backend](https://youtu.be/LHI7vXiUUms?t=521)). The most used backend for bigdataviewer is the [XML/HDF5](/plugins/bdv/#exporting-datasets-for-the-bigdataviewer) backend, but others exist ([N5](https://github.com/bigdataviewer/bigdataviewer-core/blob/master/src/main/java/bdv/img/n5/XmlIoN5ImageLoader.java), Tiff, [Remote](https://github.com/bigdataviewer/bigdataviewer-core/blob/master/src/main/java/bdv/img/remote/XmlIoRemoteImageLoader.java), [Imaris](https://github.com/bigdataviewer/bigdataviewer-core/blob/master/src/main/java/bdv/img/imaris/XmlIoImarisImageLoader.java)...). BigDataViewer Playground actually adds several backends which can facilitates the definitation of bio-formats, omero images, and QuPath projects into a bdv xml dataset.
21+
22+
## Open a set of Bio-Formats supported files as a BDV Dataset
23+
24+
Files (multi-series, multi-resolution) can be opened via the plugin:
25+
26+
`Plugins › BigDataViewer-Playground › BDVDataset › Open [BioFormats Bdv Bridge (Basic) (Legacy)]`
27+
28+
(to avoid going through all the hierarchy of Fiji's menu, you can directly type *bridge* into Fiji's search bar)
29+
30+
Many files can be included in a single dataset.
31+
32+
{% include img name="open with bioformats bdv bridge" src="/media/plugins/bdv/playground/bdvpg-bioformats-bridge-basic-open.png" %}
33+
34+
Note that this WSI dataset demo-ed in this documentation is [accessible from Zenodo](https://zenodo.org/record/6553641#.YuD7ioRBxD8).
35+
36+
## Open a QuPath project as a BDV Dataset
37+
38+
As long as the QuPath project uses Bio-Formats image server, the project can be translated into a BigDataViewer dataset and be opened directly with the plugin:
39+
40+
`Plugins › BigDataViewer-Playground › BDVDataset › Open [QuPath Project (legacy)]`
41+
42+
## Open images from a BigDataServer as a BDV Dataset
43+
44+
You can use:
45+
46+
`Plugins › BigDataViewer-Playground › BDVDataset › BDVDataset [BigDataServer]`
47+
48+
## Open an Imaris file as a BDV Dataset
49+
50+
You can use:
51+
52+
`Plugins › BigDataViewer-Playground › BDVDataset › Open [Imaris]`
53+
54+
## Open OMERO images as a BDV Dataset
55+
56+
Coming soon ...
57+
58+
## Import the current ImageJ image as a BDV Dataset
59+
60+
Similar to the command ` Plugins>BigDataViewer>Open Current Image`, it is possible to import the current ImageJ image as an image in the bigdataviewer playground hierarchical tree via the command:
61+
62+
`Plugins › BigDataViewer-Playground › Sources › Import › Make BDVDataset from current IJ1 image`
63+
64+
It is possible to save it as an XML BDV dataset as well.
65+
66+
## Save a BDV Dataset as an XML BDV Dataset
67+
68+
Any dataset created using the functions above can be saved as an XML BDV Dataset. No image data will be written, but a XML File containing the dataset information can be written and re-used as explained in the next paragraph.
69+
70+
To save a BDV Dataset, first you need to open it, using one of the options above. Then you can save it (or resave it) via:
71+
72+
`Plugins › BigDataViewer-Playground › BDVDataset › Save BDVDataset`
73+
74+
Specify the sources to save and a xml file path. If the sources you selected belong to a BDV dataset, this command will be able to save it.
75+
76+
77+
78+
79+
80+
81+
82+
83+
84+
85+
86+
87+
Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
---
2+
title: 3 - Script
3+
artifact: sc.fiji:bigdataviewer-playground
4+
nav-links: true
5+
toc: true
6+
---
7+
8+
9+
By using the SciJava framework to store BigDataViewer windows through its `BdvHandle` interface, it is possible to communicate bdv instances between scripts and commands (see [script parameter page](/scripting/parameters)). This also facilitates the use of Fiji GUI because the commands of this repository can be chained easily. Any script or Command which declares a `BdvHandle` parameter can retrieve or provide reference to existing BigDataViewer instances.
10+
11+
In practice, Bdv windows created via the commands from this update site are put by default in the `ObjectService`. To get a reference to these windows:
12+
13+
- In groovy, add this at the beginning of your script
14+
15+
```java
16+
#@BdvHandle bdvh
17+
```
18+
19+
```java
20+
@Parameter
21+
BdvHandle bdvh;
22+
```
23+
24+
## How to make your BigDataViewer workflow compatible with SciJava ?
25+
26+
Two options:
27+
28+
- Use any command from bigdataviewer-playground which generates a BDV window. It corresponding `BdvHandle` will be registered and can be retrieved through a SciJava parameter annotation. This will make your Bdv Window accessible to other plugins / commands.
29+
30+
- Create your own Bdv window, but declare the associated `BdvHandle` as an output of your Command:
31+
- in Java: `@Parameter(type = ItemIO.OUTPUT); BdvHandle bdvh_out;`
32+
33+
The type of the parameter annotation can also be `ItemIO.BOTH` if your command is modifying an existing `BdvHandle`
34+
35+
### Example scripts
36+
37+
#### Groovy
38+
39+
- Display a recursive Fiji image:
40+
41+
```java
42+
// Input : provided by Single Input Preprocessor in case no widow is present
43+
#@BdvHandle bdv_h
44+
// Output : allow to updates list of sources
45+
#@output BdvHandle bdv_h
46+
#@output SourceAndConverter source
47+
48+
// Simple Fiji Image stored as an array
49+
fijiData =
50+
[[0,0,0,0,0,0,0,0,0],
51+
[0,1,1,1,1,1,1,1,0],
52+
[0,1,0,0,0,0,0,0,0],
53+
[0,1,0,1,0,1,0,1,0],
54+
[0,1,0,1,0,1,0,1,0],
55+
[0,1,0,1,0,1,0,1,0],
56+
[0,1,0,0,0,1,0,0,0],
57+
[0,1,0,1,1,1,0,0,0],
58+
[0,0,0,0,0,0,0,0,0]] as short[][];
59+
60+
// Declare a procedural image
61+
def s = new Procedural3DImageShort({p -> getRecursiveFiji(p[1], p[0], p[2])}).getRRA();
62+
63+
// Interval (mainly useless here, but required by BdvFunctions
64+
Interval interval = new FinalInterval([ 0, 0, 0] as long[], [ 9, 9, 0 ] as long[]);
65+
66+
// Display the source in the bdv_h window
67+
bss = BdvFunctions.show( s , interval, "Fiji", BdvOptions.options().addTo(bdv_h) );
68+
69+
// Display options
70+
bss.setDisplayRange(0,1);
71+
bss.setColor(new ARGBType(ARGBType.rgba(101,164,227,255)));
72+
73+
source = bss.getSources().get(0) // to register the created source
74+
75+
76+
//------------- FUNCTION for recursive Fiji Image generation
77+
78+
int getRecursiveFiji(double x, double y, double level) {
79+
def valueLevel = (int) (fijiData[((int)x%9)][((int)y%9)])
80+
if (level<=0) {
81+
return valueLevel
82+
} else {
83+
if (valueLevel==1) {
84+
if (level>2) {
85+
level=2;
86+
}
87+
return getRecursiveFiji(x*9,y*9,level-1)
88+
} else {
89+
return 0
90+
}
91+
}
92+
}
93+
94+
import bdv.util.Procedural3DImageShort
95+
import net.imglib2.RealRandomAccessible
96+
import bdv.util.BdvFunctions
97+
import bdv.util.BdvOptions
98+
import bdv.util.BdvHandle
99+
import net.imglib2.type.numeric.integer.UnsignedShortType
100+
import net.imglib2.FinalInterval
101+
import net.imglib2.Interval
102+
import net.imglib2.type.numeric.ARGBType
103+
104+
```
105+
106+
#### ImageJ Macro Language
107+
108+
TODO
109+
110+
## List of all commands
111+
112+
The list of commands of this repository is available in the git repository : https://github.com/bigdataviewer/bigdataviewer-playground

_pages/plugins/bdv/playground.md renamed to _pages/plugins/bdv/playground/bdv-playground-visualize.md

Lines changed: 4 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,10 @@
11
---
2-
title: BigDataViewer Playground
2+
title: 2 - Display
33
artifact: sc.fiji:bigdataviewer-playground
44
nav-links: true
55
toc: true
66
---
77

8-
As announced in the forum [here](https://forum.image.sc/t/getting-bigdataviewer-instance-in-an-imagej-command/21110/8) and [here](https://forum.image.sc/t/fiji-commands-for-bigdataviewer/25601), bigdataviewer playground aims at a better integration of BigDataViewer into Fiji by using the [SciJava Framework](/libs/scijava).
9-
10-
# Installation
11-
12-
Enable the [PTBIOP update site](/update-sites/following). The [BIOP](https://www.epfl.ch/research/facilities/ptbiop/) is maintaining this library.
13-
14-
# What bigdataviewer-playground brings ?
15-
- **Modularity for bigdataviewer!** Bigdataviewer playground creates a way to access existing BDV instances when scripting or writing java code. Being able to combine scripts or code for display and processing is doable easily via scripting (Groovy, ImageJ macro, etc.)
16-
- **Provide a set of macro recordable commands for bigdataviewer**. Makes it possible to script basic actions on BigDataViewer with the ImageJ macro recorder.
17-
- **Direct and lazy opening of multiresolution files, supported by bioformats**. It is possible to open and visualize large files in bigdataviewer without resaving files. This is particularly convenient for large 2D images (à la QuPath).
18-
19-
# Opening images in bigdataviewer-playground
20-
21-
Several options are available. Note that there's a difference between opening and visualising an image. Images opened in bigdataviewer-playground are not visualized directly, but are sorted into a hierarchical tree displayed into an extra window. From this tree, images can be displayed using the right click contextual menu (see next section).
22-
23-
### Open any bioformats supported files (tiff, vsi, czi, lif...)
24-
25-
Files (which can even be multi series) can be opened via the command **[Plugins>BigDataViewer>Playground>BDVDataset>Open [BioFormats Bdv Bridge (Basic)]**.
26-
Many files can be opened at the same time. To avoid going through all the hierarchy of Fiji's menu, you can directly type *bridge* into Fiji's search bar and click run.
27-
28-
{% include img name="open with bioformats bdv bridge" src="/media/plugins/bdv/playground/bdvpg-bioformats-bridge-basic-open.png" %}
29-
30-
Note that this WSI dataset demo-ed in this documentation is [accessible from Zenodo](https://zenodo.org/record/6553641#.YuD7ioRBxD8).
31-
32-
### Open a Bigdataviewer xml Dataset
33-
34-
A BigDataViewer dataset is an xml file which links to raw data and which contains additional metadata (positions, voxel size, channel descriptions etc.). These datasets can be generated by other BigDataViewer plugins such as BigStitcher, and bigdataviewer playground also provides a way to generate an xml bdv dataset.
35-
36-
Such datasets can be opened in bigdataviewer playground either via the command **[Plugins>BigDataViewer>Playground>BDVDataset>Open XML BDV Datasets]** (type *open xml bdv* into the search bar) or can be directly dragged and dropped into the bigdataviewer playground window (this window can be made visible with **[Plugins>BigDataViewer>Playground>Show Bdv Playground Window]**).
37-
38-
An xml bdv dataset contains the information used to load the images ([the backend](https://youtu.be/LHI7vXiUUms?t=521)). The most used backend for bigdataviewer is the [XML/HDF5](/plugins/bdv/#exporting-datasets-for-the-bigdataviewer) backend, but others exist ([N5](https://github.com/bigdataviewer/bigdataviewer-core/blob/master/src/main/java/bdv/img/n5/XmlIoN5ImageLoader.java), Tiff, [Remote](https://github.com/bigdataviewer/bigdataviewer-core/blob/master/src/main/java/bdv/img/remote/XmlIoRemoteImageLoader.java), [Imaris](https://github.com/bigdataviewer/bigdataviewer-core/blob/master/src/main/java/bdv/img/imaris/XmlIoImarisImageLoader.java)...). BigDataViewer Playground actually adds several backends which can facilitates the definitation of bio-formats, omero images, and QuPath projects into a bdv xml dataset.
39-
40-
### Import the current ImageJ image
41-
42-
Similar to the command **[Plugins>BigDataViewer>Open Current Image]**, it is possible to import the current ImageJ image as an image in the bigdataviewer playground hierarchical tree via the command **[Plugins>BigDataViewer>Sources>Import>Get Sources From ImagePlus]**
43-
448
# Visualizing images in bigdataviewer-playground
459

4610
## Standard view : with the spatial context from the dataset metadata
@@ -73,7 +37,7 @@ To navigate within BigDataViewer, please [look here for the commands](/plugins/b
7337
{% include notice content="If you are lost and the image do not seem to appear back, just right-click again the sources in the tree view, and select `BDV - Show Sources`, check `adjust view on source`, and BDV will go back to a decent viewer location. You can also close the window and reopen one from the tree view." %}
7438

7539
{% include notice icon="tip"
76-
content="You can open many viewers different viewers (for different channels, images, etc.), and even [synchronize them](/plugins/bdv/playground#working-with-multiple-viewers)." %}
40+
content="You can open many viewers different viewers (for different channels, images, etc.), and even [synchronize them](bdv-playground-visualize#working-with-multiple-viewers)." %}
7741

7842
## How to select a subset of images using the tree view and display them with the Grid view
7943

@@ -158,7 +122,7 @@ You need to explicitely set the number of timepoints. You can modify this a post
158122

159123
## I want a Z-slider!
160124

161-
Because BDV can display many sources in any direction and potentially warped them arbitrarily, it is not obvious to define "Z". "For instance "X" can become "Z" if you rotate the stack by 90 degrees. It is nonetheless possible to add a Z-slider to BDV windows with the command {% include bc path="Plugins|BigDataViewer-Playground|BDV|BDV - Add Z Slider"%}. This slider only looks at the center of the bdv window and 'casts a ray' in this direction. Each time this ray crosses a plane, a corresponding step exists in the slider, however, the distance between each step do not reflect the z distance, but is simply in index of the plane crossed. the number of steps is dynamically computed.
125+
Because BDV can display many sources in any direction and potentially warped them arbitrarily, it is not obvious to define "Z". "For instance "X" can become "Z" if you rotate the stack by 90 degrees. It is nonetheless possible to add a Z-slider to BDV windows with the command {% include bc path="Plugins|BigDataViewer-Playground|BDV|BDV - Add Z Slider"%}. This slider only looks at the center of the bdv window and 'casts a ray' in this direction. Each time this ray crosses a plane, a corresponding step exists in the slider, however, the distance between each step do not reflect the z distance, but is simply the index of the plane crossed. the number of steps is dynamically computed.
162126

163127
# Working with multiple viewers
164128

@@ -183,22 +147,4 @@ You can synchronize the sources that are added or removed between windows with t
183147
{% include img name="sync states" src="/media/plugins/bdv/playground/bdvpg-sync-states.png" %}
184148

185149
{% include notice icon="tip"
186-
content="States in ortho viewers can be synchronized with a checkbox when they are created" %}
187-
188-
# Tutorials
189-
190-
* [how to manually register a bdv dataset with bigdataviewer-playground.](/plugins/bdv/playground-manual-registration).
191-
192-
193-
194-
195-
196-
197-
198-
199-
200-
201-
202-
203-
204-
150+
content="States in ortho viewers can be synchronized with a checkbox when they are created" %}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
title: BigDataViewer Playground
3+
artifact: sc.fiji:bigdataviewer-playground
4+
nav-links: true
5+
toc: true
6+
---
7+
8+
BigDataViewer playground aims at a better integration of BigDataViewer into Fiji by using the [SciJava Framework](/libs/scijava).
9+
10+
It also provides support for opening big files directly from the bio-formats and the OMERO Java APIs.
11+
12+
# Installation
13+
14+
Enable the [PTBIOP update site](/update-sites/following).
15+
16+
# What bigdataviewer-playground brings ?
17+
18+
## Modularity for BigDataViewer!
19+
20+
BigDataViewer playground creates a way to access existing BDV instances when scripting or writing java code. Being able to combine scripts or code for display and processing is doable via scripting (Groovy, ImageJ macro, etc.)
21+
22+
## Use the macro recorder for BigDataViewer
23+
24+
To some extent, scripting basic actions on BigDataViewer with the ImageJ macro recorder is possible.
25+
26+
## Direct and lazy opening of multiresolution files, supported by bioformats or OMERO
27+
28+
It is possible to open and visualize large files in BigDataViewer without resaving files. This is particularly convenient for large 2D images (à la QuPath).
29+
You can use bigdataviewer-playground to create a dataset that can be re-used by any of the BigDataViewer ecosystem plugins (BigStitcher, BigWarp, Labkit...)
30+
31+
# Documentation summary
32+
33+
The documentation is split into several parts:
34+
35+
**[1 - Create/open](/plugins/bdv/playground/bdv-playground-open-dataset)** a dataset
36+
37+
38+
**[2 - Display](/plugins/bdv/playground/bdv-playground-visualize)** a dataset
39+
40+
41+
**[3 - Script](/plugins/bdv/playground/bdv-playground-scripting)** BDV
42+
43+
# Related software
44+
45+
## Aligning Big Brains and Atlases - ABBA
46+
47+
[ABBA](https://biop.github.io/ijp-imagetoatlas/), a tool to align 2D brain sections to 3D atlases, is built on top of BigDataViewer-Playground.
48+
49+
## Warpy
50+
51+
[Warpy](/plugins/bdv/warpy/warpy) is a Fiji + QuPath workflow designed to align, in a non-rigid manner, big 2D images.
52+
53+
54+
## Tutorials
55+
56+
**[how to manually register a bdv dataset with bigdataviewer-playground](/plugins/bdv/playground/bdv-playground-manual-registration)**
57+
58+
## Other
59+
60+
A video on BigDataViewer general concepts, followed by a presentation of BigDataViewer Playground and [BigDataProcessor](https://github.com/bigdataprocessor/bigdataprocessor2)
61+
62+
{% include video platform="youtube" id="LHI7vXiUUms" aspect="1:1" %}
63+
64+
65+
66+
67+
68+
69+
70+
71+
72+
73+
74+

0 commit comments

Comments
 (0)