{"id":19093414,"url":"https://github.com/imagej/imagej-server","last_synced_at":"2025-04-30T12:43:58.318Z","repository":{"id":9016969,"uuid":"10773078","full_name":"imagej/imagej-server","owner":"imagej","description":"A RESTful web server for ImageJ [EXPERIMENTAL]","archived":false,"fork":false,"pushed_at":"2023-04-12T14:01:09.000Z","size":2349,"stargazers_count":39,"open_issues_count":13,"forks_count":17,"subscribers_count":37,"default_branch":"master","last_synced_at":"2025-04-19T02:23:14.610Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ohhdemgirls/CaptureBate","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imagej.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-06-18T20:40:50.000Z","updated_at":"2024-08-13T06:33:26.000Z","dependencies_parsed_at":"2024-11-09T03:26:44.604Z","dependency_job_id":"cafc16ef-7d33-4e54-90de-22d1f8b70cab","html_url":"https://github.com/imagej/imagej-server","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagej%2Fimagej-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagej%2Fimagej-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagej%2Fimagej-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imagej%2Fimagej-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imagej","download_url":"https://codeload.github.com/imagej/imagej-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251702910,"owners_count":21630119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T03:24:34.113Z","updated_at":"2025-04-30T12:43:58.297Z","avatar_url":"https://github.com/imagej.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![](https://github.com/imagej/imagej-server/actions/workflows/build-main.yml/badge.svg)](https://github.com/imagej/imagej-server/actions/workflows/build-main.yml)\n[![developer chat](https://img.shields.io/badge/zulip-join_chat-brightgreen.svg)](https://imagesc.zulipchat.com/#narrow/stream/327236-ImageJ2)\n\n# ImageJ Server\n\nThis is a RESTful image server backed by ImageJ.\n\nTo provide easy-to-use and highly reusable image processing functionalities is\na [central goal of ImageJ](https://imagej.net/Ops). As a result, the components\nof ImageJ are [modular](https://imagej.net/Architecture#Modularity), to\nmake them easily accessible from other Java programs. However, for programs\nwritten in other languages besides Java, the interaction becomes complicated.\nIn order to mitigate this problem, this RESTful image server is offered as a\nuniversal interfacing layer.\n\nSee the [Rationale](https://github.com/imagej/imagej-server/wiki/Rationale)\npage of this repository's wiki for a longer discussion of cross-language\nintegration and interoperability.\n\nThis is currently only a prototype! Testing needed!\n\n## Launching\n\nThe server can run with a graphical display, or in\n[headless](https://imagej.net/Headless) mode.\n\n* With a graphical display, remote commands can affect the ImageJ graphical\n  user interface (GUI). E.g., images can be displayed to the user.\n* In headless mode, there is no GUI. E.g., in a cluster computing environment,\n  each node can have its own local ImageJ Server instance.\n\nThere are several ways to invoke the server:\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eIf ImageJ is already running\u003c/b\u003e\u003c/summary\u003e\n\n* Use _Plugins \u0026#8250; Utilities \u0026#8250; Start Server_\n  to make ImageJ start listening for remote commands.\n* Use _Plugins \u0026#8250; Utilities \u0026#8250; Stop Server_\n  to shut down the server. The local ImageJ will continue running.\n\nYou must enable the Server [update site](https://imagej.net/Update_Sites) first.\n\n\u003c/details\u003e\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eLaunch via jgo\u003c/b\u003e\u003c/summary\u003e\n\nThe [jgo](https://github.com/scijava/jgo) launcher makes it easy to launch the\nImageJ Server. No need to explicitly clone the repository or download any JARs.\n\nAfter installing jgo, add the following stanza to your `~/.jgorc` file:\n```ini\n[repositories]\nimagej.public = https://maven.imagej.net/content/groups/public\n```\n\nThen invoke the server with a graphical display as follows:\n```\njgo net.imagej:imagej-server\n```\n\nOr in headless mode:\n```\njgo -Djava.awt.headless=true net.imagej:imagej-server\n```\n\n\u003c/details\u003e\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eLaunch from CLI via Maven\u003c/b\u003e\u003c/summary\u003e\n\nClone this repository. Then start the server from the CLI _in headless mode_:\n```\nmvn -Pexec\n```\n\n\u003c/details\u003e\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eLaunch from IDE\u003c/b\u003e\u003c/summary\u003e\n\nClone this repository, import the project, then run the class\n`net.imagej.server.Main`. The server will launch _in headless mode_.\n\n\u003c/details\u003e\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eLaunch via the ImageJ Launcher\u003c/b\u003e\u003c/summary\u003e\n\nEnable the Server [update site](https://imagej.net/Update_Sites).\n\nThen launch ImageJ with a graphical display:\n```\n./ImageJ --server\n```\n\nOr in headless mode:\n```\n./ImageJ --server --headless\n```\n\nSee also the [ImageJ Launcher](https://imagej.net/Launcher) documentation.\n\n\u003c/details\u003e\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eIncluding additional plugins\u003c/b\u003e\u003c/summary\u003e\n\nIf you want to make additional ImageJ plugins (e.g. plugins from\n[Fiji](https://github.com/fiji)) available remotely, you can include the\nadditional components on the runtime classpath.\n\nOne easy way is via the `jgo`-based launch mechanism with the `+` syntax.\nFor example:\n\n```\njgo sc.fiji:fiji+net.imagej:image-server\n```\n\nAnother way is make your own Maven project depending on\n`net.imagej:imagej-server` and other things, with a `main` entry point\nthat invokes `net.imagej.server.Main.main(String[])`.\n\n\u003c/details\u003e\n\n## Usage\n\n### Python Client\n\nThe [pyimagej](https://github.com/imagej/pyimagej) module includes a Python wrapper for the web API.\n\n### [Postman Collection](clients/postman)\n\nA collection of sample API calls to imagej-server using [Postman](https://www.getpostman.com/).\n\n### Web client with GUI\n\nInstallation\n\n- Check that you have got *Node.js* and *npm* installed ([instructions](https://www.npmjs.com/get-npm)).\n- Open a command prompt, navigate to `clients\\webNew` and run `npm install`. This will install all required *Node.js* packages.\n\nCompilation and execution (development)\n\n- Open a command prompt, navigate to `clients\\webNew` and run `npm start`.\n- Open a web browser and navigate to `localhost:4200`.\n\n### APIs\n\n- __GET__ /modules\n\n Returns a list of modules. By default, imagej-server exposes its API at `localhost:8080`, which will be used throughout this documentation.\n\n `$ curl localhost:8080/modules`\n\n- __GET__ /modules/*{id}*\n\n 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`.\n\n `$ curl localhost:8080/modules/'command:net.imagej.ops.math.PrimitiveMath$IntegerAdd'`\n\n- __POST__ /modules/*{id}*?process=*{process}*\n\n 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.\n\n ```\n $ curl -XPOST -H \"Content-Type: application/json\" -d '{\"a\":1,\"b\":3}' \\\n \u003e localhost:8080/modules/'command:net.imagej.ops.math.PrimitiveMath$IntegerAdd'?process=false\n {\"result\":4}\n ```\n\n- __GET__ /objects\n\n Lists all object IDs available on imagej-server.\n\n `$ curl localhost:8080/objects`\n\n- __GET__ /objects/*{id}*\n\n Shows the information of an object.\n\n ```\n $ curl localhost:8080/objects/object:1234567890abcdef\n {\"class\":\"net.imagej.DefaultDataset\",\"created_at\":\"Sun Jan 01 00:00:00 CST 2017\"}\n ```\n\n- __DELETE__ /objects/*{id}*\n\n Delete one object from imagej-server.\n\n `$ curl -XDELETE localhost:8080/objects/object:1234567890abcdef`\n\n- __POST__ /objects/upload?[type=*{type}*]\n\n 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.\n\n ```\n $ curl -F \"file=@src/test/resources/imgs/about4.tif\" localhost:8080/objects/upload\n {\"id\":\"object:0123456789abcdef\"}\n ```\n\n- __GET__ /objects/*{id}*/*{format}*?[\u0026key=*{value}*]...\n\n 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.\n\n `$ curl localhost:8080/objects/object:0123456789abcdef/png`\n\n- __DELETE__ /admin/stop\n\n Stop the imagej-server gracefully without shutting down the imagej runtime.\n\n `curl -XDELETE localhost:8080/admin/stop`\n\n## Notes and memo\n\n- 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.\n- Ops that need to be initialized are not working when run as module. See the HACK in `ModulesResource`\n- The converters from `Number` to `NumericType` could be refined and considered moving to other projects such as SciJava.\n- 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\u003cInteger\u003e` could not be converted into `List\u003cIntType\u003e` even with converter between `Integer` and `IntType`).\n- What test framework should be used?\n- Might need to add logging/debug info\n- The module information should be improved. The inputs outputs names are not very informative.\n- 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?\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimagej%2Fimagej-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimagej%2Fimagej-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimagej%2Fimagej-server/lists"}