<div dir="ltr">Hello ,<div><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"> I saw your video entitled "CT Data visualization", I work in the same environment (visual studio 9, VTK, ITK and qt for GUI)</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">I am a beginner in VTK and ITK and Qt, so for the moment I am trying to read a DICOM series with ITK and display it with VTK into QVTKWidget.</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">First, I was able to view the DICOM series with ITK and VTK, but without Qt.</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">Then, when I wanted to view the DICOM series with QVTKWidget, the program crashes.</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">Then, I tried to read the DICOM series with VTK without ITK and display it into QVTKWidget to locate the problem and it works.</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">so there may be a problem with ITK pointer, sincerely I do not know what the problem, I tried with all methods but the program still crashes. I took for your help if you have an idea about this problem.</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">here is my code:</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">************************************************************************</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include "essaieappqtvtk.h"</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include <vtkSmartPointer.h></span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include <vtkObjectFactory.h></span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include <vtkRenderWindow.h></span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include <vtkRenderWindowInteractor.h></span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include <vtkRenderer.h></span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include <vtkActor.h></span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// headers needed for this example</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include <vtkImageViewer2.h></span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include <vtkDICOMImageReader.h></span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include <vtkInteractorStyleImage.h></span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include <vtkActor2D.h></span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include <vtkTextProperty.h></span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include <vtkTextMapper.h></span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include "itkImage.h"</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include "itkImageFileReader.h"</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include "itkCurvatureFlowImageFilter.h"</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include "itkRescaleIntensityImageFilter.h"</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include "itkGDCMImageIO.h"</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include "itkVTKImageExport.h"</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include "itkVTKImageImport.h"</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include "vtkImageImport.h"</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include "vtkImageExport.h"</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include "vtkRenderWindow.h"</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include "vtkImageActor.h"</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include "vtkImageData.h"</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include "itkGDCMImageIO.h"</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include "itkGDCMSeriesFileNames.h"</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include "itkImageSeriesReader.h"</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include "itkImageFileWriter.h"</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include "vtkImageShiftScale.h"</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">//#include "vtkKWImageIO.h"</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">//#include "vtkKWImage.h"</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// needed to easily convert int to std::string</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include <sstream></span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">using namespace std; </span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include <QFileDialog></span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include <QString></span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include <QMessageBox></span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include <QFile></span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include "vtkKWImageIO.h"</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">#include "vtkKWImage.h"</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">using namespace std; </span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">class StatusMessage {</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">public:</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">static std::string Format(int slice, int maxSlice) {</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">std::stringstream tmp;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">tmp << "Slice Number " << slice + 1 << "/" << maxSlice + 1;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">return tmp.str();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">};</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// Define own interaction style</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">class myVtkInteractorStyleImage : public vtkInteractorStyleImage</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">{</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">public:</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">static myVtkInteractorStyleImage* New();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">vtkTypeMacro(myVtkInteractorStyleImage, vtkInteractorStyleImage);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">protected:</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">vtkImageViewer2* _ImageViewer;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">vtkTextMapper* _StatusMapper;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">int _Slice;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">int _MinSlice;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">int _MaxSlice;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">public:</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">void SetImageViewer(vtkImageViewer2* imageViewer) {</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">this->_ImageViewer = imageViewer;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">_MinSlice = imageViewer->GetSliceMin();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">_MaxSlice = imageViewer->GetSliceMax();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">_Slice = _MinSlice;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">cout << "Slicer: Min = " << _MinSlice << ", Max = " << _MaxSlice << std::endl;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">void SetStatusMapper(vtkTextMapper* statusMapper) {</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">_StatusMapper = statusMapper;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">protected:</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">void MoveSliceForward() {</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">if(_Slice < _MaxSlice) {</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">_Slice += 1;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">cout << "MoveSliceForward::Slice = " << _Slice << std::endl;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">this->_ImageViewer->SetSlice(_Slice);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">std::string msg = StatusMessage::Format(_Slice, _MaxSlice);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">_StatusMapper->SetInput(msg.c_str());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">_ImageViewer->Render();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">void MoveSliceBackward() {</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">if(_Slice > _MinSlice) {</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">_Slice -= 1;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">cout << "MoveSliceBackward::Slice = " << _Slice << std::endl;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">this->_ImageViewer->SetSlice(_Slice);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">std::string msg = StatusMessage::Format(_Slice, _MaxSlice);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">_StatusMapper->SetInput(msg.c_str());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">_ImageViewer->Render();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">virtual void OnKeyDown() {</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">std::string key = this->GetInteractor()->GetKeySym();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">if(key.compare("Up") == 0) {</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">//cout << "Up arrow key was pressed." << endl;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">MoveSliceForward();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">else if(key.compare("Down") == 0) {</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">//cout << "Down arrow key was pressed." << endl;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">MoveSliceBackward();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// forward event</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">vtkInteractorStyleImage::OnKeyDown();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">virtual void OnMouseWheelForward() {</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">//std::cout << "Scrolled mouse wheel forward." << std::endl;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">MoveSliceForward();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// don't forward events, otherwise the image will be zoomed </span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// in case another interactorstyle is used (e.g. trackballstyle, ...)</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// vtkInteractorStyleImage::OnMouseWheelForward();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">virtual void OnMouseWheelBackward() {</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">//std::cout << "Scrolled mouse wheel backward." << std::endl;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">if(_Slice > _MinSlice) {</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">MoveSliceBackward();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// don't forward events, otherwise the image will be zoomed </span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// in case another interactorstyle is used (e.g. trackballstyle, ...)</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// vtkInteractorStyleImage::OnMouseWheelBackward();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">};</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">vtkStandardNewMacro(myVtkInteractorStyleImage);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">/**</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">* This will be setup as a callback for a progress event on an ITK</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">* filter.</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">*/</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">struct ProgressDisplay</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">{</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">ProgressDisplay(itk::ProcessObject* process): m_Process(process) {}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">void Display()</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">{</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">float progress = m_Process->GetProgress()*100.0;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">std::cout << "Progress " << progress << " percent." << std::endl;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">itk::ProcessObject::Pointer m_Process;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">};</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">template <typename ITK_Exporter, typename VTK_Importer></span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">void ConnectPipelines(ITK_Exporter exporter, VTK_Importer* importer)</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">{</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->SetUpdateInformationCallback(exporter->GetUpdateInformationCallback());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->SetPipelineModifiedCallback(exporter->GetPipelineModifiedCallback());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->SetWholeExtentCallback(exporter->GetWholeExtentCallback());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->SetSpacingCallback(exporter->GetSpacingCallback());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->SetOriginCallback(exporter->GetOriginCallback());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->SetScalarTypeCallback(exporter->GetScalarTypeCallback());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->SetNumberOfComponentsCallback(exporter->GetNumberOfComponentsCallback());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->SetPropagateUpdateExtentCallback(exporter->GetPropagateUpdateExtentCallback());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->SetUpdateDataCallback(exporter->GetUpdateDataCallback());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->SetDataExtentCallback(exporter->GetDataExtentCallback());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->SetBufferPointerCallback(exporter->GetBufferPointerCallback());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->SetCallbackUserData(exporter->GetCallbackUserData());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">/**</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">* This function will connect the given vtkImageExport filter to</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">* the given itk::VTKImageImport filter.</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">*/</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">template <typename VTK_Exporter, typename ITK_Importer></span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">void ConnectPipelines(VTK_Exporter* exporter, ITK_Importer importer)</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">{</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->SetUpdateInformationCallback(exporter->GetUpdateInformationCallback());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->SetPipelineModifiedCallback(exporter->GetPipelineModifiedCallback());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->SetWholeExtentCallback(exporter->GetWholeExtentCallback());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->SetSpacingCallback(exporter->GetSpacingCallback());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->SetOriginCallback(exporter->GetOriginCallback());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->SetScalarTypeCallback(exporter->GetScalarTypeCallback());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->SetNumberOfComponentsCallback(exporter->GetNumberOfComponentsCallback());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->SetPropagateUpdateExtentCallback(exporter->GetPropagateUpdateExtentCallback());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->SetUpdateDataCallback(exporter->GetUpdateDataCallback());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->SetDataExtentCallback(exporter->GetDataExtentCallback());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->SetBufferPointerCallback(exporter->GetBufferPointerCallback());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->SetCallbackUserData(exporter->GetCallbackUserData());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">essaieAppQtVTK::essaieAppQtVTK(QWidget *parent, Qt::WFlags flags)</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">: QMainWindow(parent, flags)</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">{</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">ui.setupUi(this);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">connect(this->ui.pushButton, SIGNAL(clicked()), this, SLOT(slotOpenFolder()));</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">void essaieAppQtVTK::openDCMFolder()</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">{</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">QString folderNameDCM = QFileDialog::getExistingDirectory(this,tr("Open DCM Folder"),QDir::currentPath(),QFileDialog::ShowDirsOnly);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">std::string stdstrFolderNameDCM = folderNameDCM.toUtf8().constData();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">drawDCMSeries(stdstrFolderNameDCM);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">void essaieAppQtVTK::slotOpenFolder()</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">{</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">openDCMFolder();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">void essaieAppQtVTK::drawDCMSeries(std::string folderDCM)</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">{</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">//typedef unsigned short PixelType;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">//const unsigned int Dimension = 3;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// typedef itk::Image< PixelType, Dimension > ImageType;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<font color="#000000" face="arial, sans-serif"><span style="line-height:13px">typedef itk::Image< double, 3 > ImageType;</span></font><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">typedef itk::VTKImageExport<ImageType> ImageExportType; </span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">typedef itk::ImageSeriesReader< ImageType > ReaderType;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">ReaderType::Pointer reader = ReaderType::New();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">typedef itk::GDCMImageIO ImageIOType;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">ImageIOType::Pointer dicomIO = ImageIOType::New(); </span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">reader->SetImageIO( dicomIO );</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">typedef itk::GDCMSeriesFileNames NamesGeneratorType;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">nameGenerator->SetUseSeriesDetails( true );</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">nameGenerator->AddSeriesRestriction("0008|0021" ); </span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">nameGenerator->SetDirectory( folderDCM);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">typedef std::vector< std::string > SeriesIdContainer; </span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">const SeriesIdContainer & seriesUID = nameGenerator->GetSeriesUIDs(); </span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">std::cout << seriesUID.size() << std::endl;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">SeriesIdContainer::const_iterator seriesItr = seriesUID.begin();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">SeriesIdContainer::const_iterator seriesEnd = seriesUID.end();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">while( seriesItr != seriesEnd )</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">{</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">std::cout << seriesItr->c_str() << std::endl;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">seriesItr++;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">std::string seriesIdentifier;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">seriesIdentifier = seriesUID.begin()->c_str();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">std::cout << seriesIdentifier.c_str() << std::endl;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">typedef std::vector< std::string > FileNamesContainer;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">FileNamesContainer fileNames; </span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">fileNames = nameGenerator->GetFileNames( seriesIdentifier ); </span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">reader->SetFileNames( fileNames );</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">try</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">{</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">reader->Update();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">catch (itk::ExceptionObject &ex)</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">{</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">std::cout << ex << std::endl;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">//*************************************************************//</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">typedef itk::CurvatureFlowImageFilter<ImageType, ImageType> DenoiserType;</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// Create the itk::CurvatureFlowImageFilter and connect it</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// to the itk::RandomImageSource.</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">DenoiserType::Pointer denoiser = DenoiserType::New();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">denoiser->SetInput(reader->GetOutput());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">//------------------------------------------------------------------------</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// ITK to VTK pipeline connection.</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">//------------------------------------------------------------------------</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// Create the itk::VTKImageExport instance and connect it to the</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// itk::CurvatureFlowImageFilter.</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">ImageExportType::Pointer exporter = ImageExportType::New();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">exporter->SetInput(denoiser->GetOutput());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// Create the vtkImageImport and connect it to the</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// itk::VTKImageExport instance.</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">vtkImageImport* importer = vtkImageImport::New(); </span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">ConnectPipelines(exporter, importer);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">//------------------------------------------------------------------------</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// VTK pipeline.</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">//------------------------------------------------------------------------</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">importer->Update();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">this->imageViewer= vtkImageViewer2::New();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">imageViewer->SetInput(importer->GetOutput());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">//***********************************************************</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">//it works with VTK reader without ITK:</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">/*this->reader = vtkSmartPointer<vtkDICOMImageReader>::New();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">reader->SetDirectoryName(folderDCM.c_str());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">reader->Update();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">imageViewer->SetInputConnection(reader->GetOutputPort());*/</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">//****************************************************************** </span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// slice status message</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">vtkTextProperty *sliceTextProp = vtkTextProperty::New();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// this->sliceTextProp = vtkTextProperty::New();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">sliceTextProp->SetFontFamilyToCourier();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">sliceTextProp->SetFontSize(20);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">sliceTextProp->SetVerticalJustificationToBottom();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">sliceTextProp->SetJustificationToLeft();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">vtkTextMapper *sliceTextMapper = vtkTextMapper::New();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// this->sliceTextMapper = vtkTextMapper::New();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">std::string msg = StatusMessage::Format(imageViewer->GetSliceMin(), imageViewer->GetSliceMax());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">sliceTextMapper->SetInput(msg.c_str());</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">sliceTextMapper->SetTextProperty(sliceTextProp);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">vtkActor2D *sliceTextActor = vtkActor2D::New();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">//this->sliceTextActor = vtkActor2D::New();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">sliceTextActor->SetMapper(sliceTextMapper);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">sliceTextActor->SetPosition(15, 10);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// usage hint message</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">vtkTextProperty *usageTextProp = vtkTextProperty::New();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// this->usageTextProp = vtkTextProperty::New();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">usageTextProp->SetFontFamilyToCourier();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">usageTextProp->SetFontSize(14);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">usageTextProp->SetVerticalJustificationToTop();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">usageTextProp->SetJustificationToLeft();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">vtkTextMapper *usageTextMapper = vtkTextMapper::New();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">//this->usageTextMapper = vtkTextMapper::New();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">usageTextMapper->SetInput("- Slice with mouse wheel\n or Up/Down-Key\n- Zoom with pressed right\n mouse button while dragging");</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">usageTextMapper->SetTextProperty(usageTextProp);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">vtkActor2D *usageTextActor = vtkActor2D::New();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">//this->usageTextActor = vtkActor2D::New();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">usageTextActor->SetMapper(usageTextMapper);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">usageTextActor->GetPositionCoordinate()->SetCoordinateSystemToNormalizedDisplay();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">usageTextActor->GetPositionCoordinate()->SetValue( 0.05, 0.95);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// create an interactor with our own style (inherit from vtkInteractorStyleImage)</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// in order to catch mousewheel and key events</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">vtkRenderWindowInteractor *renderWindowInteractor = vtkRenderWindowInteractor::New();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">//this->renderWindowInteractor = vtkRenderWindowInteractor::New();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">myVtkInteractorStyleImage *myInteractorStyle = myVtkInteractorStyleImage::New();</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// make imageviewer2 and sliceTextMapper visible to our interactorstyle</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// to enable slice status message updates when scrolling through the slices</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">myInteractorStyle->SetImageViewer(imageViewer);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">myInteractorStyle->SetStatusMapper(sliceTextMapper);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">imageViewer->SetupInteractor(renderWindowInteractor);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// make the interactor use our own interactorstyle</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// cause SetupInteractor() is defining it's own default interatorstyle </span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// this must be called after SetupInteractor()</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">renderWindowInteractor->SetInteractorStyle(myInteractorStyle);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">// add slice status message and usage hint message to the renderer</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">imageViewer->GetRenderer()->AddActor2D(sliceTextActor);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">imageViewer->GetRenderer()->AddActor2D(usageTextActor);</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">ui.qvtkWidget->SetRenderWindow(imageViewer->GetRenderWindow()); </span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">ui.qvtkWidget->GetRenderWindow()->GetInteractor()->SetInteractorStyle(myInteractorStyle); </span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">imageViewer->Render(); </span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">ui.qvtkWidget->update(); </span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">essaieAppQtVTK::~essaieAppQtVTK()</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">{</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">}</span><br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px"><br>Please answer me because I already posted the topic for a week but no one has replied.<br style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">
<span style="color:rgb(0,0,0);font-family:arial,sans-serif;font-size:13px;line-height:13px">Thank you in advance</span><br></div></div>