# areaDetector Plugin NDFileMagick

## October 7, 2014

## Mark Rivers

## University of Chicago

NDFileMagick inherits from NDPluginFile. This plugin saves data in any of the formats supported by the GraphicsMagick package. GraphicsMagick supports dozens of file formats, including TIFF, JPEG, PNG, PDF, and many others. GraphicsMagick automatically selects the output file format based on the extension of the file (.jpg=JPEG, .tif=TIFF, etc. The GraphicsMagick plugin should be able to write files in any format in the list of GraphicsMagick supported file formats" that has a "W" or "RW" in the Mode column.

The GraphicsMagick plugin is limited to 8 and 16-bit integer arrays. It supports color modes Mono and RGB1. NDFileMagick is limited to a single array per file, but capture and stream mode are supported by writing multiple files.

The GraphicsMagick plugin supports the Int32 parameter NDFileMagickCompressType to control the compression mode of the file. NDFileMagick.template defines 2 records to support this: $(P)$(R)CompressType (longout) and $(P)$(R)CompressType_RBV (longin). The following are the supported compression types:

- "None"
- "BZip"
- "FAX"
- "Group 4"
- "JPEG"
- "LZW"
- "RLE""
- "Zip"

No formats support all of these compression types. Many support only one, or have an implicit compression mode and so ignore the CompressType parameter. For example, the JPEG and PNG formats support only their respective implicit compression modes. I have determined empirically that the TIFF format supports "None", "JPEG", "LZW", and "ZIP", while the PDF format supports "None", "BZip", "FAX", and "JPEG".

The NDFileMagick class documentation describes this class in detail.

The NDFileMagick plugin is created with the NDFileMagickConfigure command, either from C/C++ or from the EPICS IOC shell.

    NDFileMagickConfigure(const char *portName, int queueSize, int blockingCallbacks,
                          const char *NDArrayPort, int NDArrayAddr, size_t maxMemory,
                          int priority, int stackSize)

For details on the meaning of the parameters to this function refer to the detailed documentation on the NDFileMagickConfigure function in the NDFileMagick.cpp documentation and in the documentation for the constructor for the NDFileMagick class.

### NDFileMagick.adl