Polybench® Reference

Image Storage Extension

Overview

The extension Image Writer enables you to save images from the image repository (link) of your application to disk, using the SEND_TO action (link).

Details

How to specify the image file name

To save an image from your application, use the SEND_TO action with the Image Extension, as follows:

Action: SEND_TO
Value: Image Writer > [$year$,*][$month$,*][$day$,*]_[$hour$,*][$minute$,*][$second$,*].[$alias$,*].jpg > optional alias
Address: $_IMAGES.MyImageName

The Value of the action tells the system to use the Image Writer extension. Behind the arrow (>) you define the file name, which can be a file name in text, or built from variables like in the example above. Then optionally another arrow may follow with the file alias name. The alias (link) is a short general name of the file. This is the name that is displayed in the data manager.

The default file alias that is used is the name of the image in the Image Repository. So, if you would use the following settings:

Action: SEND_TO
Value: Image Writer > Viewer 1.[$alias$,*].png
Address: $_IMAGES.Snapshot 1

then you will get an image with the file name Viewer 1.Snapshot 1.png, which is displayed in the Data Manager as Snapshot 1.
And these settings (in 2012):

Action: SEND_TO
Value: Image Writer > Image Of The Year $year$.Year images.gif
Address: $_IMAGES.Snapshot 1

lead to a GIF image file named Image Of The Year 2012.Year images.gif.

How to address an image in the Image Repository

The address should point to an image in the image repository. The image repository is addressed using $_IMAGES, followed by a dot and then the name of an image in the repository.

Where is the image stored

If the action is executed, then the image is stored in the current measurement, or if no measurement is currently open, in a new measurement for the current patient in the data manager.

Which image formats can be used

The Image Writer supports the following image formats:
- Joint Photographic Experts Group (JPEG); file ends with .jpg or .jpeg
- W3C Portable Network Graphics (PNG); file ends with .png
- Graphics Interchange Format (GIF); file ends with .gif
- Bitmap (BMP); file ends with .bmp
- Enhanced metafile (EMF); file ends with .emf
- Tagged Image File Format (TIFF); file ends with .tif or .tiff

So depending on the file extension you use in the Value property, the image format is chosen.

How to make a picture of a signal viewer and save it to the measurement

To do this, you need two actions. You may want to use an action sequence (link) to execute both actions in one call.

1. Execute the SNAPSHOT action (see link for more information) to make a picture of a viewer and specify that the image is stored in the Image Repository.

2. Execute the SEND_TO action for the image in the repository, like described above.