Skip to content

Project Code Structure

josefkoller edited this page Dec 2, 2016 · 8 revisions

Bug Reporting, Feature Requests

Please add an entry on the Issues page with a detailed description (steps to reproduce, branch, problem description, solution...)

Terminal Programs

The folder terminal_programs contains code for fast programs without any graphical user interface.

Ambient Image Processor

The core class is ImageWidget. It combines all modules. Two instances (one for the input and one for the output image) are created in the MainWindow.

Howto: Add a module

  1. Create a folder in the modules directory
  2. Add a CMakeLists.txt file which appends code files to the following variables:
  • SOURCE_H_FILES
  • SOURCE_CPP_FILES
  • CUDA_CPP_FILES
  1. Add this file to the root CMakeLists.txt file
  2. Register the module in ImageWidget.cpp

BaseModule

If your module does not need an entry in the menu and the tabview, derive it from BaseModule. For example the Crosshair-module just outputs the voxel intensity under the cursor and writes it to the status bar. Modules usually overwrite the registerModule-function and connect to predefined Qt-signals. Such signals are:

  • imageChanged
  • mouseMoveOnImage,mousePressedOnImage, mouseReleasedOnImage, mouseWheelOnImage
  • pixmapPainted
  • sliceIndexChanged

BaseModuleWidget

Such modules overwrite the processImage-function and call processInWorkerThread for example if a button is pressed. This superclass takes care of the worker thread, gets the input image from the input-ImageWidget instance and writes the resulting image to the output-ImageWidget. Furthermore it takes care of error logging and runtime measurement.

Modules usually implement their GUI in the Widget and the image operations in a Processor class. In general if you want to add a new module, it is highly recommended to take a look at similar ones.

Examples