-
Notifications
You must be signed in to change notification settings - Fork 5
Adding an Output Format v1
John Hoffer edited this page Mar 9, 2017
·
1 revision
To add a new type of output that you want to support, add to _butterfly/webserver.py
in the block starting with the line if output_format ==
. As an example, the support for binary zipped data output is done as follows:
if output_format == 'zip' and not color:
#Rotate out of numpy array
volume = volume.transpose(1, 0, 2)
zipped_data = zlib.compress(volume.astype(out_dtype).tostring('F'))
output = StringIO.StringIO()
output.write(zipped_data)
content = output.getvalue()
content_type = 'application/octet-stream'
Simply:
- Set
content
= the converted data - Set
content_type = 'application/octect-stream'
for most packaged data formats (or the appropriate MIME type for images) - Check that color is supported, or create an exception
- Color segmentations returned from
get()
are 4D volumes [y, x, z, RGB] (as in [:,:,:,1] is the Green channel)
- Color segmentations returned from
No other additions or changes should be necessary.
-
Home
- API
- OCP
- Data Formats
- Developers
- Harvard RC Cluster
- Keywords
- Testing
- VM
- AccessLayer
- API
- OCP
- QueryLayer
- ImageLayer
- HDF5
- New Formats
- DatabaseLayer
- Mongo
- CoreLayer
- Core
- CacheSource
- CacheTile