diff --git a/Documentation/Doxygen/Tutorial/Step01.dox b/Documentation/Doxygen/Tutorial/Step01.dox index 96c5b83b59..5c91223dea 100644 --- a/Documentation/Doxygen/Tutorial/Step01.dox +++ b/Documentation/Doxygen/Tutorial/Step01.dox @@ -1,20 +1,22 @@ /** \page Step01Page MITK Tutorial - Step 1: Displaying an image \image html step1_result.png + +Open the Tutorial by executing StartVS_release.bat. All steps can be found among the listed projects. The first program shows how to display an image in a 2D view. The picture above is a snapshot of the program. -The program has to be executed using the image file mitk/Core/Code/Testing/Data/Pic3D.pic.gz. +The program has to be executed using the image file bin/CMakeExternals/Source/MITK-Data/Pic3D.nrrd. To set the image file path in Visual Studio, right click on "Step1"-project and go to 'Properties -> Configuration Properties -> Debugging'. Now insert the image file path in the "Command Arguments" text field. Use this also in the following steps. \image html configureVisualStudioProperties.png The code is subdivided in parts I - V. First of all a DataTree has to be created. Then data has to be read from a file which afterwards has to be put into the tree. Part IV creates a window and passes the tree to it. The last part deals with some Qt-specific initialization. \include Step1.cpp \ref Step00Page "[Previous step]" \ref Step02Page "[Next step]" \ref TutorialPage "[Main tutorial page]" */ diff --git a/Documentation/Doxygen/Tutorial/Step02.dox b/Documentation/Doxygen/Tutorial/Step02.dox index 289a2e0d88..50119d96ac 100644 --- a/Documentation/Doxygen/Tutorial/Step02.dox +++ b/Documentation/Doxygen/Tutorial/Step02.dox @@ -1,30 +1,30 @@ /** \page Step02Page MITK Tutorial - Step 2: Load one or more data sets \image html step2_result.png \li \ref Step2.cpp "Step2.cpp" \n Contains the code for this example. \dontinclude Step2.cpp This program shows how to load multiple data sets. A DataNodeFactory is used to produce nodes containing the data. The picture above shows the result of the program when reading both the image file and the surface file. - In order to obtain the result the program has to be executed using the image file mitk/Core/Code/Testing/Data/Pic3D.pic.gz and the surface file mitk/Modules/MITKExt/Testing/Data/lungs.vtk. + In order to obtain the result the program has to be executed using the image file bin/CMakeExternals/Source/MITK-Data/Pic3D.nrrd and the surface file src/MITK/Modules/MitkExt/Testing/Data/lungs.vtk. The code for this example equals the code of Step 1 except for part II and part III that are changed as follows: \skipline Part II \until exit(2) \line } \line } \ref Step01Page "[Previous step]" \ref Step03Page "[Next step]" \ref TutorialPage "[Main tutorial page]" */ diff --git a/Documentation/Doxygen/Tutorial/Step03.dox b/Documentation/Doxygen/Tutorial/Step03.dox index 5ed0186f90..a298a0e11f 100644 --- a/Documentation/Doxygen/Tutorial/Step03.dox +++ b/Documentation/Doxygen/Tutorial/Step03.dox @@ -1,48 +1,48 @@ /** \page Step03Page MITK Tutorial - Step 3: Create 3D view As in the previous step one or more data sets (many images, surface and other formats) may be loaded. The difference is that they are displayed in a 3D view. The QmitkRenderWindow is now used for displaying a 3D view, by setting the used mapper-slot to Standard3D. Since volume-rendering is a (rather) slow procedure, the default is that images are not displayed in the 3D view. In Step 3a the default is kept whereas in Step 3b volume rendering is turned on. -As in the previous step, to obtain the results the program has to be executed using the image file mitk/Core/Code/Testing/Data/Pic3D.pic.gz and the surface file mitk/Modules/MITKExt/Testing/Data/lungs.vtk. +As in the previous step, to obtain the result the program has to be executed using the image file bin/CMakeExternals/Source/MITK-Data/Pic3D.nrrd and the surface file src/MITK/Modules/MitkExt/Testing/Data/lungs.vtk. \li \ref Step3.cpp "Step3.cpp" \n Contains the code that both creates a 3D view and turns volume rendering on. \section Step3aSection Step 3a - Volume rendering turned off \image html step3a_result.png \dontinclude Step3.cpp Tell the renderer to create a 3D view: \skipline // Use it as a 3D view! \skipline renderWindow.GetRenderer()->SetMapperID The rest of the code remains unchanged. The picture above shows the result of the program when reading both the image and the surface file. As volume rendering is off the image is not visible. \section Step3bSection Step 3b - Volume rendering turned on \image html step3b_result.png Volume Rendering is now turned on as shown in the picture above. \dontinclude Step3.cpp The property "volumerendering" has to be turned on on the node containing the image. \skipline Check \until node->SetProperty \ref Step02Page "[Previous step]" \ref Step04Page "[Next step]" \ref TutorialPage "[Main tutorial page]" */ diff --git a/Documentation/Doxygen/Tutorial/Step04.dox b/Documentation/Doxygen/Tutorial/Step04.dox index a8a44a2eaf..1e830fa813 100644 --- a/Documentation/Doxygen/Tutorial/Step04.dox +++ b/Documentation/Doxygen/Tutorial/Step04.dox @@ -1,66 +1,66 @@ /** \page Step04Page MITK Tutorial - Step 4: Use several views to explore data As in Step 2 and Step 3 one or more data sets may be loaded. Now 3 views on the data are created. The QmitkRenderWindow is used for displaying a 3D view as in Step 3, but without volume-rendering. Furthermore two 2D views for slicing through the data are created. The class QmitkSliceWidget is used, which is based on the class QmitkRenderWindow, but additionally provides sliders to slice through the data. We create two instances of QmitkSliceWidget, one for transversal and one for sagittal slicing. Step 4b enhances the program in that the two slices are also shown at their correct position in 3D as well as intersection-line, each in the other 2D view. -As in the previous steps, to obtain the results the program has to be executed using the image file mitk/Core/Code/Testing/Data/Pic3D.pic.gz and the surface file mitk/Modules/MITKExt/Testing/Data/lungs.vtk. +As in the previous steps, to obtain the result the program has to be executed using the image file bin/CMakeExternals/Source/MITK-Data/Pic3D.nrrd and the surface file src/MITK/Modules/MitkExt/Testing/Data/lungs.vtk. \li \ref Step4.cpp "Step4.cpp"\n Contains the code of step 4a + b. \section Step4aSection Step 4a - Create transversal and sagittal view \image html step4a_result.png \dontinclude Step4.cpp Create a Qt horizontal box for the layout: \skipline QHBox Then create a renderwindow: \skipline QmitkRenderWindow \until SetMapperID Create a 2D view for slicing transversally: \skipline view2 \until view2.SetData Then create a 2D view for slicing sagitally. \skipline view3 \until view3.SetData The toplevelWidget is now the new main widget: \skipline qtapplication \skipline toplevelWidget.show \section Step4bSection Step 4b - Display slice positions \image html step4b_result.png We now want to see the position of the slice in 2D and the slice itself in 3D. Therefore it has to be added to the tree: \dontinclude Step4.cpp \skipline ds->Add(view2.GetRenderer() \skipline ds->Add(view3.GetRenderer() Slice positions are now displayed as can be seen in the picture. \dontinclude Step4.cpp \ref Step03Page "[Previous step]" \ref Step05Page "[Next step]" \ref TutorialPage "[Main tutorial page]" */ diff --git a/Documentation/Doxygen/Tutorial/Step06.dox b/Documentation/Doxygen/Tutorial/Step06.dox index 6b3364d25d..0088a09619 100644 --- a/Documentation/Doxygen/Tutorial/Step06.dox +++ b/Documentation/Doxygen/Tutorial/Step06.dox @@ -1,112 +1,112 @@ /** \page Step06Page MITK Tutorial - Step 6: Use an interactive region-grower In this step the program is enhanced by the possibility to start a region-grower at interactively added points. We will see how MITK images can be accessed as ITK images. -We now load the image file only (mitk/Core/Code/Testing/Data/Pic3D.pic.gz) since the surface will be the result of the region-growing. +We now load the image file only (bin/CMakeExternals/Source/MITK-Data/Pic3D.nrrd) since the surface will be the result of the region-growing. \image html step6_result.png The source is now split among several files: \li \ref Step6.cpp "Step6.cpp" \li \ref Step6.h "Step6.h" \li \ref Step6RegionGrowing.txx "Step6RegionGrowing.txx" \li \ref Step6RegionGrowing1.cpp "Step6RegionGrowing1.cpp" \li \ref Step6RegionGrowing2.cpp "Step6RegionGrowing2.cpp" \li \ref Step6main.cpp "Step6main.cpp" The class Step6 inherits from QMainWindow and provides methods for setting up the widgets. Step6RegionGrowing.cpp contains a method for performing the region-growing. Step6main.cpp contains main. Like in ITK and VTK class member names start with m_ followed by the proper member name starting with a capital letter (e.g. m_Tree). Function names start with capital letters. To learn more about style conventions in MITK read \ref StylesAndNotesPage "The MITK Style Guide". \dontinclude Step6.cpp The widgets are initialized as in the previous steps but with an additional QVBox for a button to start the segmentation: \skipline Create controlsParent \until hlayout->addWidget(m_LineEditThresholdMax) Then a button is created to start the segmentation and its clicked() signal is connected to the method StartRegionGrowing(): \dontinclude Step6.cpp \skipline QPushButton* startButton \skipline connect(startButton \section AccessMTIKImagesAsITKImagesSection Access MITK images as ITK images ITK images are templated whereas mitk::Images are not. To use ITK filters with MITK images, we have to convert From MITK to ITK. To do so, first define an access method, which is templated as an ITK image is: \code template MyAccessMethod(itk::Image* itkImage) { ... } \endcode If you don't understand this template syntax, you should read any C++ text book. Understanding template syntax is crucial to successfully using ITK. To call this templated method with an (untemplated) mitk::Image, you can use the AccessByItk macro from mitkImageAccessByItk.h. This macro checks for the actual image type of the mitk::Image and does any neccessary conversions. Look into "Modules / Adaptor classes" for more information. \code AccessByItk(mitkImage, MyAccessMethod) \endcode \dontinclude Step6RegionGrowing.txx In this step our access method is called RegionGrowing() (defined in \ref Step6RegionGrowing.txx "Step6RegionGrowing.txx"): \skipline template \until } \until } Additionally the access function has to be instantiated for all datatypes and two/three dimensions as some compilers have memory problems without this explicit instantiation, some even need instantiations in separate files for 2D/3D: \n For 2D in \ref Step6RegionGrowing1.cpp "Step6RegionGrowing1.cpp" : \dontinclude Step6RegionGrowing1.cpp \skipline InstantiateAccessFunctionForFixedDimension_1 ... and for 3D in \ref Step6RegionGrowing2.cpp "Step6RegionGrowing2.cpp": \dontinclude Step6RegionGrowing2.cpp \skipline InstantiateAccessFunctionForFixedDimension_1 \dontinclude Step6.cpp The method StartRegionGrowing() finally calls our access method RegionGrowing(): \skipline Step6::StartRegionGrowing \until } \section ConvertingITKMITKSection Converting ITK images to MITK images and vice versa In some cases it is useful to simply convert between ITK and MITK images. The direction ITK to MITK is easy, since mitk::Image can handle most data types. The direction MITK to ITK is more critical, since ITK images have to be instantiated with a fixed pixel type and fixed dimension at compile time. \li \code mitk::Image mitk::ImportItkImage(itk::Image<...>) \endcode \li \code mitk::CastToItkImage(mitkImage, itk::Image<...>) \endcode \section ConnectingMITKToVTKSection Connecting MITK images to VTK Images are not converted or copied: The data array is just accessed via an encapsulating VTK object. \li \code vtkImageData* mitk::Image::GetVtkImageData(int time = 0) \endcode \section SurfacesMITKToVTKSection MITK Surfaces to VTK and vice versa Again: not a conversion, just accessing. \li \code vtkPolyData* mitk::Surface::GetVtkPolyData(int time = 0) \endcode \li \code mitk::Surface::SetVtkPolyData(vtkPolyData*, int time = 0) \endcode \ref Step05Page "[Previous step]" \ref Step07Page "[Next step]" \ref TutorialPage "[Main tutorial page]" */ diff --git a/Documentation/Doxygen/Tutorial/Tutorial.dox b/Documentation/Doxygen/Tutorial/Tutorial.dox index 224705cbaa..77087f8b91 100644 --- a/Documentation/Doxygen/Tutorial/Tutorial.dox +++ b/Documentation/Doxygen/Tutorial/Tutorial.dox @@ -1,34 +1,34 @@ /** \page TutorialPage The MITK Tutorial This tutorial gives an introduction to MITK. We will start with the first steps of just compiling what you get after downloading MITK, continue to show how to display and do basic interaction with images, and finally show how to build an application module (functionality). The source code of the examples can be found in mitk/QApplications/Tutorial/ \n -Two data files are used to execute the example code. They are located in mitk/Core/Code/Testing/Data/ +Two data files are used to execute the example code. -\li Pic3D.pic.gz \n -This file contains an image. +\li Pic3D.nrrd \n +This file contains an image and is located in bin/CMakeExternals/Source/MITK-Data/Pic3D.nrrd. \li lungs.vtk \n -This file contains a surface. +This file contains a surface and is located in src/MITK/Modules/MitkExt/Testing/Data/lungs.vtk. \section TutorialSection Tutorial chapters \li \subpage Step00Page "Step 0: Getting started" \li \subpage Step01Page "Step 1: Displaying an image" \li \subpage Step02Page "Step 2: Load one or more data sets" \li \subpage Step03Page "Step 3: Create 3D view" \li \subpage Step04Page "Step 4: Use several views to explore data" \li \subpage Step05Page "Step 5: Interactively add points" \li \subpage Step06Page "Step 6: Use an interactive region-grower" \li \subpage Step07Page "Step 7: Convert result of region growing into a surface" \li \subpage Step08Page "Step 8: Use QmitkStdMultiWidget as widget" \li \subpage Step09Page "Step 9: A functionality" \li \subpage Step10Page "Step 10: A new Interaction" Enjoy MITK! */