EVS/ALISA
Line 35: | Line 35: | ||
* A new SegmentationView will need to be created that handles selections and user events (mouse clicks and key presses) for the new editor. This view should be able to operate on the SegmentationModel class. | * A new SegmentationView will need to be created that handles selections and user events (mouse clicks and key presses) for the new editor. This view should be able to operate on the SegmentationModel class. | ||
− | In order to incorporate a new editing module into the Toolbar | + | In order to incorporate a new editing module into the Farsight we have two simple options: 1. Create a new menu item for the new editor and connect it to a new method to start the editor, 2. Read the top of the XML file to find out what type of result it contains and instantiage the correct SegmentationResult subclass. |
− | 1. | + | |
+ | To add a new editing tool to the Toolbar menu follow these steps:<br> | ||
+ | 1. Create a new QAction for starting the module.<br> | ||
+ | 2. Connect this QAction to an appropriate slot (LoadTraceResult).<br> | ||
+ | 3. Create the Slot (LoadTraceResult) - it will get the file name, create the model, and setup the views.<br> |
Revision as of 19:55, 7 May 2009
Contents |
Overview
The current linkage between views in Farsight (ALISA) that enables the PACE technology is implemented using QT's Model/View Architecture. The model classes: QStandardItemModel and QItemSelectionModel are enclosed in a SegmentationModel class which also handles event triggers. In the present implementation this model is taylored for use with nuclei.
The Segmentation Model can be created from Segmentation Result. The Segmentation Result class is an abstract class that handles reading/writing of object data from an XML file. This class should be extended to create specific methods for each object type - editing, feature calculation, and image data handling.
Location of Files
The relevent classes/files can be found in these locations:
- ftkSegmentationResult, ftkObject - farsight/trunk/SegmentationCommon
- ftkNuclearSegmentation - farsight/trunk/NuclearSegmentation
- SegmentationModel, SegmentationView - farsight/trunk/GUI
- example XML - farsight/trunk/NuclearSegmentation
Nucleus Example
The actual construction of the Segmentation Model - and setup of the Views is done in ControlBar (found in the GUI directory).
Refer to the loadResult method for an example of how this is done. This is the process:
1. Build NuclearSegmentation
- Here an instance of NuclearSegmentation is created and the object information is loaded from an XML file
2. Create SegmentationModel
- The SegmentationModel constructor requires a pointer to a SegmentationResult class (our NuclearSegmentation). The SegmenationModel class will convert the object feature information into a QStandardItemModel and construct a QItemSelectionModel.
3. Show Table and Scatter Views
- These require a pointer to the SegmentationModel
4. Create/Show Segmentation Window
- This window is specific to nuclei.
- Key press events within this view are connected to Triggers in the SegmentationModel using signals/slots.
- Requires a pointer to SegmentationModel and the data/label images to work correctly.
Adding a New Editor
In an ideal implementation the segmentation model would already have all of the information that the new editor needs and one would simply need to create a view that kept updated the selections appropriately. The current implementation is not yet at this stage - and therefore a few modifications and hacks will be required to glue in the new editing views. Here is a list of some of the modifications that may need to done:
- Methods in SegmentationResult should be made virtual to allow for editing operations to be accessed through this class for new object types.
- SegmentationModel should be modified to only call methods available in SegmentationResult (this will remove its dependency upon knowing the object type that it is representing). New event triggers will need to be added.
- A new SegmentationView will need to be created that handles selections and user events (mouse clicks and key presses) for the new editor. This view should be able to operate on the SegmentationModel class.
In order to incorporate a new editing module into the Farsight we have two simple options: 1. Create a new menu item for the new editor and connect it to a new method to start the editor, 2. Read the top of the XML file to find out what type of result it contains and instantiage the correct SegmentationResult subclass.
To add a new editing tool to the Toolbar menu follow these steps:
1. Create a new QAction for starting the module.
2. Connect this QAction to an appropriate slot (LoadTraceResult).
3. Create the Slot (LoadTraceResult) - it will get the file name, create the model, and setup the views.