Idea/rational:
- We already have REST infrastructure for our MITK Web feature set.
- Using this for a well defined REST-API to work with the data storage (locally) would be an easy was to offer better integration in other workflows (e.g. for a python/Matlab module that allows interaction with a data storage of a running MITK instance; as requested by our DLs to easily display and inspect there images)
The API could look something like
(: is indcating a variable in the url that must be replaced with the real value)
GET local/mitk/api1/datastorage
Returns the list of all node urls available in the storage
Possible parameters:
- ~scope: all (default), toplevel, ...
- :propertynames : only return the nodes/data with the given property and its value. (e.g. searching for all visible nodes with a certain name: GET local/mitk/api1/datastorage?name=cool_node&visible=true)
GET local/mitk/api1/datastorage/:node[/:subnode [..]]
Returns the data of the specified node. Depending on the requested type/content type only a URI/path is returned where to find the data, or the data is directly serialzed in the content of the message (e.g. the image packed in a nrrd and the nrrd is directly transfered).
GET local/mitk/api1/datastorage/:node[/:subnode [..]]/~children
Returns the list of URLs of all children nodes of a node (if existing).
Possible parameters:
- :propertynames : only return the nodes/data with the given property and its value. (e.g. searching for all visible nodes with a certain name: GET local/mitk/api1/datastorage?name=cool_node&visible=true)
GET local/mitk/api1/datastorage/:node[/:subnode [..]]/~property
Returns the list of URLs of all properties of the node.
Parameter:
- context: specifying the context/renderer (default: none/empty)
- scope: data|node (default node -> so all properties node and data)
GET local/mitk/api1/datastorage/:node[/:subnode [..]]/~property/:propertyname
Returns the value of a property
- context: specifying the context/renderer (default: none/empty)
- scope: data|node (default node -> so all properties node and data)
POST local/mitk/api1/datastorage
Transfers the content into the data storage as top level node. Depending on the content of the request (just a URI/filepath or realy the data itself) MITK will load it accordingly.
Returns the URL of the added node.
POST local/mitk/api1/datastorage/:node[/:subnode [..]]/~children
Transfers the content into the data storage and adds it as children to the specified node. Depending on the content of the request (just a URI/filepath or realy the data itself) MITK will load it accordingly.
Returns the URL of the added node.
PUT local/mitk/api1/datastorage/:node[/:subnode [..]]
Transfers the content into the indicated data node either creating it or replacing the data. Depending on the content of the request (just a URI/filepath or realy the data itself) MITK will load it accordingly.
PUT local/mitk/api1/datastorage/:node[/:subnode [..]]/~property/:property_name
Sets a given property to the value in the content.
Parameter:
- context: specifying the context/renderer (default: none/empty)
- scope: data|node (default node)
DELETE local/mitk/api1/datastorage/:node[/:subnode [..]]
Removes the given node
Feel free to alter/comment/refine...