Skip to content

Commit 71c6141

Browse files
committed
Test doc scijava#1 and fix errors
- Runs standalone - Updated to use `mode` - Add additional info on `mode`
1 parent e7e10ff commit 71c6141

1 file changed

Lines changed: 10 additions & 30 deletions

File tree

doc/1-Starting-PyImageJ.ipynb

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,9 @@
2525
},
2626
{
2727
"cell_type": "code",
28-
"execution_count": 1,
28+
"execution_count": null,
2929
"metadata": {},
30-
"outputs": [
31-
{
32-
"data": {
33-
"text/plain": [
34-
"'2.3.0/1.53f'"
35-
]
36-
},
37-
"execution_count": 1,
38-
"metadata": {},
39-
"output_type": "execute_result"
40-
}
41-
],
30+
"outputs": [],
4231
"source": [
4332
"import imagej\n",
4433
"ij = imagej.init('sc.fiji:fiji:2.3.1')\n",
@@ -54,14 +43,16 @@
5443
"| Requirement | Code<sup>1</sup> | Reproducible?<sup>2</sup> |\n",
5544
"|:----------------------------------------------|:---------------------------------------------------------------------|:-------------------------:|\n",
5645
"| Newest available version of ImageJ | `ij = imagej.init()` | NO |\n",
57-
"| Specific version of ImageJ | `ij = imagej.init('2.1.0')` | YES |\n",
58-
"| With a GUI (newest version) | `ij = imagej.init(headless=False)` | NO |\n",
59-
"| With a GUI (specific version) | `ij = imagej.init('net.imagej:imageJ:2.1.0', headless=False)` | YES |\n",
46+
"| Specific version of ImageJ | `ij = imagej.init('2.3.0')` | YES |\n",
47+
"| Interactive (newest version)* | `ij = imagej.init(mode='interactive')` | NO |\n",
48+
"| Interactive (specific version)* | `ij = imagej.init('net.imagej:imageJ:2.1.0', mode='interactive')` | YES |\n",
6049
"| With support for ImageJ 1.x (newest versions) | `ij = imagej.init('net.imagej:imagej+net.imagej:imagej-legacy')` | NO |\n",
6150
"| With Fiji plugins (newest version) | `ij = imagej.init('sc.fiji:fiji')` | NO |\n",
6251
"| With Fiji plugins (specific version) | `ij = imagej.init('sc.fiji:fiji:2.1.1')` | YES |\n",
6352
"| From a local installation | `ij = imagej.init('/Applications/Fiji.app')` | DEPENDS |\n",
6453
"\n",
54+
"*: `mode='interactive'` is unavailalbe on MacOS. Instead use `mode='gui'`. When set to `gui` mode the Python inerpter is blocked and no longer interactive._\n",
55+
"\n",
6556
"<sup>1</sup> pyimagej uses [`jgo`](https://github.com/scijava/jgo) internally to call up ImageJ, so all of these initializations are tied to the usage of `jgo`. You can read up on the [usage of `jgo`](https://github.com/scijava/jgo#usage) to find out more about this initialization.\n",
6657
"\n",
6758
"<sup>2</sup> ___Reproducible___ means code is stable, executing the same today, tomorrow, and in years to come. While it is convenient and elegant to depend on the newest version of a program, behavior may change when new versions are released—for the better if bugs are fixed; for the worse if bugs are introduced—and people executing your notebook at a later time may encounter broken cells, unexpected results, or other more subtle behavioral differences. You can help avoid this pitfall by pinning to a specific version of the software. The British Ecological Society published [Guide to Better Science: Reproducible Code](https://www.britishecologicalsociety.org/wp-content/uploads/2018/12/BES-Reproducible-Code.pdf) diving into the relevant challenges in more detail, including an [R](https://www.r-project.org/)-centric illustration of best practices. A web search for `reproducible python` also yields several detailed articles."
@@ -91,20 +82,9 @@
9182
},
9283
{
9384
"cell_type": "code",
94-
"execution_count": 2,
85+
"execution_count": null,
9586
"metadata": {},
96-
"outputs": [
97-
{
98-
"data": {
99-
"text/plain": [
100-
"'ImageJ2 2.3.0/1.53f; Java 11.0.9.1-internal [amd64]; 35MB of 8012MB'"
101-
]
102-
},
103-
"execution_count": 2,
104-
"metadata": {},
105-
"output_type": "execute_result"
106-
}
107-
],
87+
"outputs": [],
10888
"source": [
10989
"ij.getApp().getInfo(True)"
11090
]
@@ -126,7 +106,7 @@
126106
"name": "python",
127107
"nbconvert_exporter": "python",
128108
"pygments_lexer": "ipython3",
129-
"version": "3.10.1"
109+
"version": "3.8.10"
130110
},
131111
"toc": {
132112
"base_numbering": 1,

0 commit comments

Comments
 (0)