Accessing and manipulating options/parameters is central to every application. The Options interface provides methods to interact and manipulate parameters and options generic way in ReconstructMe API.

Basic Options Handling

The reme_options_t represents a generic options handle. Once created it is said to be empty, as it does not represent any specific options. In order to manipulate specific options, you need to bind it to a specific options using a specific function that usually carries bind in its function name. The page Options Bindings lists all known binders. Each binder documents the available parameters in the method's detail section using Google Protocol Buffer format.

Following is an example to adjust reconstruction settings which contain settings for the volume, the resolution and specific algorithm parameters. See reme_context_bind_reconstruction_options for details.

First create context. This will initialize the reconstruction options with sensible default values.

Think about the binding as a pointer to the internal options set. Every action we take on the options object reflects directly to the internal options set and as such influences the outcome of reme_context_compile.

Typesafe Options Handling

All the above examples had in common that they were using a lazy-reflection based API through strings. ReconstructMe API allows you to use an alternative, type-safe approach using Google Protocol Buffers directly.

Using Google Protocol Buffers directly you can compile a getter/setter object for the programming language of your choice and use the built-in serialization mechanism to get a nice way to interop between your programming language and ReconstructMe API. Such compilers exist for all modern languanges such as C, C++, Java and .NET. See https://developers.google.com/protocol-buffers/ for details.

Here's an example of the type safe approach in C++ using the compile settings. It requires the generation of the class poisson_options through the use of protoc which ships with Google Protocol Buffers. The compiler protoc is invoked with the protocol buffer description (see reme_surface_bind_poisson_options) and it produces header and source files containing the class poisson_options. This class can then be used in your project.

To transfer the state of poisson_options to our reme_options_t we can use the built-in serialization mechnisms. This allows us to effectively serialize/deserialize option objects from string like buffers.

// In order to supply it to ReconstructMe SDK we use the built-in serialization mechanism.