Skip to content

Commit 71e6bb7

Browse files
committed
Update documentation
1 parent 0fb4853 commit 71e6bb7

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

docs/ops/doc/ScriptingInImageJ2.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ Using SciJava Ops and ImageJ Ops2 within scripts provide the most powerful aspec
44

55
## Obtaining an OpEnvironment
66

7-
To run Ops, scripts must first create an `OpEnvironment`. The following line will create a new `OpEnvironment` containing all Ops available in the environment:
7+
To run Ops, scripts require an `OpEnvironment`. The easiest way to obtain an `OpEnvironment` with all available Ops is to declare an `OpEnvironment` as a script parameter:
88

99
```text
10-
import org.scijava.ops.api.OpEnvironment
11-
ops = OpEnvironment.getEnvironment()
10+
#@ org.scijava.ops.api.OpEnvironment ops
1211
```
1312

1413
## Obtaining inputs
@@ -35,14 +34,11 @@ out = ops.op("filter.gauss").arity2().input(imgInput, new Double(3.0)).apply()
3534
The below script can be pasted into the Script Editor. **Ensure that the Script Editor is configured to run a Groovy script**.
3635

3736
```text
37+
#@ org.scijava.ops.api.OpEnvironment ops
3838
#@ ThreadService ts
3939
#@ Img imgInput
4040
#@output Img out
4141
42-
// Obtain an OpEnvironment
43-
import org.scijava.ops.api.OpEnvironment
44-
ops = OpEnvironment.getEnvironment()
45-
4642
// Call some Ops!
4743
out = ops.op("filter.gauss").arity2().input(imgInput, new Double(3.0)).apply()
4844
```

0 commit comments

Comments
 (0)