| 1 | = Software Architecture = |
| 2 | |
| 3 | The UFO software framework is a set of building blocks to easily create image processing applications with high-speed demands. Its source code resides in a public [wiki:infrastructure_rcs Bazaar repository] and documentation is available under the [http://ufo.kit.edu/ufo/doxygen/ API] link. On source level, it is conceptually divided into |
| 4 | |
| 5 | * the core library ''libufocore'' in `ufo-core`, |
| 6 | * bindings to other dynamic languages in `ufo-bindings` and |
| 7 | * concrete applications in `ufo-tools` |
| 8 | |
| 9 | The core library provides an object-oriented API based on the platform-independent libraries [http://library.gnome.org/devel/glib/ GLib] and [http://library.gnome.org/devel/gobject/stable/ GObject]. |
| 10 | |
| 11 | == Specifications and Requirements == |
| 12 | |
| 13 | If the following requirements are met, the API can be declared reasonably stable and applications can build upon the public interfaces: |
| 14 | |
| 15 | * Object-oriented interface implemented in C |
| 16 | * Language bindings to at least Python |
| 17 | * Loads TIFF, EDF and raw data formats |
| 18 | * Base image type consists of single-channel (grey values), single precision, 32-bit floating point pixels |
| 19 | * Multi-threaded |
| 20 | * GPU-capable |
| 21 | * As light and fast as possible |
| 22 | |
| 23 | Furthermore, the core library must provide the following basic algorithms |
| 24 | |
| 25 | * Point operations |
| 26 | * Basic math |
| 27 | * Tomography-related |
| 28 | * FFT |
| 29 | * Filtering |
| 30 | * Back-projection |
| 31 | |
| 32 | == Design == |
| 33 | |
| 34 | The most basic abstractions are |
| 35 | |
| 36 | * Filters that act on data and |
| 37 | * Buffers representing data with all its associated meta data. |
| 38 | |
| 39 | A ''Buffer'' hides all details about memory management (be it CPU host memory or GPU memory) and provides a common interface for querying meta data and a pointer to the raw data. The meta data must include |
| 40 | |
| 41 | * number of dimensions, |
| 42 | * length of each dimension, |
| 43 | * size in bytes of each element and |
| 44 | * a flag if a valid GPU representation is available. |
| 45 | |
| 46 | and could include meta data like |
| 47 | |
| 48 | * what kind of special image type (sinograms, images in frequency domain etc.) it is, |
| 49 | * mutex(es) for shared access of threads, |
| 50 | * alignment and |
| 51 | * associated file name and type. |
| 52 | |
| 53 | A ''Filter'' accepts zero (then acting as a ''source'') or more input Buffers, computes on the Buffer's data and places the result in zero (acting as a ''sink'') or more output Buffers. When the result is ready, it notifies all connected outgoing Filters which take their input from the respective output. |
| 54 | |
| 55 | An ubiquitous scheduler sets up the threading system and connected hardware accelerators like GPUs. As this is the only instance that knows where Filters can run, it should decide if a Filter should run on the GPU by inspecting the chain of computation. Furthermore, if a Filter does not need to work on a whole buffer (that means data is separable), the scheduler might also split the Filter by creating two or more instances and provide them with split data. |