Skip to content

Commit 56cffa0

Browse files
committed
Update README links and formatting
1 parent d26fafe commit 56cffa0

1 file changed

Lines changed: 88 additions & 63 deletions

File tree

README.md

Lines changed: 88 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@
22

33
# ImageJ Server
44

5-
This is a RESTful image server backed by ImageJ.
5+
This is a RESTful image server backed by ImageJ2.
66

7-
To provide easy-to-use and highly reusable image processing functionalities is
8-
a [central goal of ImageJ](https://imagej.net/Ops). As a result, the components
9-
of ImageJ are [modular](https://imagej.net/Architecture#Modularity), to
10-
make them easily accessible from other Java programs. However, for programs
11-
written in other languages besides Java, the interaction becomes complicated.
12-
In order to mitigate this problem, this RESTful image server is offered as a
13-
universal interfacing layer.
7+
To provide easy-to-use and highly reusable image processing functionalities
8+
is a [central goal of ImageJ2](https://imagej.net/libs/imagej-ops).
9+
As a result, the components of ImageJ2 are
10+
[modular](https://imagej.net/develop/architecture#modularity), to make them
11+
easily accessible from other Java programs. However, for programs written in
12+
other languages besides Java, the interaction becomes complicated. In order to
13+
mitigate this problem, this RESTful image server is offered as a universal
14+
interfacing layer.
1415

1516
See the [Rationale](https://github.com/imagej/imagej-server/wiki/Rationale)
1617
page of this repository's wiki for a longer discussion of cross-language
@@ -21,9 +22,9 @@ This is currently only a prototype! Testing needed!
2122
## Launching
2223

2324
The server can run with a graphical display, or in
24-
[headless](https://imagej.net/Headless) mode.
25+
[headless](https://imagej.net/learn/headless) mode.
2526

26-
* With a graphical display, remote commands can affect the ImageJ graphical
27+
* With a graphical display, remote commands can affect the ImageJ2 graphical
2728
user interface (GUI). E.g., images can be displayed to the user.
2829
* In headless mode, there is no GUI. E.g., in a cluster computing environment,
2930
each node can have its own local ImageJ Server instance.
@@ -37,7 +38,7 @@ There are several ways to invoke the server:
3738
* Use _Plugins › Utilities › Stop Server_
3839
to shut down the server. The local ImageJ will continue running.
3940

40-
You must enable the Server [update site](https://imagej.net/Update_Sites) first.
41+
You must enable the Server [update site](https://imagej.net/update-sites) first.
4142

4243
</details>
4344
<details><summary><b>Launch via jgo</b></summary>
@@ -76,21 +77,21 @@ Clone this repository, import the project, then run the class
7677
`net.imagej.server.Main`. The server will launch _in headless mode_.
7778

7879
</details>
79-
<details><summary><b>Launch via the ImageJ Launcher</b></summary>
80+
<details><summary><b>Launch via the Fiji Launcher</b></summary>
8081

81-
Enable the Server [update site](https://imagej.net/Update_Sites).
82+
Enable the Server [update site](https://imagej.net/update-sites).
8283

83-
Then launch ImageJ with a graphical display:
84+
Then launch Fiji with a graphical display:
8485
```
85-
./ImageJ --server
86+
./fiji --server
8687
```
8788

8889
Or in headless mode:
8990
```
90-
./ImageJ --server --headless
91+
./fiji --server --headless
9192
```
9293

93-
See also the [ImageJ Launcher](https://imagej.net/Launcher) documentation.
94+
See also the [Fiji Launcher](https://imagej.net/learn/launcher) documentation.
9495

9596
</details>
9697
<details><summary><b>Including additional plugins</b></summary>
@@ -99,11 +100,11 @@ If you want to make additional ImageJ plugins (e.g. plugins from
99100
[Fiji](https://github.com/fiji)) available remotely, you can include the
100101
additional components on the runtime classpath.
101102

102-
One easy way is via the `jgo`-based launch mechanism with the `+` syntax.
103-
For example:
103+
One easy way is via the [jgo](https://jgo.apposed.org/)-based launch mechanism
104+
with the `+` syntax. For example:
104105

105106
```
106-
jgo sc.fiji:fiji+net.imagej:image-server
107+
jgo --class-path-only --java-version 11 sc.fiji:fiji+net.imagej:imagej-server:0.2.0-SNAPSHOT
107108
```
108109

109110
Another way is make your own Maven project depending on
@@ -120,14 +121,17 @@ A Python wrapper for the web API.
120121

121122
### [Postman Collection](clients/postman)
122123

123-
A collection of sample API calls to imagej-server using [Postman](https://www.getpostman.com/).
124+
A collection of sample API calls to imagej-server using
125+
[Postman](https://www.getpostman.com/).
124126

125127
### Web client with GUI
126128

127129
Installation
128130

129-
- Check that you have got *Node.js* and *npm* installed ([instructions](https://www.npmjs.com/get-npm)).
130-
- Open a command prompt, navigate to `clients\webNew` and run `npm install`. This will install all required *Node.js* packages.
131+
- Check that you have got *Node.js* and *npm* installed
132+
([instructions](https://www.npmjs.com/get-npm)).
133+
- Open a command prompt, navigate to `clients\webNew` and run `npm install`.
134+
This will install all required *Node.js* packages.
131135

132136
Compilation and execution (development)
133137

@@ -136,77 +140,98 @@ Compilation and execution (development)
136140

137141
### APIs
138142

139-
- __GET__ /modules
143+
- __GET__ `/modules`
140144

141-
Returns a list of modules. By default, imagej-server exposes its API at `localhost:8080`, which will be used throughout this documentation.
145+
Returns a list of modules. By default, imagej-server exposes its API at
146+
`localhost:8080`, which will be used throughout this documentation.
142147

143-
`$ curl localhost:8080/modules`
148+
```
149+
curl localhost:8080/modules
150+
```
144151

145-
- __GET__ /modules/*{id}*
152+
- __GET__ `/modules/*{id}*`
146153

147-
Returns detailed information of a module specified by `{id}`. Notice that `{id}` could contain special characters such as dollar sign (`$`), which needs to be escaped when using `cURL`.
154+
Returns detailed information of a module specified by `{id}`. Notice that
155+
`{id}` could contain special characters such as dollar sign (`$`), which
156+
needs to be escaped when using `cURL`.
148157

149-
`$ curl localhost:8080/modules/'command:net.imagej.ops.math.PrimitiveMath$IntegerAdd'`
158+
```
159+
curl localhost:8080/modules/'command:net.imagej.ops.math.PrimitiveMath$IntegerAdd'
160+
```
150161

151-
- __POST__ /modules/*{id}*?process=*{process}*
162+
- __POST__ `/modules/*{id}*?process=*{process}*`
152163

153-
Executes a module with with JSON inputs. Use the module details to determine the correct input keys. The optional query parameter `process` determines if the execution should be pre/post processed.
164+
Executes a module with with JSON inputs. Use the module details to determine
165+
the correct input keys. The optional query parameter `process` determines if
166+
the execution should be pre/post processed.
154167

155-
```
156-
$ curl -XPOST -H "Content-Type: application/json" -d '{"a":1,"b":3}' \
157-
> localhost:8080/modules/'command:net.imagej.ops.math.PrimitiveMath$IntegerAdd'?process=false
158-
{"result":4}
159-
```
168+
```
169+
$ curl -XPOST -H "Content-Type: application/json" -d '{"a":1,"b":3}' \
170+
'localhost:8080/modules/command:net.imagej.ops.math.PrimitiveMath$IntegerAdd?process=false'
171+
{"result":4}
172+
```
160173

161-
- __GET__ /objects
174+
- __GET__ `/objects`
162175

163-
Lists all object IDs available on imagej-server.
176+
Lists all object IDs available on imagej-server.
164177

165-
`$ curl localhost:8080/objects`
178+
```
179+
curl localhost:8080/objects
180+
```
166181

167-
- __GET__ /objects/*{id}*
182+
- __GET__ `/objects/*{id}*`
168183

169-
Shows the information of an object.
184+
Shows the information of an object.
170185

171-
```
172-
$ curl localhost:8080/objects/object:1234567890abcdef
173-
{"class":"net.imagej.DefaultDataset","created_at":"Sun Jan 01 00:00:00 CST 2017"}
174-
```
186+
```
187+
$ curl localhost:8080/objects/object:1234567890abcdef
188+
{"class":"net.imagej.DefaultDataset","created_at":"Sun Jan 01 00:00:00 CST 2017"}
189+
```
175190

176-
- __DELETE__ /objects/*{id}*
191+
- __DELETE__ `/objects/*{id}*`
177192

178-
Delete one object from imagej-server.
193+
Delete one object from imagej-server.
179194

180-
`$ curl -XDELETE localhost:8080/objects/object:1234567890abcdef`
195+
```
196+
curl -XDELETE localhost:8080/objects/object:1234567890abcdef
197+
```
181198

182-
- __POST__ /objects/upload?[type=*{type}*]
199+
- __POST__ `/objects/upload?[type=*{type}*]`
183200

184-
Uploads a file to server. A 16-bit lowercase alphanumeric ID prefixed with `object:` will be returned as a JSON string. The ID can be used in module execution to represent the file. Currently only supports uploading images and tables in text. An optional query parameter `type` could be provided as hint to file type. If it is empty, filename would be used for guessing.
201+
Uploads a file to server. A 16-bit lowercase alphanumeric ID prefixed with
202+
`object:` will be returned as a JSON string. The ID can be used in module
203+
execution to represent the file. Currently only supports uploading images and
204+
tables in text. An optional query parameter `type` could be provided as hint
205+
to file type. If it is empty, filename would be used for guessing.
185206

186-
```
187-
$ curl -F "file=@src/test/resources/imgs/about4.tif" localhost:8080/objects/upload
188-
{"id":"object:0123456789abcdef"}
189-
```
207+
```
208+
$ curl -F "file=@src/test/resources/imgs/about4.tif" localhost:8080/objects/upload
209+
{"id":"object:0123456789abcdef"}
210+
```
190211

191-
- __GET__ /objects/*{id}*/*{format}*?[&key=*{value}*]...
212+
- __GET__ `/objects/*{id}*/*{format}*?[&key=*{value}*]...`
192213

193-
Download an object in some specific format from the server. Optional query parameters will be used for configuration depending on the type of the object.
214+
Download an object in some specific format from the server.
215+
Optional query parameters will be used for configuration
216+
depending on the type of the object.
194217

195-
`$ curl localhost:8080/objects/object:0123456789abcdef/png`
218+
```
219+
curl localhost:8080/objects/object:0123456789abcdef/png
220+
```
196221

197-
- __DELETE__ /admin/stop
222+
- __DELETE__ `/admin/stop`
198223

199-
Stop the imagej-server gracefully without shutting down the imagej runtime.
224+
Stop the imagej-server gracefully without shutting down the imagej runtime.
200225

201-
`curl -XDELETE localhost:8080/admin/stop`
226+
`curl -XDELETE localhost:8080/admin/stop`
202227

203228
## Notes and memo
204229

205-
- DefaultObjectService effectively prevents garbage collection of all objects produced during the lifetime of this imagej-server instance, which could lead to serious memory issues. The timestamped object ID could be used to determine if an object should "expire" on a regular basis or when memory runs low.
206-
- Ops that need to be initialized are not working when run as module. See the HACK in `ModulesResource`
230+
- `DefaultObjectService` effectively prevents garbage collection of all objects produced during the lifetime of this imagej-server instance, which could lead to serious memory issues. The timestamped object ID could be used to determine if an object should "expire" on a regular basis or when memory runs low.
231+
- Ops that need to be initialized are not working when run as module. See the HACK in `ModulesResource`.
207232
- The converters from `Number` to `NumericType` could be refined and considered moving to other projects such as SciJava.
208233
- It might be a good idea for the client to provide optional language-neutral type information for module execution, so that we can support more complex data structures without too much guessing. This would also solve the problem of nested special object (i.e. `List<Integer>` could not be converted into `List<IntType>` even with converter between `Integer` and `IntType`).
209234
- What test framework should be used?
210-
- Might need to add logging/debug info
235+
- Might need to add logging/debug info.
211236
- The module information should be improved. The inputs outputs names are not very informative.
212237
- The current design of setting inputs/getting outputs could easily break if those names are changed. Should we just assume they will never change, or should those libraries (i.e. Ops) also take care of all the client implementation?

0 commit comments

Comments
 (0)