Source Code Structure
Notice: All information bellow is related to InVesalius 3. There is no technical documentation related to previous InVesalius versions.
In order to support collaborative development, the following minimal documentation about the source code has been written. If you're new to InVesalius source-code, we recommend you to read DevelGuideline.
1. Packages and modules
invesalius/ __init__.py invesalius.py control.py project.py utils.py gui/ __init__.py frame.py content_panel.py tasks_panel.py tasks/ __init__.py importer_panel.py generic_panel.py exporter_panel.py slice_panel.py surface_panel.py exporter_panel.py tools_panel.py data_panel.py data_notebook.py widgets/ __init__.py gradient.py listctrl.py dialogs/ __init__.py saveas.py error.py warning.py save.py data/ __init__.py slice.py slice_mask.py slice_viewer.py volume_viewer.py volume_raycasting.py volume_surface.py styles.py reader/ __init__.py dicom_reader.py dicom_parser.py dicom_group.py analyze_reader.py
Figure 1. InVesalius packages and modules structure (last updated 19/01/2009)
Nearly all wxPython and GUI (Graphical User Interface) related modules and classes should be defined inside gui and its sub-folders (tasks, widgets and dialogs). There are two exceptions to these rules.
First exception consists in classes which contain both wxPython and VTK related-to code, such as instances or derived classes of wxVTKRenderWindowInteractor and wxVTKRenderWindow. These classes are defined inside data package, and are defined inside volume_viwer.py and slice_viewer.py.
The second exception is a wx.App derivation, related to the GUI initialization. The related module (invesalius.py) is defined inside InVesalius' top-level package (invesalius).
Regarding other VTK associated modules and classes, most were inserted inside data package.
All modules and classes associated to reading external data (e.g. DICOM or Analyze files) were inserted into reader package. In future, this might be inserted into data package.
2. Design patterns
2.1. Model Viewer-Controller (MVC)