<div dir="ltr">Hi all,<br><br>Here is the problematic part of the code which I wrote using QtCreator. I am trying to render axial and sagittal. But only the first "call" is called!<br><br><br>Source:<br><font size="4"><span style="color: rgb(128, 128, 0);">void</span><span style="color: rgb(192, 192, 192);"> </span>MainWindow<span style="color: rgb(0, 0, 0);">::</span>on_actionImport_CT_triggered<span style="color: rgb(0, 0, 0);">()</span></font>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(0, 0, 0);">{</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">this</span><span style="color: rgb(0, 0, 0);">-></span>ReadCT<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">this</span><span style="color: rgb(0, 0, 0);">-></span>ShowAxial<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">this</span><span style="color: rgb(0, 0, 0);">-></span>ShowAxial<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(0, 0, 0);">}</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(128, 128, 0);">void</span><span style="color: rgb(192, 192, 192);"> </span>MainWindow<span style="color: rgb(0, 0, 0);">::</span>ReadCT<span style="color: rgb(0, 0, 0);">()</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(0, 0, 0);">{</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">QString</span><span style="color: rgb(192, 192, 192);"> </span>Folder<span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(128, 0, 128);">QFileDialog</span><span style="color: rgb(0, 0, 0);">::</span>getExistingDirectory<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>std<span style="color: rgb(0, 0, 0);">::</span>string<span style="color: rgb(192, 192, 192);"> </span>FolderStr<span style="color: rgb(0, 0, 0);">;</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>FolderStr<span style="color: rgb(0, 0, 0);">=</span>Folder<span style="color: rgb(0, 0, 0);">.</span>toStdString<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>mDicomReader<span style="color: rgb(0, 0, 0);">=</span>vtkDICOMImageReader<span style="color: rgb(0, 0, 0);">::</span>New<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>mDicomReader<span style="color: rgb(0, 0, 0);">-></span>SetDirectoryName<span style="color: rgb(0, 0, 0);">(</span>FolderStr<span style="color: rgb(0, 0, 0);">.</span>c_str<span style="color: rgb(0, 0, 0);">());</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>mDicomReader<span style="color: rgb(0, 0, 0);">-></span>Update<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">}</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">void</span><span style="color: rgb(192, 192, 192);"> </span>MainWindow<span style="color: rgb(0, 0, 0);">::</span>ShowAxial<span style="color: rgb(0, 0, 0);">()</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(0, 0, 0);">{</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>mImageViewerAxial<span style="color: rgb(0, 0, 0);">=</span>vtkImageViewer2<span style="color: rgb(0, 0, 0);">::</span>New<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>mImageViewerAxial<span style="color: rgb(0, 0, 0);">-></span>SetInputConnection<span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(128, 128, 0);">this</span><span style="color: rgb(0, 0, 0);">-></span>mDicomReader<span style="color: rgb(0, 0, 0);">-></span>GetOutputPort<span style="color: rgb(0, 0, 0);">());</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>mImageViewerAxial<span style="color: rgb(0, 0, 0);">-></span>SetSlice<span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 128);">20</span><span style="color: rgb(0, 0, 0);">);</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>mImageViewerAxial<span style="color: rgb(0, 0, 0);">-></span>SetSliceOrientationToXY<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4">mRenderWindowInteractorAxial<span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(192, 192, 192);"> </span>vtkRenderWindowInteractor<span style="color: rgb(0, 0, 0);">::</span>New<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>mImageViewerAxial<span style="color: rgb(0, 0, 0);">-></span>SetupInteractor<span style="color: rgb(0, 0, 0);">(</span>mRenderWindowInteractorAxial<span style="color: rgb(0, 0, 0);">);</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>mImageViewerAxial<span style="color: rgb(0, 0, 0);">-></span>SetRenderWindow<span style="color: rgb(0, 0, 0);">(</span>ui<span style="color: rgb(0, 0, 0);">-></span>qvtkWidgetAxial<span style="color: rgb(0, 0, 0);">-></span>GetRenderWindow<span style="color: rgb(0, 0, 0);">());</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>mImageViewerAxial<span style="color: rgb(0, 0, 0);">-></span>Render<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>mImageViewerAxial<span style="color: rgb(0, 0, 0);">-></span>GetRenderer<span style="color: rgb(0, 0, 0);">()-></span>ResetCamera<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>mImageViewerAxial<span style="color: rgb(0, 0, 0);">-></span>Render<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>mRenderWindowInteractorAxial<span style="color: rgb(0, 0, 0);">-></span>Start<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(0, 0, 0);">}</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">void</span><span style="color: rgb(192, 192, 192);"> </span>MainWindow<span style="color: rgb(0, 0, 0);">::</span>ShowSagittal<span style="color: rgb(0, 0, 0);">()</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(0, 0, 0);">{</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>mImageViewerSagittal<span style="color: rgb(0, 0, 0);">=</span>vtkImageViewer2<span style="color: rgb(0, 0, 0);">::</span>New<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>mImageViewerSagittal<span style="color: rgb(0, 0, 0);">-></span>SetInput<span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(128, 128, 0);">this</span><span style="color: rgb(0, 0, 0);">-></span>mDicomReader<span style="color: rgb(0, 0, 0);">-></span>GetOutput<span style="color: rgb(0, 0, 0);">());</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>mImageViewerSagittal<span style="color: rgb(0, 0, 0);">-></span>SetSlice<span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 128);">10</span><span style="color: rgb(0, 0, 0);">);</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>mImageViewerSagittal<span style="color: rgb(0, 0, 0);">-></span>SetSliceOrientationToXZ<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>mRenderWindowInteractorSagittal<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">=</span>vtkRenderWindowInteractor<span style="color: rgb(0, 0, 0);">::</span>New<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>mImageViewerSagittal<span style="color: rgb(0, 0, 0);">-></span>SetupInteractor<span style="color: rgb(0, 0, 0);">(</span>mRenderWindowInteractorSagittal<span style="color: rgb(0, 0, 0);">);</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>mImageViewerSagittal<span style="color: rgb(0, 0, 0);">-></span>SetRenderWindow<span style="color: rgb(0, 0, 0);">(</span>ui<span style="color: rgb(0, 0, 0);">-></span>qvtkWidgetAxial<span style="color: rgb(0, 0, 0);">-></span>GetRenderWindow<span style="color: rgb(0, 0, 0);">());</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>mImageViewerSagittal<span style="color: rgb(0, 0, 0);">-></span>Render<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>mImageViewerSagittal<span style="color: rgb(0, 0, 0);">-></span>GetRenderer<span style="color: rgb(0, 0, 0);">()-></span>ResetCamera<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>mImageViewerSagittal<span style="color: rgb(0, 0, 0);">-></span>Render<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>mRenderWindowInteractorSagittal<span style="color: rgb(0, 0, 0);">-></span>Start<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(0, 0, 0);">}</span></font></pre><br><br>Header:<br><span style="color: rgb(128, 128, 0);">class</span><span style="color: rgb(192, 192, 192);"> </span>MainWindow<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">:</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">public</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">QMainWindow</span>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(0, 0, 0);">{</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">Q_OBJECT</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(128, 128, 0);">public</span><span style="color: rgb(0, 0, 0);">:</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">explicit</span><span style="color: rgb(192, 192, 192);"> </span>MainWindow<span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(128, 0, 128);">QWidget</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">*</span>parent<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">0</span><span style="color: rgb(0, 0, 0);">);</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">~</span>MainWindow<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">void</span><span style="color: rgb(192, 192, 192);"> </span>ReadCT<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">void</span><span style="color: rgb(192, 192, 192);"> </span>ShowAxial<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">void</span><span style="color: rgb(192, 192, 192);"> </span>ShowSagittal<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(128, 128, 0);">private</span><span style="color: rgb(0, 0, 0);">:</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>Ui<span style="color: rgb(0, 0, 0);">::</span>MainWindow<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">*</span>ui<span style="color: rgb(0, 0, 0);">;</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>vtkImageData<span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(192, 192, 192);"> </span>mImageData<span style="color: rgb(0, 0, 0);">;</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>vtkImageViewer2<span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(192, 192, 192);"> </span>mImageViewerAxial<span style="color: rgb(0, 0, 0);">;</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>vtkImageViewer2<span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(192, 192, 192);"> </span>mImageViewerSagittal<span style="color: rgb(0, 0, 0);">;</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>vtkDICOMImageReader<span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(192, 192, 192);"> </span>mDicomReader<span style="color: rgb(0, 0, 0);">;</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>vtkRenderWindowInteractor<span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(192, 192, 192);"> </span>mRenderWindowInteractorAxial<span style="color: rgb(0, 0, 0);">;</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span>vtkRenderWindowInteractor<span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(192, 192, 192);"> </span>mRenderWindowInteractorSagittal<span style="color: rgb(0, 0, 0);">;</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(128, 128, 0);">private</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">slots</span><span style="color: rgb(0, 0, 0);">:</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">void</span><span style="color: rgb(192, 192, 192);"> </span>on_verticalScrollBar_actionTriggered<span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(128, 128, 0);">int</span><span style="color: rgb(192, 192, 192);"> </span>action<span style="color: rgb(0, 0, 0);">);</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">void</span><span style="color: rgb(192, 192, 192);"> </span>on_actionImport_CT_triggered<span style="color: rgb(0, 0, 0);">();</span></font></pre>
<pre style="margin: 0px; text-indent: 0px;"><font size="4"><span style="color: rgb(0, 0, 0);">};<br><br>Thank you<br><br>Jothy<br></span></font></pre><br></div>