The tutorials source code

This documentation section describes the tutorials CEP from CamiTK Community Edition, which contains a lot of simple examples.

Tutorials source code

The tutorials CEP is one of the CEP of CamiTK Community Edition. It contains some examples that could help you develop your own extension. You can find all the tutorial source code in the tutorials subdirectory of CamiTK Community Edition.

Here is a list of extensions, with a quick description of what they are demonstrating and where to find their source code.

Component extensions

Name What does it demonstrates? Source Code
mixed How to integrate an image (.mha) and a mesh (.vtk) together in a same top-level component tutorials/components/mixed
pickme (mesh) How to use pointPicked(..) and cellPicked(..) methods to interact directly with a component through picking tutorials/components/pickme
abort How CamiTK handle AbortException in a component constructor tutorials/components/abort

Action extensions

Name What does it demonstrates? Source Code
averagevoxelvalues (image) Compute the average voxels value in the neiborhoods of the currently selected voxel tutorials/actions/averagevoxelvalues
basicpicking (image and mesh) A basic picking demo extension. It contains two actions demonstrating one way to get information on mesh or images using picking (i.e., clicking on the object in the 2D/3D interactive viewer) tutorials/actions/basicpicking
hardcodedpipeline (misc) Demo how to apply/run two actions from another one using a hard-coded pipelines tutorials/actions/hardcodedpipeline
meshanimation (mesh) Demo how to “animate” a mesh (i.e., dynamically apply displacements to a mesh). Shows three ways of doing this: basic animation, with a timer and using an external library (see the shakerlib library) tutorials/actions/meshanimation
meshpointdata (mesh) Demo how to (programmatically) show/hide mesh point data using a color scale tutorials/actions/meshpointdata
properties (misc) Demo how to create various type of action parameters and manipulates component dynamic properties (for instance add some dynamic properties in an action) tutorials/actions/properties
selection (mesh) Demo how to work with the mesh selection tutorials/actions/selection
sleepingwhileworking (viewer and image) Demo how to directly manipulate the viewers to change the camera and selected slice in an 3D image (and pretend you are busily doing it yourself!) tutorials/actions/sleepingwhileworking
vtkwidget Demo how to add a VTK 3D widget in a viewer (a VTK widget is a type of interactor directly available in a 3D VTK renderer window). See also the advanced topic “Add VTKWidget to an action in CamiTK” tutorials/actions/vtkwidget

Viewer extensions

Name What does it demonstrates? Source Code
TextViewer Demo how to create new type of CamiTK viewer and integrate it in a CamiTK Application. The viewer is a really simple text viewer (it just send a text message everytime a component is read/close and gives information about current number of components) tutorials/viewers/textviewer
MixedViewer Demo how to create new type of CamiTK viewer and integrate it in a CamiTK Application. This viewer has two panels: on the left it shows the axial slice view and on the right the 3D view. It is linked with the mixed component extension tutorials/viewers/mixedviewer

Applications

Although application extensions are not what you should focus on when you start developing with CamiTK, there are still some examples in the tutorials CEP.

Name What does it demonstrates? Source Code
basic A simple (4 lines of code!) CamiTK application that consists only of a central axial viewer tutorials/applications/basic
fancy A fancy main window that have a different background and different viewer placement tutorials/applications/fancy
menubar A simple application with a main window that has a three items menu bar: a file menu (open, close, quit), an action menu (present the available action for the currently selected component), and a help menu (with a classic “about”). The most difficult part is to manage the “Action” menu (as it depends on the selection). The main window has also two viewers (component explorer and 3D viewer) tutorials/applications/menubar
objectcontroller Shows a simple object controller GUI (gives an idea of what is possible to do in CamiTK thanks to qtpropertybrowser) tutorials/applications/objectcontroller
simple A simple application that has no menubar, no toolbar and no statusbar. It demonstrates that an application can be a very classical 3D view and/or 4 viewers, with just a MedicalViewer as the main widget (note the default black background set to the 3D viewer) tutorials/applications/simple
testlogger An application that test all the CamiTK logger methods tutorials/applications/testlogger
testloggercrash An application that test all the CamiTK logger and its behaviour when somethings goes horribly wrong tutorials/applications/testloggercrash