Personal tools
  • We're Hiring!

You are here: Home Documentation Previous versions OME Server Developer Image Server MATLAB File-format

MATLAB File-format

MATLAB OMEIS File-format

Typically imread, imwrite, and imfinfo are the functions used in MATLAB scripts to read and write images. These functions are provided by MathWorks with the Image Processing Toolkit and support a wide variety of image formats.

imformats maintains a registry of file formats and their relevant functions. This makes it possible to easily expand the image formats natively supported by MATLAB.

We have defined a MATLAB OMEIS file-format. The first 12 character are the magic string #OMEIS-LOCAL, the second string specifies the URL, and the third string specifies the PixelsID.

#OMEIS-LOCAL
http://localhost/cgi-bin/omeis
PixelsID=4

To add the OMEIS-LOCAL file-format to the list of file-formats supported by MATLAB, you must first execute the following commands at the MATLAB command-prompt (every time you start MATLAB). An alternative more convenient solution is to add the commands to your startup.m which is either in your home directory or MATLAB root. startup.m is always called when MATLAB first starts up.

omeis.ext  = 'omeis';
omeis.isa  = 'isOMEIS'
omeis.info = 'imOMEIS'
omeis.read = 'readOMEIS';
omeis.write = 'writeOMEIS'
omeis.alpha = 0;
omeis.description = 'Reading/Writing pixels directly to OMEIS'
imformats('add', omeis)

All files that begin with the OMEIS-LOCAL magic-string (i.e. regardless of file-name extension) can be read.

im = imread('im.omeis');

When using imwrite you must specify the file extension. Otherwise the intended format of the resulting file is ambiguous.

imwrite(im, 'im.omeis', 'url', 'http://localhost/cgi-bin/omeis');

The advent of the OMEIS-LOCAL file format means all MATLAB functions (including compiled proprietary MEX files) that use filenames work, without alteration, with OMEIS.

Document Actions