Initial public release.
[OpenCLIPER] / docs / OpenCLIPER / docs / classes.md
1 # OpenCLIPER classes
2
3 ## Overview
4
5
6 <div style="text-align:center"><img src ="/class_diagram.png" alt="Simple class diagram of OpenCLIPER"/></div>
7
8 * *CLapp* is the main class of OpenCLIPER. It acts as an interface to the OpenCL device and, as such, stores information about the current OpenCL platforms and devices, their associated command queues and so on. It also contains the list of data objects to be processed in the computing device. *CLapp* also deals with memory management of the computing device, as well as with data transfers to/from it. Both OpenCL buffers and images are supported. While OpenCLIPER is designed to minimize data transfers between the host and the processing device (since it is a common cause for major bottlenecks), it automatically uses pinned memory/buffer mapping in order to achieve maximum performance.
9
10 * *Data* is an abstract class. Objects of its derived classes contain a set of images, volumes or n-dimensional data in the most general case. Each (derived from) *Data* object consists of one or more *NDArray* objects, which need not be equal in sizes or dimensions. This way, a single acquisition containing heterogeneous data may be stored in a single object. Data from an MRI scanner, for example, may contain K-space data, sensitivity maps, sampling masks, ECG signals, etc. Strides and positions for each element across any spatial or temporal dimension (row, column, slice, frame, etc.) are automatically calculated and made available to kernels in device memory space. Memory alignment is also dealt with, so that kernels can assume constant and predictable strides on every computing device.
11
12 * *Data* is meant to be specialized for the problem to be solved, so final implementations may contain as many as necessary data types, be them real (such as for echo or radiograph data) or complex (such as for K-space data from an MRI scanner). OpenCLIPER provides two general-purpose specializations out-of-the-box called *XData* (for data with a direct physical interpretation) and *KData* (for *K*-space data). Readers and writers are provided for the most commonly-used image formats (via the [DevIL](http://openil.sourceforge.net) library), as well as for Matlab's .mat format.
13
14 * *NDArray* represents a signal, image, volume or any n-dimensional data structure. It is defined as an abstract class because it does not know the specific (machine) data type in which data are stored. Thus, it is limited to common attributes and methods for all possible data types, and to creation of objects of the actual container class, which is *ConcreteNDArray*. This way, implementors of new *Data* specializations do not have to deal with the deep details of data storage and class coupling is kept to a minimum.
15
16 * *ConcreteNDArray* is a templated class which stores the actual data. It is not meant to be used by OpenCLIPER users but just to contain raw data and details which depend on the machine data type.
17
18 * *Process* is an interface to algorithms which process data. As such, it is an abstract class which developers should derive from to implement their own processes. Its purpose is to provide a standard front-end to algorithms, so that no prior knowledge about their internals is needed to start working with them. Processes can be cascaded one after another incurring in no performance penalty (cascading is zero-copy).
19
20 ## Detailed documentation
21
22 OpenCLIPER class documentation is maintained with doxygen, [here](/doxygen/html/index.html).