Running DAWN as a web server

To run DAWN as a web server:


Start DAWN with the arguments:

dawn -noSplash -application org.eclipse.dawnsci.remotedataset.server.dataServer -port XXXX

where XXXX is the port number.

Once started, JPG images can be created buy contructing URLs containing the path, dataset name, format and sub-slice of data to view

http://localhost:XXXX/slice/?path=/dls/science/groups/das/ExampleData/i12/pixi_00001.tif&dataset=image-01&format=JPG&slice=[0:100,0:100]


Here is the doc from the SliceRequest class, it gives further info on the parameters the request takes.

/**
* There are one of these objects per session.
*
* So a user only blocks their own session if they
* do an unfriendly slice.
*
* Parameters which may be set in the request:
* Essential
* =========
* path` - path to file or directory for loader factory to use.
*
* Optional
* ========
* dataset - dataset name, by default the dataset at position 0 will be returned
*
* slice` - Provides the slice in the form of that required org.eclipse.dawnsci.analysis.api.dataset.Slice.convertFromString(...)
* for example: [0,:1024,:1024]. If left unset and data not too large, will send while dataset, no slice.
*
* bin` - downsample As in Downsample.encode(...) / Downsample.decode(...) ; examples: 'MEAN:2x3', 'MAXIMUM:2x2'
* by default no downsampling is done
*
* format` - One of Format.values():
* DATA - Serialized slice, binary (default)
* JPG - JPG made using IImageService to make the image
* PNG - PNG made using IImageService to make the image
* MJPG:<dim> e.g. MJPG:0 to send the first dimension as slices in a series. NOTE slice mist be set in this case.
* MDATA:<dim> e.g. MDATA:0 to send the first dimension as slices in a series as IDatasets. NOTE slice mist be set in this case.
*
* histo` - Encoding of histo to the rules of ImageServiceBean.encode(...) / ImageServiceBean.decode(...)
* Example: "MEAN", "OUTLIER_VALUES:5-95"
* Only used when an actual image is requested.
*
* sleep - Time to sleep between sending images, default 100ms.
*
* `URL encoded.
*
*
* * Example in GET format (POST is also ok):
*
* http://localhost:8080/slice/?path=c%3A/Work/results/TomographyDataSet.hdf5&dataset=/entry/exchange/data&slice=[0,%3A1024,%3A1024]
*
* Or in a browser:
* http://localhost:8080/slice/?path=c%3A/Work/results/TomographyDataSet.hdf5&dataset=/entry/exchange/data&slice=[0,%3A1024,%3A1024]&bin=MAXIMUM:2x2&format=JPG
* http://localhost:8080/slice/?path=c%3A/Work/results/TomographyDataSet.hdf5&dataset=/entry/exchange/data&slice=[0,%3A1024,%3A1024]&bin=MAXIMUM:2x2&format=MJPG:0