You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 97f7de5
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: docs/ops/doc/ScriptingInFiji.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,15 +4,15 @@ Scripts provide a simple, familiar interface for accessing SciJava Ops and allow
4
4
5
5
## Obtaining an OpEnvironment
6
6
7
-
To run Ops we always start with an `OpEnvironment`. The easiest way to obtain an `OpEnvironment`with all available Ops is to declare an `OpEnvironment` as a [script parameter](https://imagej.net/scripting/parameters):
7
+
To run Ops we always start with an `OpEnvironment`. Within Fiji, the easiest way to obtain an `OpEnvironment` is to declare it as a [script parameter](https://imagej.net/scripting/parameters):
8
8
9
9
```text
10
10
#@ OpEnvironment ops
11
11
```
12
12
13
13
## Setting inputs and outputs
14
14
15
-
A good starting point is to declare script parameters that match your desired Op's parameters. When performing image processing we are modifying an existing image, so we also want to create an output image in the script so our result will be shown. The following lines use SciJava's script parameters to obtain the active image as an input along with a user-defined sigma, while establishing our output.
15
+
A good starting point is to declare script parameters that match your desired Op's parameters. When performing image processing, we are operating on an existing image; we also want to create an output image in the script so that our result will be shown. The following lines use SciJava script parameters to obtain the active image as an input along with a user-defined sigma, while establishing our output.
16
16
17
17
```text
18
18
#@ Img imgInput
@@ -22,14 +22,14 @@ A good starting point is to declare script parameters that match your desired Op
22
22
23
23
## Calling Ops
24
24
25
-
The [OpBuilder syntax](CallingOps) should be used to retrieve and execute Ops from the `OpEnvironment`. The following line executes a Gaussian Blur on an input image using a `filter.gauss` Op:
25
+
The [OpBuilder syntax](CallingOps) should be used to retrieve and execute Ops from the `OpEnvironment`. The following line executes a Gaussian blur on an input image using a `filter.gauss` Op:
26
26
```text
27
27
out = ops.op("filter.gauss").input(imgInput, sigma).apply()
28
28
```
29
29
30
30
## Putting it all together
31
31
32
-
The below script can be pasted into the Script Editor. **Ensure that the Script Editor is configured to run a Groovy script**.
32
+
The below script can be pasted into the Script Editor. **Ensure that the Script Editor is configured to run a Groovy script** (*Language → Groovy* in the Script Editor menu).
33
33
34
34
```text
35
35
#@ OpEnvironment ops
@@ -43,10 +43,10 @@ out = ops.op("filter.gauss").input(imgInput, sigma).apply()
43
43
44
44
## Add your Op to the menu
45
45
46
-
If you want to re-use an Op outside of the script editor: good news! All SciJava scripts are ImageJ plugins and can be [installed](https://imagej.net/plugins/index#installing-plugins-manually) into your Fiji installation. For example, if we create a new `Ops` folder in our `Fiji.app/plugins/` directoryand save our script there as `FilterGauss_.groovy` (or similar - just don't forget the `_`!) then after re-starting Fiji we can run our Op from the `Plugins > Ops` menu, and it will also show up in the [search bar](https://imagej.net/learn/#the-search-bar).
46
+
If you want to reuse an Op outside of the script editor: good news! All SciJava scripts are runnable as ImageJ commands, and can be [installed](https://imagej.net/plugins/index#installing-plugins-manually) into your Fiji installation. For example, suppose we create new nested folders in our `Fiji.app/scripts` directory: first a `Plugins` folder (if it does not already exist), and then inside of that, a new `Ops` folder. If we then save our script there as `Filter_Gauss.groovy` (or similar—just don't forget the `_`!) then after re-starting Fiji we can run our Op from the *Plugins → Ops* menu, which matches the folder structure we created. The command will also be accessible from the [search bar](https://imagej.net/learn/#the-search-bar).
47
47
48
48
## Next steps
49
49
50
50
Check out the How-To Guides for important information like how to [explore the available Ops](SearchingForOps).
51
51
52
-
Check out some examples such as [image deconvolution](examples/deconvolution.rst) or [FLIM analysis](examples/flim_analysis.rst) to see more complete cases of Ops being used in the Script editor!
52
+
Check out some examples such as [image deconvolution](examples/deconvolution.rst) or [FLIM analysis](examples/flim_analysis.rst) to see more complete cases of Ops being used in the Script Editor!
0 commit comments