Skip to content

Commit 856115a

Browse files
committed
Merge branch 'polish-docs'
Fix a few small issues in the documentation.
2 parents d7c44ae + 45f786e commit 856115a

File tree

6 files changed

+33
-14
lines changed

6 files changed

+33
-14
lines changed

docs/ops/doc/CallingOps.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,31 @@ direct execution, since the parameters have not been concretely specified yet.
7272
Using [wildcards](https://docs.oracle.com/javase/tutorial/extra/generics/wildcards.html), such as `Img<?> inImage`, can make Op reuse difficult. For example, the following code segment will not compile in a Java runtime:
7373

7474
```java
75-
Img<?> inImage = ...;
75+
Img<?> inImage = ArrayImgs.unsignedBytes(128, 128);
7676
var gaussOp = ops.op("filter.gauss").input(inImage, 2.0).output(outImage).computer();
7777
gaussOp.compute(inImage, 2.0, outImage);
7878
```
7979

8080
### Solution 1: Use `compute` instead of `computer`
8181

82-
If you don't need to save the Op to a variable, *just call it directly* as shown [here](#computing-with-compute). Generally speaking, op requests are **cached**, meaning repeated OpBuilder calls that directly execute Ops will **not** significantly increase performance.
82+
If you don't need to save the Op to a variable, *just [call it directly](#computing-with-compute)*:
8383

84-
### Solution 2: Use Type Parameters on your functions
84+
```java
85+
ops.op("filter.gauss").input(inImage, 2.0).output(outImage).compute();
86+
```
87+
88+
Generally speaking, op requests are **cached**, meaning repeated OpBuilder calls that directly execute Ops will **not** significantly decrease performance.
89+
90+
### Solution 2: Avoid using wildcards
91+
92+
If you *know* that your `Img` will always contain unsigned byte values, for example, define your variable as an `Img<UnsignedByteType>` rather than using `Img<?>`.
93+
94+
### Solution 3: Use raw casts (not type-safe!)
95+
96+
```java
97+
Img<?> inImage = ArrayImgs.unsignedBytes(128, 128);
98+
var gaussOp = ops.op("filter.gauss").input(inImage, 2.0).output(outImage).computer();
99+
gaussOp.compute((Img) inImage, 2.0, outImage);
100+
```
85101

86-
If you *know* that your `Img` will always contain bytes, define your variable as an `Img<ByteType>`
102+
This method should only be used as a last resort.

docs/ops/doc/examples/flim_analysis.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ We use a sample of `FluoCells™ Prepared Slide #1`_, imaged by `Jenu Chacko`_ u
1313

1414
FluoCells™ Prepared Slide #1 contains bovine pulmonary artery endothelial cells (BPAEC). MitoTracker™ Red CMXRos was used to stain the mitochondria in the live cells, with accumulation dependent upon membrane potential. Following fixation and permeabilization, F-actin was stained with Alexa Fluor™ 488 phalloidin, and the nuclei were counterstained with the blue-fluorescent DNA stain DAPI.
1515

16-
The sample data can be downloaded `here <https://media.scijava.org/scijava-ops/1.0.0/flim_example_data.sdt>`_ and can be loaded into Fiji with `Bio-Formats`_ using ``File → Open``. When presented with the ``Bio-Formats Import Options`` screen, it may be helpful to select ``Metadata viewing → Display metadata`` to determine values necessary for analysis. Then, select ``OK``. The data may take a minute to load.
16+
The sample data can be downloaded `here <https://media.scijava.org/scijava-ops/1.0.0/flim_example_data.sdt>`_ and can be loaded into Fiji with `SCIFIO`_ using ``File → Open...`` or ``File → Import → Image...``. The data may take a minute to load.
1717

1818
Within the script, the `Levenberg-Marquardt algorithm`_ fitting Op of SciJava Ops FLIM is used to fit the data.
1919

@@ -78,7 +78,7 @@ The pseudocolored result shows a clear separation of fluorophores, which could b
7878
#@ ROIService roiService
7979
#@ Img input
8080
#@ Float (description="The total time (ns) (timeBase in metadata)", label = "Time Base", value=12.5) timeBase
81-
#@ Integer (description="The number of time bins (timeBins in metadata)", label = "Time Bins", value=512) timeBins
81+
#@ Integer (description="The number of time bins (timeBins in metadata)", label = "Time Bins", value=256) timeBins
8282
#@ Integer (description="The index of the lifetime axis (from metadata)", label = "Lifetime Axis", value=2) lifetimeAxis
8383
#@ Float (description="The minimal pixel intensity (across all time bins) threshold for fitting", label = "Intensity Threshold", value = 18) iThresh
8484
#@ Integer (description="The radius of the binning kernel", label = "Bin Kernel Radius", value=1, min=0) kernelRad
@@ -222,7 +222,7 @@ In the panels below, we show the results of executing both scripts with computat
222222
:width: 49%
223223

224224

225-
.. _`Bio-Formats` : https://www.openmicroscopy.org/bio-formats/
225+
.. _`SCIFIO` : https://scif.io
226226
.. _`FLIM` : https://en.wikipedia.org/wiki/Fluorescence-lifetime_imaging_microscopy
227227
.. _`FluoCells™ Prepared Slide #1` : https://www.thermofisher.com/order/catalog/product/F36924
228228
.. _`FRET` : https://en.wikipedia.org/wiki/F%C3%B6rster_resonance_energy_transfer

docs/ops/doc/examples/gaussian_subtraction.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
=========================
2-
Gaussian blur subtraction
2+
Gaussian Blur Subtraction
33
=========================
44

5-
In this example we will use SciJava Ops to open an image, apply a guassian blur and subract the blurred image from the input image.
5+
In this example we will use SciJava Ops to open an image, apply a gaussian blur and subtract the blurred image from the input image.
66
This technique can be used to extract features, such as puncta, from a noisy background.
77

8-
SciJava Ops via Fiji's sripting engine with `script parameters`_:
8+
Here is a script using `script parameters`_, runnable in Fiji's `Script Editor`_:
99

1010
.. tabs::
1111

@@ -53,4 +53,5 @@ SciJava Ops via Fiji's sripting engine with `script parameters`_:
5353
result = ops.op("create.img").input(img, FloatType()).apply()
5454
ops.op("math.sub").input(img, img_gauss).output(result).compute()
5555

56-
.. _`script parameters`: https://imagej.net/scripting/parameters
56+
.. _`script parameters`: https://imagej.net/scripting/parameters
57+
.. _`Script Editor`: https://imagej.net/scripting/script-editor

docs/ops/doc/examples/saca.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,5 +169,5 @@ To apply the ``phase`` LUT and a colorbar use the following script and select th
169169
.. _`Becker and Sherer, JVI 2017`: https://pubmed.ncbi.nlm.nih.gov/28053097/
170170
.. _`Wang et. al, IEEE 2019`: https://ieeexplore.ieee.org/abstract/document/8681436
171171
.. _`Stockley et. al, Bacteriophage 2016`: https://pubmed.ncbi.nlm.nih.gov/27144089/
172-
.. _`here`: https://media.imagej.net/scijava-ops/1.0.0/hela_hiv_gag_ms2_mcherry.tif
172+
.. _`here`: https://media.scijava.org/scijava-ops/1.0.0/hela_hiv_gag_ms2_mcherry.tif
173173
.. _`script parameters`: https://imagej.net/scripting/parameters

scijava-ops-engine/src/main/java/module-info.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@
4343
requires org.scijava.priority;
4444
requires org.scijava.progress;
4545
requires org.scijava.struct;
46-
requires transitive org.scijava.ops.api;
46+
requires org.scijava.ops.api;
4747
requires org.scijava.ops.spi;
4848
requires org.scijava.types;
4949

50+
requires com.google.common;
5051
requires org.javassist;
5152
requires org.slf4j;
5253
requires org.yaml.snakeyaml;

scijava-ops-engine/templates/main/java/module-info.vm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ module org.scijava.ops.engine {
1515
requires org.scijava.priority;
1616
requires org.scijava.progress;
1717
requires org.scijava.struct;
18-
requires transitive org.scijava.ops.api;
18+
requires org.scijava.ops.api;
1919
requires org.scijava.ops.spi;
2020
requires org.scijava.types;
2121

22+
requires com.google.common;
2223
requires org.javassist;
2324
requires org.slf4j;
2425
requires org.yaml.snakeyaml;

0 commit comments

Comments
 (0)