Medical Imaging Interaction Toolkit  2018.4.99-cfdaacfc
Medical Imaging Interaction Toolkit
Adding a new view to a MITK Plugin

A plugin can bundle several views. If you want to extend an existing plugin, for example created as in How to create a new MITK Plugin, by an additional view, you only need to adapt a few files. This guide will give you a quick overview of what to do. We assume you are adding the view "Useful Functions View" and use default file names and locations (relative to your plugin folder root).

Files to add

For a basic view you will have to add the following files (assuming you do not share any icons or other resources):

  • src/internal/QmitkUsefulFunctionsView.h
  • src/internal/QmitkUsefulFunctionsView.cpp
    remember to set an id for your view
    const std::string QmitkUsefulFunctionsView::VIEW_ID = "org.mitk.views.usefulfunctions";
  • src/internal/QmitkUsefulFunctionsViewControls.ui
  • resources/UsefulFunctionsViewIcon.png
  • documentation/UserManual/QmitkUsefulFunctionsViewUserManual.dox
    Use your view id as page id to be found using the F1 help
    \page org_mitk_views_usefulfunctions The Useful Functions View

Files to change

The following files need to be adapted:

  • files.cmake
    • Add "src/internal/QmitkUsefulFunctionsView.cpp" to set(INTERNAL_CPP_FILES )
    • Add "src/internal/QmitkUsefulFunctionsViewControls.ui" to set(UI_FILES )
    • Add "src/internal/QmitkUsefulFunctionsView.h" to set(MOC_H_FILES )
    • Add "resources/UsefulFunctionsViewIcon.png" to set(CACHED_RESOURCE_FILES )
  • plugin.xml
    Add an extension point for your new view
    <extension point="org.blueberry.ui.views">
    <view id="org.mitk.views.usefulfunctions"
    name="Useful Functions"
    class="QmitkUsefulFunctionsView"
    icon="resources/UsefulFunctionsViewIcon.png" />
    </extension>