tag:blogger.com,1999:blog-19268675696191536232024-03-14T01:59:36.137-07:00Qt ITK VTKThis blog helps you to learn Qt integration with ITK and VTK. It covers ITK-VTK's basic examples with solution of error log.VTK QT ITKhttp://www.blogger.com/profile/06611251907711598891noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-1926867569619153623.post-50537991059819965572014-07-02T04:06:00.001-07:002014-07-02T04:24:37.602-07:00Histogram with Selection Callback<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<br />
<h2 style="text-align: left;">
<b><br /></b></h2>
<div style="text-align: left;">
<b>Input : Jpeg Image</b><br />
<b><br /></b>
<b>Commands:</b><br />
<b>Left Click will Draw the rectangle and select the cell enclosed.</b><br />
<b>
Right Click will Draw the rectangle and zoom the cells enclosed.</b></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<b><br />
</b></div>
<div>
<b>Steps to build:</b></div>
<div>
<b><br />
</b></div>
<div>
<ul style="text-align: left;">
<li><b>Create Folder name ChartTest keep below files in it.</b></li>
<li><b>Create </b>QChartwithInteraction.cpp and copy the below code</li>
<li><div>
<b>Create </b>CMakeLists.txt and copy the below code</div>
</li>
<li><div>
Use CMAKE.exe give path(c://ChartTest) of ChartTest in source and in Bin add bin next to it path(c://ChartTest//Bin) </div>
</li>
<li><div>
Click on Configure it will create the Bin folder in that path automatically. Provide ITK and VTK library path if it won't take automatically.</div>
</li>
<li><div>
Then again Click on Configure</div>
</li>
<li><div>
Than Click on Generate</div>
</li>
<li><div>
Now open the Bin folder and click on .sln file</div>
</li>
<li><div>
Click on BuildSolution under Build or press F7 key to Build it in Visual studio </div>
</li>
<li><div>
Now draw rectangle using Left click on Chart View you can see the selected cell value on command window.</div>
</li>
</ul>
</div>
<h4 style="text-align: left;">
Code:</h4>
<h4 style="text-align: left;">
<u>QChartwithInteraction.cpp</u></h4>
<div>
<br /></div>
<div>
<div>
//VTK</div>
<div>
#include "vtkRenderer.h"</div>
<div>
#include "vtkRenderWindow.h"</div>
<div>
#include <vtkRenderWindowInteractor.h></div>
<div>
#include "vtkSmartPointer.h"</div>
<div>
#include <vtkImageData.h></div>
<div>
#include <vtkJPEGReader.h></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>//For chart Display </div>
<div>
#include "vtkContextView.h"</div>
<div>
#include "vtkContextScene.h"</div>
<div>
#include "vtkChartXY.h"</div>
<div>
#include "vtkPlot.h"</div>
<div>
#include "vtkTable.h"</div>
<div>
#include <vtkImageAccumulate.h></div>
<div>
#include<vtkIntArray.h></div>
<div>
#include<vtkImageExtractComponents.h></div>
<div>
#include <vtkCommand.h></div>
<div>
#include <vtkIdTypeArray.h></div>
<div>
#include <vtkSelection.h> // for selecting XY chart </div>
<div>
#include <vtkContextMouseEvent.h>// For Mouse click translation</div>
<div>
#include <vtkExtractSelection.h></div>
<div>
#include <vtkChartLegend.h></div>
<div>
#include <vtkAxis.h></div>
<div>
<br /></div>
<div>
//Qt</div>
<div>
#include <QApplication></div>
<div>
#include <QWidget></div>
<div>
#include <QMainWindow></div>
<div>
#include <QHBoxLayout></div>
<div>
#include "QVTKWidget.h"</div>
<div>
#include "vtkQtTableView.h"</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
//------------------------</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
#define VTK_CREATE(type, name) \</div>
<div>
vtkSmartPointer<type> name = vtkSmartPointer<type>::New()</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
class ChartCallback: public vtkCommand</div>
<div>
{</div>
<div>
public:</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>static ChartCallback *New() </div>
<div>
{<span class="Apple-tab-span" style="white-space: pre;"> </span>return new ChartCallback; }</div>
<div>
<br /></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>void Intialize(double * min,QVTKWidget *qvtkWidget)</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>{</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>m_min=min;</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>m_qvtkWidget=qvtkWidget;</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>}</div>
<div>
</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
<br /></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>virtual void Execute(vtkObject *caller, unsigned long eventId, void* )</div>
<div>
{ </div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>vtkSmartPointer<vtkChartXY> View = vtkChartXY::SafeDownCast(caller);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>int j =View->GetSelectionMode();</div>
<div>
</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>vtkSmartPointer<vtkChartLegend> leg=View->GetLegend();</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>j=View->GetNumberOfItems();</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span> if(eventId==75)</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span> {</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span> int max=View->GetPlot(0)->GetSelection()->GetNumberOfTuples();</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span> std::cout<<"Selected Intensity"<<endl;</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>for(int i=-1;i<max-1;i++)</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>{</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>double data=View->GetPlot(0)->GetSelection()->GetComponent(View->GetNumberOfPlots(),i);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>data=double(m_min[0]+data);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>std::cout<<data<<endl;</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>}</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span> }</div>
<div>
<br /></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span> View->Update();</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span> m_qvtkWidget->update();</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>}</div>
<div>
public:</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>vtkSmartPointer<vtkExtractSelection> m_extract;</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>vtkSmartPointer<vtkAnnotationLink> m_link;</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>vtkSmartPointer<vtkSelection> m_sel;</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>vtkSmartPointer<vtkTable> m_table;</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>vtkSmartPointer<vtkAnnotationLink> link;</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>double *m_min;</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>QVTKWidget *m_qvtkWidget;</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
};</div>
<div>
<br /></div>
<div>
//---------------------------------------------------------------</div>
<div>
int main( int argc, char * argv [] )</div>
<div>
{</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Qt initialization</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>QApplication app(argc, argv);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>QMainWindow mainWindow;</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>mainWindow.setGeometry(0, 0, 1150, 600);</div>
<div>
<br /></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>// QVTK set up and initialization</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>QVTKWidget *qvtkWidget = new QVTKWidget(&mainWindow);</div>
<div>
</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>//Setting Data Path to VTK Reader </div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>vtkSmartPointer<vtkJPEGReader> reader=vtkSmartPointer<vtkJPEGReader>::New();</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>reader->SetFileName("D:\\testing_Dataset\\Data.jpg");//DataSet Path</div>
<div>
<br /></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>reader->Update();</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>double X[2];</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>reader->GetOutput()->GetScalarRange(X);</div>
<div>
<br /></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>//Generate Table </div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>vtkTable * table= vtkTable::New(); </div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>vtkIntArray* arrX = vtkIntArray::New(); </div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>arrX->SetName("Intensity");</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>table->AddColumn(arrX); </div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>vtkIntArray* arrC = vtkIntArray::New(); </div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>arrC->SetName("No of Pixels"); </div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>table->AddColumn(arrC); </div>
<div>
<br /></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>vtkSmartPointer<vtkImageExtractComponents> extract = </div>
<div>
vtkSmartPointer<vtkImageExtractComponents>::New();</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>extract->SetInput( reader->GetOutput());</div>
<div>
extract->SetComponents( 0 );</div>
<div>
extract->Update();</div>
<div>
</div>
<div>
vtkSmartPointer<vtkImageAccumulate> histogram = </div>
<div>
vtkSmartPointer<vtkImageAccumulate>::New();</div>
<div>
histogram->SetInputConnection( extract->GetOutputPort() );</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>histogram->SetComponentExtent( int(X[0]),int(X[1]),0,0,0,0 );</div>
<div>
histogram->SetComponentOrigin( 0,0,0 );</div>
<div>
histogram->SetComponentSpacing( 1,0,0 );</div>
<div>
histogram->SetIgnoreZero( 0 );</div>
<div>
histogram->Update();</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>int x = int(X[0]);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>int y = int(X[1]);</div>
<div>
<br /></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>int range = y-x;</div>
<div>
<br /></div>
<div>
int* output = static_cast<int*>(histogram->GetOutput()->GetScalarPointer());</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>table->SetNumberOfRows(range+1);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>for( int i = 0; i<=range+1; i++,x++)</div>
<div>
{</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span> table->SetValue(i,0,x);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span> table->SetValue(i,1,*output);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span> </div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span> output++;</div>
<div>
}</div>
<div>
<br /></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>vtkPlot *line = 0;</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>//Chart Implimentation</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>vtkChartXY *chart = vtkChartXY::New();</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>vtkContextView *view=vtkContextView::New();</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>line = chart->AddPlot(vtkChart::BAR);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>line->SetInput(table,0,1);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
<br /></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>chart->GetAxis(vtkAxis::LEFT)->SetTitle("No of Pixel");</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>chart->GetAxis(vtkAxis::BOTTOM)->SetTitle("intensity");</div>
<div>
<br /></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>chart->GetAxis(vtkAxis::BOTTOM)->SetGridVisible(false);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>chart->GetAxis(vtkAxis::LEFT)->SetGridVisible(false);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>chart->SetForceAxesToBounds(true);//start from minimum range</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>chart->SetBarWidthFraction(1);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
//Draw Chart</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>chart->Update();</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>view->GetScene()->AddItem(chart);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Translate the Widget Action //Left mouse click for select the chart // Right click for Zoom </div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>chart->SetActionToButton(vtkChart::SELECT, </div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>vtkContextMouseEvent::LEFT_BUTTON); </div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>chart->SetActionToButton(vtkChart::ZOOM, </div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>vtkContextMouseEvent::RIGHT_BUTTON); </div>
<div>
<br /></div>
<div>
//Providing Chart callback</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>vtkSmartPointer<ChartCallback> cbk =</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>vtkSmartPointer<ChartCallback>::New();</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>cbk->Intialize(X,qvtkWidget);</div>
<div>
<br /></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>//Important:: This is for telling Callback to send signal if Chart cell will select</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>chart->AddObserver(vtkSelection::CELL,cbk);</div>
<div>
</div>
<div>
//---------------------------------------------------------- </div>
<div>
<br /></div>
<div>
#if VTK_MAJOR_VERSION <= 5</div>
<div>
line->SetInput(table, 0, 1);</div>
<div>
</div>
<div>
#else</div>
<div>
line->SetInputData(table, 0, 1);</div>
<div>
#endif</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>line->SetColor(0, 0.5, 255, 255);</div>
<div>
<br /></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>//Setting ContexView in QvtkWidget</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>view->SetInteractor(qvtkWidget->GetInteractor());</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>qvtkWidget->SetRenderWindow(view->GetRenderWindow());</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>view->GetRenderWindow()->SetMultiSamples(0);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>view->GetInteractor()->Initialize();</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Now lets try to add a table view</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>QWidget *widget = new QWidget(&mainWindow);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>QHBoxLayout *layout = new QHBoxLayout(widget);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>VTK_CREATE(vtkQtTableView, tableView);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>tableView->SetSplitMultiComponentColumns(true);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>tableView->AddRepresentationFromInput(table);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>tableView->Update();</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>layout->addWidget(qvtkWidget, 2);</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>layout->addWidget(tableView->GetWidget());</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>mainWindow.setCentralWidget(widget);</div>
<div>
<br /></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>// Now show the application and start the event loop</div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>mainWindow.show();</div>
<div>
<br /></div>
<div>
<span class="Apple-tab-span" style="white-space: pre;"> </span>return app.exec();</div>
<div>
}</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<h4 style="text-align: left;">
<u>CMakeLists.txt</u></h4>
<div>
<div class="MsoPlainText">
<span style="font-family: "Courier New";">PROJECT (Charts)<o:p></o:p></span></div>
<div class="MsoPlainText">
<br /></div>
<div class="MsoPlainText">
<span style="font-family: "Courier New";">IF(NOT VTK_BINARY_DIR)<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: "Courier New";">FIND_PACKAGE(VTK REQUIRED)<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: "Courier New";">IF(NOT VTK_USE_CHARTS)<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: "Courier New";"> MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_CHARTS.")<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: "Courier New";">ENDIF(NOT VTK_USE_CHARTS)<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: "Courier New";">INCLUDE(${VTK_USE_FILE})<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: "Courier New";">ENDIF(NOT VTK_BINARY_DIR)<o:p></o:p></span></div>
<div class="MsoPlainText">
<br /></div>
<div class="MsoPlainText">
<br /></div>
<div class="MsoPlainText">
<span style="font-family: "Courier New";">IF(VTK_USE_QVTK)<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: "Courier New";"> FIND_PACKAGE(Qt4 REQUIRED)<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: "Courier New";"> INCLUDE(${QT_USE_FILE})<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: "Courier New";"> INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR})<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: "Courier New";"> ADD_EXECUTABLE</span><span style="font-family: Courier New, Courier, monospace;">(QChartTable </span><span style="font-family: 'Courier New', Courier, monospace;">QChartwithInteraction.cpp</span><span style="font-family: 'Courier New';">)</span></div>
<div class="MsoPlainText">
<span style="font-family: "Courier New";"> TARGET_LINK_LIBRARIES(QChartTable<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: "Courier New";"> QVTK<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: "Courier New";"> ${QT_LIBRARIES}<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: "Courier New";"> vtkRendering<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: "Courier New";"> vtkCharts<o:p></o:p></span></div>
<div class="MsoPlainText">
<span style="font-family: "Courier New";"> )<o:p></o:p></span></div>
<div class="MsoPlainText">
<br /></div>
<div class="MsoPlainText">
<span style="font-family: "Courier New";">ENDIF(VTK_USE_QVTK)<o:p></o:p></span></div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<blockquote class="tr_bq" style="text-align: left;">
<span style="color: red;"><br />
</span><span style="color: red;"> *NOTE: Let me know if you need any modification in it.</span></blockquote>
</div>
<div>
</div>
</div>
VTK QT ITKhttp://www.blogger.com/profile/06611251907711598891noreply@blogger.com0tag:blogger.com,1999:blog-1926867569619153623.post-46324221301740803692013-07-04T01:43:00.000-07:002013-07-04T01:43:21.945-07:00ITK reader- VTK Viewer - Qt GUI<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="MsoNormal">
We are using itkImageSeriesReader which support different
formats DICOM, JPEG, TIFF, PNG to read in a series but size of images should be
same. Then itkImageToVTKImageFilter will convert data from itk to vtk image
format that we will visualize through VTK+Qt pipeline. In VTK you can try both
viewers just by uncomment two lines of vtkImageViewer2 and comment lines of vtkResliceImageViewer.
</div>
<div class="MsoNormal">
Application have :</div>
<div class="MsoNormal">
1. main.cpp</div>
<div class="MsoNormal">
2. mainwindow.h</div>
<div class="MsoNormal">
3. mainwindow.cpp</div>
<div class="MsoNormal">
4. mainwindow.ui</div>
<div class="MsoNormal">
5. CmakeLists.txt</div>
<div class="MsoNormal">
Step 1. Copy XML code of ui form into a text editor and save
it as mainwindow.ui format. It will create ui.</div>
<div class="MsoNormal">
Step 2. Create headers, cpp and cmake files.</div>
<div class="MsoNormal">
Step 3. Cmake to generate project file, build and run. </div>
<div class="MsoNormal">
Here is code</div>
<div class="MsoNormal">
<br /></div>
<h4 style="text-align: left;">
<span style="font-family: Calibri, sans-serif;">mainwindow.ui</span><span style="font-size: large;"> </span></h4>
<div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"><?</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">xml</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">version</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">1.0</span>"<span style="color: blue;"> </span><span style="color: red;">encoding</span><span style="color: blue;">=</span>"<span style="color: blue;">UTF-8</span>"<span style="color: blue;">?><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"><</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">ui</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">version</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">4.0</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">class</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">MainWindow<span style="color: blue;"></</span><span style="color: #a31515;">class</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">widget</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">class</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">QMainWindow</span>"<span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=</span>"<span style="color: blue;">MainWindow</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">property</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">name</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">geometry</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">rect</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">x</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">0<span style="color: blue;"></</span><span style="color: #a31515;">x</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">y</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">0<span style="color: blue;"></</span><span style="color: #a31515;">y</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">width</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">419<span style="color: blue;"></</span><span style="color: #a31515;">width</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">height</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">350<span style="color: blue;"></</span><span style="color: #a31515;">height</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">rect</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">property</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">property</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">name</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">windowTitle</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">string</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">MainWindow<span style="color: blue;"></</span><span style="color: #a31515;">string</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">property</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">widget</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">class</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">QWidget</span>"<span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=</span>"<span style="color: blue;">centralWidget</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">widget</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">class</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">QVTKWidget</span>"<span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=</span>"<span style="color: blue;">qVTK1</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">property</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">name</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">geometry</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">rect</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">x</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">10<span style="color: blue;"></</span><span style="color: #a31515;">x</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">y</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">10<span style="color: blue;"></</span><span style="color: #a31515;">y</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">width</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">381<span style="color: blue;"></</span><span style="color: #a31515;">width</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">height</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">291<span style="color: blue;"></</span><span style="color: #a31515;">height</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">rect</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">property</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">property</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">name</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">sizePolicy</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">sizepolicy</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">hsizetype</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">Expanding</span>"<span style="color: blue;"> </span><span style="color: red;">vsizetype</span><span style="color: blue;">=</span>"<span style="color: blue;">MinimumExpanding</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">horstretch</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">0<span style="color: blue;"></</span><span style="color: #a31515;">horstretch</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">verstretch</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">0<span style="color: blue;"></</span><span style="color: #a31515;">verstretch</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">sizepolicy</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">property</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">widget</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">widget</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">widget</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">class</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">QMenuBar</span>"<span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=</span>"<span style="color: blue;">menuBar</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">property</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">name</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">geometry</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">rect</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">x</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">0<span style="color: blue;"></</span><span style="color: #a31515;">x</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">y</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">0<span style="color: blue;"></</span><span style="color: #a31515;">y</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">width</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">419<span style="color: blue;"></</span><span style="color: #a31515;">width</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">height</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">21<span style="color: blue;"></</span><span style="color: #a31515;">height</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">rect</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">property</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">widget</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">class</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">QMenu</span>"<span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=</span>"<span style="color: blue;">menu_File</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">property</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">name</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">title</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">string</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">&amp;</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">File<span style="color: blue;"></</span><span style="color: #a31515;">string</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">property</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">widget</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">class</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">QMenu</span>"<span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=</span>"<span style="color: blue;">menu_Open</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">property</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">name</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">title</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">string</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">&amp;</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">Open<span style="color: blue;"></</span><span style="color: #a31515;">string</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">property</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">addaction</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">name</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">actionDICOM_Sequence</span>"<span style="color: blue;">/><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">widget</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">addaction</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">name</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">menu_Open</span>"<span style="color: blue;">/><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">addaction</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">name</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">separator</span>"<span style="color: blue;">/><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">addaction</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">name</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">actionExit</span>"<span style="color: blue;">/><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">widget</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">addaction</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">name</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">menu_File</span>"<span style="color: blue;">/><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">widget</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">widget</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">class</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">QToolBar</span>"<span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=</span>"<span style="color: blue;">mainToolBar</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">attribute</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">name</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">toolBarArea</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">enum</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">TopToolBarArea<span style="color: blue;"></</span><span style="color: #a31515;">enum</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">attribute</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">attribute</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">name</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">toolBarBreak</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">bool</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">false<span style="color: blue;"></</span><span style="color: #a31515;">bool</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">attribute</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">widget</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">widget</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">class</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">QStatusBar</span>"<span style="color: blue;"> </span><span style="color: red;">name</span><span style="color: blue;">=</span>"<span style="color: blue;">statusBar</span>"<span style="color: blue;">/><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">action</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">name</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">actionJPEG</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">property</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">name</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">text</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">string</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">JPEG<span style="color: blue;"></</span><span style="color: #a31515;">string</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">property</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">action</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">action</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">name</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">actionDICOM</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">property</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">name</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">text</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">string</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">DICOM<span style="color: blue;"></</span><span style="color: #a31515;">string</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">property</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">action</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">action</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">name</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">actionDICOM_Sequence</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">property</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">name</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">text</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">string</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">DICOM
Sequence<span style="color: blue;"></</span><span style="color: #a31515;">string</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">property</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">action</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">action</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">name</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">actionExit</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">property</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">name</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">text</span>"<span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">string</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">Exit<span style="color: blue;"></</span><span style="color: #a31515;">string</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">property</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">action</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">widget</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">layoutdefault</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
</span><span style="color: red; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">spacing</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">=</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">"<span style="color: blue;">6</span>"<span style="color: blue;"> </span><span style="color: red;">margin</span><span style="color: blue;">=</span>"<span style="color: blue;">11</span>"<span style="color: blue;">/><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">customwidgets</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">customwidget</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">class</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">QVTKWidget<span style="color: blue;"></</span><span style="color: #a31515;">class</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">extends</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">QWidget<span style="color: blue;"></</span><span style="color: #a31515;">extends</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">header</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">QVTKWidget.h<span style="color: blue;"></</span><span style="color: #a31515;">header</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">container</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">1<span style="color: blue;"></</span><span style="color: #a31515;">container</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">slots</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">slot</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">></span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">sopenimage()<span style="color: blue;"></</span><span style="color: #a31515;">slot</span><span style="color: blue;">><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">slots</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">customwidget</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> </</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">customwidgets</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">resources</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">/><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">connections</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">/><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"></</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">ui</span><span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">><o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<o:p><br /></o:p></div>
<h4 style="text-align: left;">
mainwindow.h</h4>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">#ifndef</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
MAINWINDOW_H<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">#define</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
MAINWINDOW_H<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">#include</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: #a31515;"><QMainWindow><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">#include</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: #a31515;">"vtkSmartPointer.h"<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">class</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
vtkImageViewer2;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">class</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
vtkResliceImageViewer;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">namespace</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> Ui {<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">class</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
MainWindow;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">class</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> MainWindow
: <span style="color: blue;">public</span> QMainWindow<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: blue;">Q_OBJECT<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">public</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: blue;">explicit</span>
MainWindow(QWidget *parent = 0);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> ~MainWindow();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">private</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: blue;">slots</span>:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: blue;">int</span>
DICOMseq();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">private</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: green;">//vtkImageViewer2 *image_view;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
vtkSmartPointer<vtkResliceImageViewer> image_view;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> Ui::MainWindow *ui;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">};<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">#endif</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: green;">// MAINWINDOW_H<o:p></o:p></span></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
mainwindow.cpp</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: green; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">//Qt<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">#include</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: #a31515;">"mainwindow.h"<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">#include</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: #a31515;">"ui_mainwindow.h"<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">#include</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"><QFileDialog><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">#include</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"><QFileInfoList><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">#include</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"><QDir><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">#include</span><span style="color: #a31515; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"><iostream><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: green; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">//ITK<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">#include</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: #a31515;">"itkImage.h"<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">#include</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: #a31515;">"itkImageSeriesReader.h"<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">#include</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: #a31515;">"itkImageToVTKImageFilter.h"<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: green; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">//VTK<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">#include</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: #a31515;">"vtkImageViewer2.h"<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">#include</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: #a31515;">"vtkResliceImageViewer.h"<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">#include</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: #a31515;">"vtkRenderWindow.h"<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">#include</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: #a31515;">"vtkRenderWindowInteractor.h"<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">#include</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: #a31515;">"vtkRenderer.h"<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">using</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: blue;">namespace</span> std;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">MainWindow::MainWindow(QWidget
*parent) :<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> QMainWindow(parent),<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> ui(<span style="color: blue;">new</span>
Ui::MainWindow)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> ui->setupUi(<span style="color: blue;">this</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: green;">//image_view =
vtkImageViewer2::New();<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> image_view =
vtkSmartPointer<vtkResliceImageViewer>::New();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: green;">//Qt Signal slot <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> connect(ui->actionDICOM_Sequence,<span style="color: blue;">SIGNAL</span>(triggered()),<span style="color: blue;">this</span>, <span style="color: blue;">SLOT</span>(DICOMseq()));<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> connect(ui->actionExit,<span style="color: blue;">SIGNAL</span>(triggered()),<span style="color: blue;">this</span>, <span style="color: blue;">SLOT</span>(close()));<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">MainWindow::~MainWindow()<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: blue;">delete</span> ui;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">int</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">
MainWindow::DICOMseq()<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: blue;">typedef</span> <span style="color: blue;">signed</span> <span style="color: blue;">short</span> InputPixelType;<span style="color: green;">//Pixel Type<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: blue;">const</span> <span style="color: blue;">unsigned</span>
<span style="color: blue;">int</span> InputDimension = 3;<span style="color: green;">//Dimension
of image<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: blue;">typedef</span> itk::Image<
InputPixelType, InputDimension > InputImageType;<span style="color: green;">//Image
Type<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: blue;">typedef</span>
itk::ImageSeriesReader< InputImageType > ReaderType;<span style="color: green;">//Reader of Image Type<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> ReaderType::Pointer reader = ReaderType::New();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: green;">//Replacement of name generator of
ITK<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> QDir dir(<span style="color: #a31515;">"Dir"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> dir=QFileDialog::getExistingDirectory(0,<span style="color: #a31515;">"Select Folder: "</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> QFileInfoList list = dir.entryInfoList(QDir::Dirs| QDir::Files
| QDir::NoDotAndDotDot);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> std::vector<std::string> names;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> foreach(QFileInfo finfo, list) <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> std::string
str=dir.path().toStdString().c_str();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> str=str+<span style="color: #a31515;">"/"</span>;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> names.push_back(str+finfo.fileName().toStdString().c_str());<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> reader->SetFileNames( names );<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: green;">//Exceptional handling<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: blue;">try<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> reader->Update();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: blue;">catch</span> (itk::ExceptionObject
& e)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> std::cerr << <span style="color: #a31515;">"exception
in file reader "</span> << std::endl;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> std::cerr << e << std::endl;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: blue;">return</span> EXIT_FAILURE;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: green;">/*<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: green; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: green; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> You can impliment your Filter here and
connect its output to connector below.<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: green; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: green; font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> */<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: green;">//connector to convert ITK image data
to VTK image data<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: blue;">typedef</span>
itk::ImageToVTKImageFilter<InputImageType> ConnectorType;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> ConnectorType::Pointer connector= ConnectorType::New();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> connector->SetInput( reader->GetOutput() );<span style="color: green;">//Set ITK reader Output to connector you can replace it
with filter<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: green;">//Exceptional handling<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: blue;">try<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> connector->Update();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: blue;">catch</span> (itk::ExceptionObject
& e)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> {<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> std::cerr << <span style="color: #a31515;">"exception
in file reader "</span> << std::endl;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> std::cerr << e << std::endl;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: blue;">return</span> EXIT_FAILURE;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> }<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: green;">//deep copy connector's output to an
image else connector will go out of scope <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: green;">//and vanish it will cause error
while changing slice<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> vtkImageData * image = vtkImageData::New();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> image->DeepCopy(connector->GetOutput());<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: green;">//set VTK Viewer to QVTKWidget in
Qt's UI<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> ui->qVTK1->SetRenderWindow(image_view->GetRenderWindow());<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> image_view->SetupInteractor(ui->qVTK1->GetRenderWindow()->GetInteractor());<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: green;">//Set input image to VTK viewer<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> image_view->SetInput(image);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> image_view->SetSlice(image_view->GetSliceMax()/2);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> image_view->GetRenderer()->ResetCamera();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> image_view->Render();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> ui->qVTK1->update();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-no-proof: yes;"> <span style="color: blue;">return</span> EXIT_SUCCESS;<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-no-proof: yes;">}<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-no-proof: yes;"><br /></span></div>
<h4 style="text-align: left;">
main.cpp</h4>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;">#include</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;"> <span style="color: #a31515;"><QApplication><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;">#include</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;"> <span style="color: #a31515;">"mainwindow.h"<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: blue; font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;">int</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;"> main(<span style="color: blue;">int</span> argc, <span style="color: blue;">char</span>
*argv[])<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;"> QApplication a(argc, argv);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;"> MainWindow w;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;"> w.show();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;"> <span style="color: blue;">return</span>
a.exec();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;">}<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<h4 style="text-align: left;">
CmakeLists.txt</h4>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">cmake_minimum_required(VERSION 2.6)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">PROJECT(main)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">IF(NOT VTK_BINARY_DIR)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">FIND_PACKAGE(VTK)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">IF(NOT VTK_DIR)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;"> MESSAGE(FATAL_ERROR
"Please set VTK_DIR.")<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">ENDIF(NOT VTK_DIR)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">INCLUDE(${VTK_USE_FILE})<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">ENDIF(NOT VTK_BINARY_DIR)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">FIND_PACKAGE ( ITK)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">IF ( ITK_FOUND)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">INCLUDE( ${USE_ITK_FILE} )<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">ENDIF( ITK_FOUND)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">SET(QT_QMAKE_EXECUTABLE ${VTK_QT_QMAKE_EXECUTABLE} CACHE
FILEPATH "")<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">SET(QT_MOC_EXECUTABLE ${VTK_QT_MOC_EXECUTABLE} CACHE FILEPATH
"")<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">SET(QT_UIC_EXECUTABLE ${VTK_QT_UIC_EXECUTABLE} CACHE FILEPATH
"")<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">FIND_PACKAGE(Qt4 REQUIRED)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">INCLUDE(${QT_USE_FILE})<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;"># Set your files and resources here<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">SET(Main main.cpp mainwindow.cpp)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">SET(MainUI mainwindow.ui)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">SET(MainH mainwindow.h)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">INCLUDE_DIRECTORIES(<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;"> ${QT_INCLUDE_DIR}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">
${CMAKE_CURRENT_BINARY_DIR}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">
${CMAKE_CURRENT_SOURCE_DIR}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">QT4_WRAP_UI(UISrcs ${MainUI})<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">QT4_WRAP_CPP(MOCSrcs ${MainH} )<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">SOURCE_GROUP("Resources" FILES<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;"> ${MainUI}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">SOURCE_GROUP("Generated" FILES<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;"> ${UISrcs}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;"> ${MOCSrcs}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;"> ${RCS_SOURCES}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">ADD_EXECUTABLE( main ${Main} ${UISrcs} ${MOCSrcs})<o:p></o:p></span></div>
<div class="MsoNormal">
<o:p>
</o:p></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
<span style="font-family: "Courier New"; font-size: 10.0pt; line-height: 115%; mso-bidi-font-size: 15.0pt;">TARGET_LINK_LIBRARIES( main QVTK ${ITK_LIBRARIES} )<o:p></o:p></span></div>
</div>
</div>
VTK QT ITKhttp://www.blogger.com/profile/06611251907711598891noreply@blogger.com13tag:blogger.com,1999:blog-1926867569619153623.post-15236460267462106652013-06-08T06:25:00.000-07:002013-06-18T00:38:19.669-07:00Image Display on VTK Viewers<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="border-bottom: solid #4F81BD 1.0pt; border: none; mso-border-bottom-themecolor: accent1; mso-element: para-border-div; padding: 0in 0in 4.0pt 0in;">
<div align="center" class="MsoTitle" style="text-align: center;">
<br /></div>
</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New';"><span style="font-size: large;">VTK provide two viewers:<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoListParagraphCxSpFirst" style="margin-bottom: 0.0001pt; text-indent: -0.25in;">
<!--[if !supportLists]--><span style="font-size: large;"><span style="background-color: white; font-family: Symbol;">·<span style="font-family: 'Times New Roman';"> <b> 1. </b></span></span><!--[endif]--><span style="background-color: white; font-family: 'Courier New';"><b>vtkImageviewer2<o:p></o:p></b></span></span></div>
<div class="MsoListParagraphCxSpLast" style="margin-bottom: 0.0001pt; text-indent: -0.25in;">
<!--[if !supportLists]--><span style="font-size: large;"><b><span style="background-color: white; font-family: Symbol;">·<span style="font-family: 'Times New Roman';"> 2. </span></span><!--[endif]--></b><span style="background-color: white; font-family: 'Courier New';"><b>vtkResliceImageViewer</b><span style="color: blue;"><o:p></o:p></span></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<h2>
<span style="background: white; mso-highlight: white; mso-no-proof: yes;"><span style="font-size: large;">vtkImageviewer2<o:p></o:p></span></span></h2>
<div class="MsoListParagraphCxSpFirst" style="margin-bottom: 0.0001pt; text-align: justify; text-indent: -0.25in;">
<!--[if !supportLists]--><span style="font-size: large;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Symbol;">·</span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial;"> </span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Times New Roman', serif;">vtkImageviewer2 is
convienient class for displaying 2D image sequence of a image volume. It replace
earlier version of the class vtkImageviewer. vtkImageviewer2 encapsulates
several objects<o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0.0001pt 1in; text-align: justify; text-indent: -0.25in;">
<!--[if !supportLists]--><span style="font-size: large;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';">o<span style="font-family: 'Times New Roman';"> </span></span><!--[endif]--><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Times New Roman', serif;">vtkRenderWindow<o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0.0001pt 1in; text-align: justify; text-indent: -0.25in;">
<!--[if !supportLists]--><span style="font-size: large;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';">o<span style="font-family: 'Times New Roman';"> </span></span><!--[endif]--><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Times New Roman', serif;">vtkRenderer<o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0.0001pt 1in; text-align: justify; text-indent: -0.25in;">
<!--[if !supportLists]--><span style="font-size: large;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';">o<span style="font-family: 'Times New Roman';"> </span></span><!--[endif]--><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Times New Roman', serif;">vtkImageActor<o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpLast" style="margin: 0in 0in 0.0001pt 1in; text-align: justify; text-indent: -0.25in;">
<!--[if !supportLists]--><span style="font-size: large;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';">o<span style="font-family: 'Times New Roman';"> </span></span><!--[endif]--><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Times New Roman', serif;">vtkImageMapToWindowLevelColors<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: justify;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Times New Roman', serif;"><span style="font-size: large;">This class also include vtkInteractorStyleImage that allow zooming, panning,Orientation(XY,YZ,XZ)
and windowing.<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: justify;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Times New Roman', serif;"><span style="font-size: large;">It provide the function SetSlice() to
change the image data(slice) on viewer.<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: justify;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: justify;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Times New Roman', serif;"><span style="font-size: large;">There are two ways to use it:<o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpFirst" style="margin-bottom: 0.0001pt; text-align: justify; text-indent: -0.25in;">
<!--[if !supportLists]--><span style="font-size: large;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Symbol;">·<span style="font-family: 'Times New Roman';"> </span></span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Times New Roman', serif;">vtkImageviewer2 *viewer=
vtkImageviewer2::New();<o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="text-align: justify;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Times New Roman', serif; line-height: 115%;"><span style="font-size: large;">viewer->SetInputConnection(reader->GetOutputPort());<o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="text-align: justify;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Times New Roman', serif; line-height: 115%;"><span style="font-size: large;">viewer->SetSlice(40);<o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0.0001pt; text-align: justify;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Times New Roman', serif;"><span style="font-size: large;">viewer->SetSliceOrientationToXY();<o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0.0001pt; text-align: justify;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Times New Roman', serif;"><span style="font-size: large;">viewer->Render();<o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="margin-bottom: 0.0001pt; text-align: justify;">
<br /></div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-align: justify; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-size: large;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: Symbol; line-height: 115%;">·<span style="font-family: 'Times New Roman'; line-height: normal;"> </span></span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Times New Roman', serif; line-height: 115%;">This is to add geometry and Image<o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle" style="text-align: justify;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Times New Roman', serif; line-height: 115%;"><span style="font-size: large;">viewer->SetInputConnection(reader->GetOutputPort());<o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpLast" style="text-align: justify;">
<span style="font-size: large;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Times New Roman', serif; line-height: 115%;">viewer->GetRenderer()->AddActor(actor);</span><span style="font-family: 'Times New Roman', serif; line-height: 115%;"><o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpLast" style="text-align: justify;">
<span style="font-size: large;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Times New Roman', serif; line-height: 115%;"><br /></span></span></div>
<div class="MsoNormal">
<span style="color: blue; font-family: 'Courier New'; line-height: 115%;"><span style="font-size: large;">This is the sample code:<o:p></o:p></span></span></div>
<div class="MsoNormal">
<span style="color: blue; font-family: 'Courier New'; line-height: 115%;"><span style="font-size: large;"><br /></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: large;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: blue; font-family: 'Courier New';">#include</span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"> <span style="color: #a31515;"><vtkSmartPointer.h><o:p></o:p></span></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: large;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: blue; font-family: 'Courier New';">#include</span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"> <span style="color: #a31515;"><vtkJPEGReader.h><o:p></o:p></span></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: large;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: blue; font-family: 'Courier New';">#include</span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"> <span style="color: #a31515;"><vtkRenderer.h><o:p></o:p></span></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: large;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: blue; font-family: 'Courier New';">#include</span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"> <span style="color: #a31515;"><vtkRenderWindowInteractor.h><o:p></o:p></span></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: large;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: blue; font-family: 'Courier New';">#include</span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"> <span style="color: #a31515;"><vtkImageViewer2.h><o:p></o:p></span></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: large;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: blue; font-family: 'Courier New';">int</span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"> main(<span style="color: blue;">int</span> argc, <span style="color: blue;">char</span>
*argv[])<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"><span style="font-size: large;">{</span></span><span style="background-color: white; font-family: 'Courier New'; font-size: large;"> </span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"><span style="font-size: large;">vtkSmartPointer<vtkJPEGReader>
reader=vtkSmartPointer<vtkJPEGReader>::New();<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: green; font-family: 'Courier New';"><span style="font-size: large;">//SetFileName()for single file .Use SetFileNames for
more than one file(This will cover in next blog with Qt)</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: large;">reader->SetFileName(</span><span style="background-color: white; color: #a31515; font-family: 'Courier New'; font-size: large;">"D:\\testing_Dataset\\JPEG "</span><span style="background-color: white; color: green; font-family: 'Courier New'; font-size: large;">/*Dataset Path*/</span><span style="background-color: white; font-family: 'Courier New'; font-size: large;">); </span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: large;">reader->Update();</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"><span style="font-size: large;">vtkSmartPointer<vtkImageViewer2>viewer=<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"><span style="font-size: large;">vtkSmartPointer<vtkImageViewer2>::New();<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"><span style="font-size: large;">vtkSmartPointer<vtkRenderWindowInteractor>interactor
=vtkSmartPointer<vtkRenderWindowInteractor>::New();</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: large;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: large;">interactor->SetRenderWindow( viewer->GetRenderWindow() );</span><span style="background-color: white; font-family: 'Courier New'; font-size: large;"> </span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"><span style="font-size: large;">viewer->SetupInteractor(interactor);<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"><span style="font-size: large;">viewer->SetInputConnection(reader->GetOutputPort());<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: large;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"> </span><span style="background-color: white; font-family: 'Courier New';"> </span><span style="background-color: white; font-family: 'Courier New';"> </span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"><span style="font-size: large;">viewer->GetRenderer()->ResetCamera();<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"><span style="font-size: large;">viewer->Render();<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"><span style="font-size: large;">interactor->Start();<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"><span style="font-size: large;"><span style="color: blue;">return</span>
EXIT_SUCCESS;<o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpFirst">
<span style="font-size: large;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New'; line-height: 115%;">}</span><span style="font-family: 'Courier New'; line-height: 115%;"><o:p></o:p></span></span></div>
<div class="MsoListParagraphCxSpMiddle">
<br /></div>
<div class="MsoListParagraphCxSpLast">
<br /></div>
<h2>
<span style="background: white; mso-highlight: white; mso-no-proof: yes;"><span style="font-size: large;">vtkResliceImageViewer<o:p></o:p></span></span></h2>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: justify;">
<span style="font-size: large;"><span style="background-color: white; font-family: 'Times New Roman', serif;">This
class is similar to vtkImageViewer2. It displays the image along with a
two cross hairs for reslicing. The cross hairs may be interactively manipulated
and are typically used to reslice two other views of </span><span style="font-family: 'Times New Roman', serif;">vtkResliceImageViewer. <span style="background: white;">This class has default behaviour
of vtkImageViewer2 if the Reslice mode is set to
RESLICE_AXIS_ALIGNED.</span></span><span style="background-color: white; font-family: 'Times New Roman', serif;">This class provide default functionality
for scrolling image data and automatic windowing.</span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Times New Roman', serif;"><o:p> </o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: justify;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: justify;">
<br /></div>
<div class="MsoNormal">
<span style="color: blue; font-family: 'Courier New'; line-height: 115%;"><span style="font-size: large;">This is the sample code:<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: large;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: blue; font-family: 'Courier New';">#include</span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"> <span style="color: #a31515;"><vtkSmartPointer.h><o:p></o:p></span></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: large;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: blue; font-family: 'Courier New';">#include</span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"> <span style="color: #a31515;"><vtkDICOMImageReader.h><o:p></o:p></span></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: large;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: blue; font-family: 'Courier New';">#include</span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"> <span style="color: #a31515;"><vtkRenderer.h><o:p></o:p></span></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: large;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: blue; font-family: 'Courier New';">#include</span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"> <span style="color: #a31515;"><vtkRenderWindowInteractor.h><o:p></o:p></span></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: large;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: blue; font-family: 'Courier New';">#include</span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"> <span style="color: #a31515;"><vtkResliceImageViewer.h><o:p></o:p></span></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: large;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: blue; font-family: 'Courier New';">int</span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"> main(<span style="color: blue;">int</span> argc, <span style="color: blue;">char</span>
*argv[])<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"><span style="font-size: large;">{</span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: large;">vtkSmartPointer<vtkDICOMImageReader>
reader=vtkSmartPointer<vtkDICOMImageReader>::New();</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: large;">reader->SetDirectoryName((</span><span style="background-color: white; color: #a31515; font-family: 'Courier New'; font-size: large;">"D:\\testing_Dataset\\DICOM
</span><span style="background-color: white; color: green; font-family: 'Courier New'; font-size: large;">"/*Directory Path*/</span><span style="background-color: white; font-family: 'Courier New'; font-size: large;">);</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: large;">reader->Update();</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: large;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: large;">vtkSmartPointer<vtkResliceImageViewer>viewer =vtkSmartPointer<vtkResliceImageViewer>::New();</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: large;">vtkSmartPointer<vtkRenderWindowInteractor>interactor
=vtkSmartPointer<vtkRenderWindowInteractor>::New();</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: large;">interactor->SetRenderWindow( viewer->GetRenderWindow() );</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: large;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: large;">viewer->SetupInteractor(interactor);</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: large;">viewer->SetInputConnection(reader->GetOutputPort());</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; color: blue; font-family: 'Courier New'; font-size: large;">int</span><span style="background-color: white; font-family: 'Courier New'; font-size: large;"> midslice
=viewer->GetSliceMax()/2;</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: large;">viewer->SetSlice(midslice);</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: large;">viewer->SetSliceOrientationToXY();</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: large;">viewer->GetRender
er()->ResetCamera();</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: large;">viewer->Render();</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; font-family: 'Courier New'; font-size: large;">interactor->Start();</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white; color: blue; font-family: 'Courier New'; font-size: large;">return</span><span style="background-color: white; font-family: 'Courier New'; font-size: large;">
EXIT_SUCCESS;</span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-size: large;"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';">}</span><span style="font-family: 'Courier New';"><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<br />
<div class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: justify;">
<span style="background-color: white; background-position: initial initial; background-repeat: initial initial; color: blue; font-family: 'Courier New';"><span style="font-size: large;">NOTE:</span></span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial; font-family: 'Courier New';"><span style="font-size: large;"> vtkResliceImageViewer provide slice change on scroll by default but vtkImageViewer2
doesn’t provide so we have to code callback, vtkResliceImageViewer also provide
Oblique mode,Reslice mode(default) and SliceChangeEvent
that will be included in next blog.</span><span style="font-size: x-small;"><o:p></o:p></span></span></div>
</div>
VTK QT ITKhttp://www.blogger.com/profile/06611251907711598891noreply@blogger.com0tag:blogger.com,1999:blog-1926867569619153623.post-35994610333868998932013-06-03T04:56:00.000-07:002013-06-03T04:56:31.900-07:00Rendering simple model in VTK<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="background-color: white;">VTK have two major components </span><b>vtk visualization
pipeline</b><span style="background-color: white;"> and </span><b>rendering engine</b><span style="background-color: white;">. Pipeline is used to acquire or create
data, manipulate data and then either write it or to fed to rendering engine.
Rendering engine is composed of classes that are used to display data of
visualization pipeline.</span><br />
<div class="MsoNormal">
<span style="background: white; mso-bidi-font-family: Arial; mso-bidi-font-weight: bold;">VTK is an object oriented system. To use it
effectively understanding of its object model is necessary. Following is a
brief introduction to vtk object model with some useful links.<o:p></o:p></span></div>
<h4 style="text-align: left;">
<span style="background: white;">VTK object model</span></h4>
<div class="MsoNormal">
<span style="background: white; mso-bidi-font-family: Arial; mso-bidi-font-weight: bold;">The VTK object model is rooted in the superclass
vtkObject.<o:p></o:p></span></div>
<div class="MsoNormal">
<b><span style="background: white; mso-bidi-font-family: Arial;">vtkObject</span></b><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial;"> </span></span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial;">is the base class for most objects in the
visualization toolkit.<span class="apple-converted-space"> <o:p></o:p></span></span></div>
<div class="MsoNormal">
<b><span style="background: white; mso-bidi-font-family: Arial;">vtkObject</span></b><span class="apple-converted-space"><span style="background-color: white; background-position: initial initial; background-repeat: initial initial;"> </span></span><span style="background-color: white; background-position: initial initial; background-repeat: initial initial;">provides methods for tracking modification time,
debugging, printing, and event callbacks.<o:p></o:p></span></div>
<div class="MsoNormal">
<b><span style="background: white; mso-bidi-font-family: Arial;">vtkSmartPointer
</span></b><span style="background: white; mso-bidi-font-family: Arial; mso-bidi-font-weight: bold;">class template provide simple way for object management. In smart pointer
implementation pointer automatically manages the reference count.<o:p></o:p></span></div>
<div class="MsoNormal">
<a href="http://www.vtk.org/Wiki/Smart_Pointers"><span style="background: white; mso-bidi-font-family: Arial; mso-bidi-font-weight: bold;">Here</span></a><span style="background: white; mso-bidi-font-family: Arial; mso-bidi-font-weight: bold;">
is very useful document on use of vtkSmartPointer. <o:p></o:p></span></div>
<h4 style="text-align: left;">
<span style="background: white;">VTK Visualization Pipeline</span></h4>
<div class="MsoNormal">
Simplest pipeline have a source of data to be visualized, it
may be a generator as it this case or a reader. This data then set to the input
of <span style="background: white;"><a href="http://www.vtk.org/doc/nightly/html/classvtkMapper.html#details">mapper</a></span>
which maps data into a visual data object <a href="http://www.vtk.org/doc/nightly/html/classvtkActor.html#details">actor</a>,
an actor represent an entity in a rendering scene. Then we have to set a
renderer window having at least one renderer in which this actor will be
visualized. So we will make an object of renderer and add that actor to that
then set that to window. Also for user interaction we will create an interactor
object and add set that to window. Here is a typical vtk graphic subsystem: </div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4ezYPbv3spH2Mfl90c_ZLjrdk9vBexkGRrYVGk7uwzsDstf3WM1a-oUd3gAUerzw9_o8vTCex1g6JXspXG7OZJOAyFUfK2IRUSCW986r8d1mSqjvgrWxItWCzafx13UjiyU3n61Rec94/s1600/renderer.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" height="361" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi4ezYPbv3spH2Mfl90c_ZLjrdk9vBexkGRrYVGk7uwzsDstf3WM1a-oUd3gAUerzw9_o8vTCex1g6JXspXG7OZJOAyFUfK2IRUSCW986r8d1mSqjvgrWxItWCzafx13UjiyU3n61Rec94/s640/renderer.bmp" title="VTK graphic subsytems" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqO6JCm21MuibF0Ip88-2a2wMiptZ71XIRHkoEu_XjfOW3Xso5xIZLWvosY-DckEq02E5KN8Io3S2rG1tnjRtKUMx0mAqy5ylZGM9XnomfOQG-807M46gwggoKvoP9NgDwo12Z54Ko_O0/s1600/vtk.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="187" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqO6JCm21MuibF0Ip88-2a2wMiptZ71XIRHkoEu_XjfOW3Xso5xIZLWvosY-DckEq02E5KN8Io3S2rG1tnjRtKUMx0mAqy5ylZGM9XnomfOQG-807M46gwggoKvoP9NgDwo12Z54Ko_O0/s640/vtk.png" width="640" /></a></div>
<div>
<br /></div>
<br clear="ALL" />
<div class="MsoNormal">
Here is code of a simple vtk pipeline</div>
<div class="MsoNormal">
RenderingSimpleModel.cpp : </div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: blue; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">#include</span><span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: #a31515;">"vtkSmartPointer.h"<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: blue; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">#include</span><span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: #a31515;">"vtkCylinderSource.h"<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: blue; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">#include</span><span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: #a31515;">"vtkPolyDataMapper.h"<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: blue; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">#include</span><span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: #a31515;">"vtkActor.h"<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: blue; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">#include</span><span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: #a31515;">"vtkRenderer.h"<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: blue; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">#include</span><span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: #a31515;">"vtkRenderWindow.h"<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: blue; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">#include</span><span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: #a31515;">"vtkRenderWindowInteractor.h"<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: blue; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">void</span><span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> main()<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">vtkSmartPointer<vtkCylinderSource> source=<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> vtkSmartPointer<vtkCylinderSource>::New();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: green; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">//You can set following parameters in source:</span><span style="background: white; font-family: "Courier New"; font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> source->SetCapping(false);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> source->SetHeight(5);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> source->SetRadius(2);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> source->SetResolution(60);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> source->SetCenter(0.0,1.0,1.0);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> vtkSmartPointer<vtkPolyDataMapper>
mapper = <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> vtkSmartPointer<vtkPolyDataMapper>::New();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> mapper->SetInput(source->GetOutput());<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> vtkSmartPointer<vtkActor
> actor = vtkSmartPointer<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"><vtkActor >::New();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> actor->SetMapper(mapper);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> vtkSmartPointer<vtkRenderer>
ren = vtkSmartPointer<vtkRenderer >::New();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> vtkSmartPointer<vtkRenderWindow
> renwin = vtkSmartPointer<vtkRenderWindow > ::New();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> ren->SetBackground(0,0.5,0.5);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> renwin->AddRenderer(ren);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> renwin->SetSize(200,200);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> ren->AddActor(actor);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> vtkSmartPointer<vtkRenderWindowInteractor
> renint = <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> vtkSmartPointer<vtkRenderWindowInteractor
>::New();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> renwin->SetInteractor(renint);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> renwin->Render();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> renint->Start();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
And Here is CmakeLists.txt:</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;">cmake_minimum_required(VERSION
2.4)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;">if(COMMAND
CMAKE_POLICY)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;"> cmake_policy(SET CMP0003 NEW)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;">endif(COMMAND
CMAKE_POLICY)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;">PROJECT(
RenderingSimpleModel)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;">FIND_PACKAGE
( VTK)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;">IF
( VTK_FOUND)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;">INCLUDE(
${USE_VTK_FILE} )<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;">ENDIF(
VTK_FOUND)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;">INCLUDE_DIRECTORIES(<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;">${myProject_SOURCE_DIR}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;">)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;">ADD_EXECUTABLE(
RenderingSimpleModel RenderingSimpleModel.cpp)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;">TARGET_LINK_LIBRARIES
(RenderingSimpleModel <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;"> ${VTK_LIBRARIES}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-bidi-font-size: 15.0pt; mso-no-proof: yes;">)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
Put both the file in
source folder and cmake using Cmake GUI. Possible error may be "VTK dir
not found" while cmake, in this
case you just have to copy path of VTK bin to the VTK_DIR variable in Cmake
GUI.</div>
</div>
VTK QT ITKhttp://www.blogger.com/profile/06611251907711598891noreply@blogger.com1tag:blogger.com,1999:blog-1926867569619153623.post-92227965539934681412013-04-05T23:41:00.000-07:002013-04-18T01:02:40.651-07:00VTK Installation<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div style="border-bottom: solid #4F81BD 1.0pt; border: none; mso-border-bottom-themecolor: accent1; mso-element: para-border-div; padding: 0in 0in 4.0pt 0in;">
<h2 style="text-align: left;">
VTK Installation for QVTK Configuration</h2>
</div>
<div class="MsoNormal">
Download VTK from</div>
<div class="MsoNormal">
<a href="http://www.vtk.org/VTK/resources/software.html">http://www.vtk.org/VTK/resources/software.html</a></div>
<div class="MsoNormal">
Now follow these steps:</div>
<div class="MsoNormal">
1. Make a
VTK folder where VTK will be installed and build</div>
<div class="MsoNormal">
2. Make two subdirectories
inside VTK folder .Name them src and bin .</div>
<div class="MsoNormal">
3. Extract
all files of downloaded VTK zip file into src</div>
<div class="MsoNormal">
4. Open
Cmake GUI</div>
<div class="MsoNormal">
5. Enter
path of src into <b>Where is the source
code:</b></div>
<div class="MsoNormal">
6. Enter
path of bin into<b> Where to build binaries:</b></div>
<div class="MsoNormal">
7. Click Configure. If compiler selection window popup then select compiler for example if you are building for 64 bit choose 64 bit compiler(Caution: 64 bit VTK Build require 64 bit Qt library for that you can refer our Qt installation 64 bit post).</div>
<div class="MsoNormal">
8. Click on
Checkbox adjacent to VTK_USE_GUISUPPORT [as shown in Figure1].</div>
<div class="MsoNormal">
9. Click
Configure.</div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi47u5bL_ejAS4-4-kNIjjRnjatqHfzUX9jrRFTNLMHeTU3m2YOtagUG9oShxng4Ojz0TiTGPdk6QG2y6XdCtJu89PbS-Bt8DXmg4mRB5gus7R43WaHkiVLrmYKvrGNAZE0jJXjBI1lhP8/s1600/figure1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi47u5bL_ejAS4-4-kNIjjRnjatqHfzUX9jrRFTNLMHeTU3m2YOtagUG9oShxng4Ojz0TiTGPdk6QG2y6XdCtJu89PbS-Bt8DXmg4mRB5gus7R43WaHkiVLrmYKvrGNAZE0jJXjBI1lhP8/s640/figure1.jpg" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="page-break-after: avoid;">
<!--[if gte vml 1]><v:shapetype id="_x0000_t75" coordsize="21600,21600"
o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f"
stroked="f">
<v:stroke joinstyle="miter"/>
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0"/>
<v:f eqn="sum @0 1 0"/>
<v:f eqn="sum 0 0 @1"/>
<v:f eqn="prod @2 1 2"/>
<v:f eqn="prod @3 21600 pixelWidth"/>
<v:f eqn="prod @3 21600 pixelHeight"/>
<v:f eqn="sum @0 0 1"/>
<v:f eqn="prod @6 1 2"/>
<v:f eqn="prod @7 21600 pixelWidth"/>
<v:f eqn="sum @8 21600 0"/>
<v:f eqn="prod @7 21600 pixelHeight"/>
<v:f eqn="sum @10 21600 0"/>
</v:formulas>
<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
<o:lock v:ext="edit" aspectratio="t"/>
</v:shapetype><v:shape id="Picture_x0020_1" o:spid="_x0000_i1027" type="#_x0000_t75"
style='width:489pt;height:468.75pt;visibility:visible;mso-wrap-style:square'>
<v:imagedata src="file:///C:\Users\VM_3\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png"
o:title="" cropleft="4633f" cropright="965f"/>
</v:shape><![endif]--><!--[if !vml]--><!--[endif]--></div>
<div align="center" class="MsoCaption" style="text-align: center;">
Figure <!--[if supportFields]><span
style='mso-element:field-begin'></span><span
style='mso-spacerun:yes'> </span>SEQ Figure \* ARABIC <span style='mso-element:
field-separator'></span><![endif]-->1<!--[if supportFields]><span
style='mso-element:field-end'></span><![endif]--></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
10. Click on Checkbox adjacent to
VTK_USE_QVTK [as shown in Figure2].</div>
<div class="MsoNormal">
11. Check for
DESIRED_QT_VERSION. It should be set itself otherwise write 4 [as shown in
Figure3]. </div>
<div class="MsoNormal">
12. Click on
Checkbox adjacent to BUILD_DOCUMENTATION [as shown in Figure4].</div>
<div class="MsoNormal">
13. Under
Build uncheck BUILD_SHARED_LIB.</div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjseyPRozLIDcB88V4W55TNDK_upM1afBOKDDcyw1VP3_p0o6lJQ3JBER7ffgjR_aJFYGRhCNATrnvbvdVrGSTTu3hoOa_ZCi7SOucib2EEqKu6pqk69SkfG3ZqSKFnlTVoKGA31wjpNn4/s1600/figure2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjseyPRozLIDcB88V4W55TNDK_upM1afBOKDDcyw1VP3_p0o6lJQ3JBER7ffgjR_aJFYGRhCNATrnvbvdVrGSTTu3hoOa_ZCi7SOucib2EEqKu6pqk69SkfG3ZqSKFnlTVoKGA31wjpNn4/s640/figure2.jpg" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal" style="page-break-after: avoid;">
<!--[if gte vml 1]><v:shape id="Picture_x0020_4" o:spid="_x0000_i1026"
type="#_x0000_t75" style='width:437.25pt;height:295.5pt;visibility:visible;
mso-wrap-style:square'>
<v:imagedata src="file:///C:\Users\VM_3\AppData\Local\Temp\msohtmlclip1\01\clip_image003.png"
o:title="" cropbottom="28904f" cropleft="4247f"/>
</v:shape><![endif]--><!--[if !vml]--><!--[endif]--></div>
<div align="center" class="MsoCaption" style="text-align: center;">
Figure <!--[if supportFields]><span
style='mso-element:field-begin'></span><span
style='mso-spacerun:yes'> </span>SEQ Figure \* ARABIC <span style='mso-element:
field-separator'></span><![endif]-->2<!--[if supportFields]><span
style='mso-element:field-end'></span><![endif]--></div>
<div align="center" class="MsoCaption" style="text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvBsFAJdQ0-8RuvxM7IyCqmAQv9tWbbhrDtjS1wbSPTIbgsCo1eYkiboxTXMyUi67_1-9QoEYCyxdgSp1YMPis7HPxnWwlNXZxWVtYvBYuCIj-wukMlkDqlDJMaCvP9FbsamG8Mcmu6lU/s1600/figure3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvBsFAJdQ0-8RuvxM7IyCqmAQv9tWbbhrDtjS1wbSPTIbgsCo1eYkiboxTXMyUi67_1-9QoEYCyxdgSp1YMPis7HPxnWwlNXZxWVtYvBYuCIj-wukMlkDqlDJMaCvP9FbsamG8Mcmu6lU/s640/figure3.jpg" /></a></div>
<div align="center" class="MsoCaption" style="text-align: center;">
<br /></div>
<div class="MsoNormal" style="page-break-after: avoid;">
<!--[if gte vml 1]><v:shape id="Picture_x0020_7" o:spid="_x0000_i1025"
type="#_x0000_t75" style='width:437.25pt;height:276.75pt;visibility:visible;
mso-wrap-style:square'>
<v:imagedata src="file:///C:\Users\VM_3\AppData\Local\Temp\msohtmlclip1\01\clip_image005.png"
o:title="" cropbottom="17741f" cropleft="4361f"/>
</v:shape><![endif]--><!--[if !vml]--><!--[endif]--></div>
<div align="center" class="MsoCaption" style="text-align: center;">
Figure <!--[if supportFields]><span
style='mso-element:field-begin'></span><span
style='mso-spacerun:yes'> </span>SEQ Figure \* ARABIC <span style='mso-element:
field-separator'></span><![endif]-->3<!--[if supportFields]><span
style='mso-element:field-end'></span><![endif]--></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
14. Now click
configure again and generate</div>
<div class="MsoNormal">
15. Now check
for VTK.sln in bin folder and build it in Visual Studio.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<span style="font-size: 18.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">Using QVTK Widget in Qt designer<o:p></o:p></span></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]-->You have to built VTK in release mode, it should
have generated a library file called lib QVTKWidgetPlugin.dll. [only if you are using VTK5.0 for other version you have to keep BUILD_SHARED_LIBS=ON]</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;"> C</span></span>opy this dll in the
[QTinstallDir]/plugins/designer/ directory, the QVTKWidget should show up at
the bottom of the Widget Box (that list of widgets panel on the left in
Designer).</div>
<pre style="line-height: 115%;"><i><span style="font-family: Calibri, sans-serif;"> </span></i></pre>
<div class="MsoNormal">
<br /></div>
</div>
VTK QT ITKhttp://www.blogger.com/profile/06611251907711598891noreply@blogger.com2tag:blogger.com,1999:blog-1926867569619153623.post-74438762970465952192013-03-02T04:11:00.000-08:002013-04-18T00:09:11.499-07:00ITK installation for MSVC<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div style="border-bottom: solid #4F81BD 1.0pt; border: none; mso-border-bottom-themecolor: accent1; mso-element: para-border-div; padding: 0in 0in 4.0pt 0in;">
<h2>
</h2>
<h4>
<span style="font-size: 20.0pt; mso-bidi-font-size: 11.0pt;">ITK:
Insight Tool Kit</span></h4>
</div>
<div class="MsoNoSpacing">
The Insight Toolkit (ITK) is an open-source software
toolkit for performing registration and segmentation.</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="text-align: justify; text-justify: inter-ideograph;">
ITK
is implemented in C++. It is cross-platform, using a build environment known as
CMake to manage the compilation process in a platform-independent way. In
addition, an automated wrapping process (Cable) generates interfaces between
C++ and interpreted programming languages such as Tcl, Java, and Python. This
enables developers to create software using a variety of programming languages.
ITK’s C++ implementation style is referred to as generic programming, which is
to say that it uses templates so that the same code can be applied generically
to any class or type that happens to support the operations used. Such C++
templating means that the code is highly efficient, and that many software
problems are discovered at compile-time, rather than at run-time during program
execution.<br />
<br /></div>
<h3>
Installing ITK</h3>
<div class="MsoNoSpacing">
ITK can be downloaded without cost from the following web
site:</div>
<div class="MsoNoSpacing" style="text-indent: .5in;">
<a href="http://www.itk.org/HTML/Download.php">http://www.itk.org/HTML/Download.php</a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
ITK has been developed and tested across different
combinations of operating systems, compilers, and hardware platforms including
MS-Windows, Linux on Intel-compatible hardware, Solaris, IRIX, Mac OSX, and
Cygwin. It is known to work with the following compilers:</div>
<div class="MsoNoSpacing">
• Visual Studio 6, .NET 2002, .NET 2003</div>
<div class="MsoNoSpacing">
• GCC 2.95.x, 2.96, 3.x</div>
<div class="MsoNoSpacing">
• SGI MIPSpro 7.3x</div>
<div class="MsoNoSpacing">
• Borland 5.5</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
The challenge of supporting ITK across platforms has been
solved through the use of CMake,</div>
<div class="MsoNoSpacing">
a cross-platform, open-source build system.</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
ITK requires at least CMake version 2.0. CMake can be
downloaded at no cost from</div>
<div class="MsoNoSpacing" style="text-indent: .5in;">
<a href="http://www.cmake.org/">http://www.cmake.org</a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
Install cmake.</div>
<div class="MsoNoSpacing">
Now open CMake and for ITK configuration and build follow steps:</div>
<div class="MsoNoSpacing">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzSAiavQOmq7-wYR7AMtuY0UAy9c0YlGtG5ziDONa2GW6LWYIei4MrKd_7BCO-GJ6iPNnBTXB5vvbk9VUUfnk6FdNbmKZydcimLQQPh5uKJzhMKC9MaBxh8hwUTdWtncrDXLVxW9QbE-s/s1600/post2pic1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzSAiavQOmq7-wYR7AMtuY0UAy9c0YlGtG5ziDONa2GW6LWYIei4MrKd_7BCO-GJ6iPNnBTXB5vvbk9VUUfnk6FdNbmKZydcimLQQPh5uKJzhMKC9MaBxh8hwUTdWtncrDXLVxW9QbE-s/s1600/post2pic1.jpg" /></a></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing">
<br /></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->1.<span style="font-size: 7pt;">
</span><!--[endif]-->Make an ITK folder where ITK will be installed and
build</div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->2.<span style="font-size: 7pt;">
</span><!--[endif]-->Make two subdirectories inside ITK folder named <b><i>src</i></b>
and <b><i>bin</i></b></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->3.<span style="font-size: 7pt;">
</span><!--[endif]-->Extract all files of downloaded ITK zip file
into <b><i>src</i></b></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->4.<span style="font-size: 7pt;">
</span><!--[endif]-->Open Cmake gui</div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->5.<span style="font-size: 7pt;">
</span><!--[endif]-->Enter path of <b><i>src</i></b> into <b><i>Where is the source code</i></b></div>
<div class="MsoNoSpacing" style="margin-left: .5in; mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->6.<span style="font-size: 7pt;">
</span><!--[endif]-->Enter path of <b><i>bin</i></b> into <b><i>Where
to build binaries</i></b></div>
<div class="MsoNoSpacing">
<v:shapetype coordsize="21600,21600" filled="f" id="_x0000_t75" o:preferrelative="t" o:spt="75" path="m@4@5l@4@11@9@11@9@5xe" stroked="f">
<v:stroke joinstyle="miter">
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0">
<v:f eqn="sum @0 1 0">
<v:f eqn="sum 0 0 @1">
<v:f eqn="prod @2 1 2">
<v:f eqn="prod @3 21600 pixelWidth">
<v:f eqn="prod @3 21600 pixelHeight">
<v:f eqn="sum @0 0 1">
<v:f eqn="prod @6 1 2">
<v:f eqn="prod @7 21600 pixelWidth">
<v:f eqn="sum @8 21600 0">
<v:f eqn="prod @7 21600 pixelHeight">
<v:f eqn="sum @10 21600 0">
</v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas>
<v:path gradientshapeok="t" o:connecttype="rect" o:extrusionok="f">
<o:lock aspectratio="t" v:ext="edit">
</o:lock></v:path></v:stroke></v:shapetype><v:shape id="Picture_x0020_2" o:spid="_x0000_s1027" style="height: 322.5pt; margin-left: -5.25pt; margin-top: 8.25pt; mso-position-horizontal-relative: text; mso-position-horizontal: absolute; mso-position-vertical-relative: text; mso-position-vertical: absolute; mso-wrap-distance-bottom: 0; mso-wrap-distance-left: 9pt; mso-wrap-distance-right: 9pt; mso-wrap-distance-top: 0; mso-wrap-style: square; position: absolute; visibility: visible; width: 350.25pt; z-index: -2;" type="#_x0000_t75" wrapcoords="-93 0 -93 21500 21646 21500 21646 0 -93 0">
<v:imagedata cropbottom="2434f" cropleft="12939f" cropright="17883f" croptop="6179f" o:title="" src="file:///C:\Users\VM_3\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png">
<w:wrap type="tight">
</w:wrap></v:imagedata></v:shape></div>
<div class="MsoListParagraph" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->7.<span style="font-size: 7pt;">
</span><!--[endif]-->Now click on <b><i>Configure<o:p></o:p></i></b></div>
<div class="MsoNormal">
8. Select compiler for example if you are building for 64 bit choose 64 bit compiler.<br />
9. Select configuration options according to your need and configure again till red selection disappeared.</div>
<div class="MsoNormal">
10. Then click on <b><i>Generate</i></b></div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->11.<span style="font-size: 7pt;"> </span>Now close Cmake and go in <b><i>bin</i></b> of ITK find ITK.sln
file and click on it, it will open Visual Studio</div>
<div class="MsoListParagraphCxSpLast" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
12.<span style="font-size: 7pt;"> </span>In <b><i>solution explorer </i></b> select <b>ALL_BUILD</b>
and build it [build will take around 90 minutes]</div>
<div class="MsoNormal">
<br />
Now ITK library build.</div>
<div class="MsoNormal">
<br /></div>
<h2>
Testing Built by HelloWorld Example</h2>
<div class="MsoNormal">
Go to \ITK\SRC\Examples\Installation folder and copy both
files <b><i>CMakeLists.txt</i></b> and <b><i>HelloWorld.cpp<o:p></o:p></i></b></div>
<div class="MsoNormal">
Make a test folder with src and bin subfolders</div>
<div class="MsoNormal">
Paste both files into src</div>
<div class="MsoNormal">
Open Cmake and give path of src in source code and of bin in
binary and configure then generate</div>
<div class="MsoNormal">
Open bin of test folder and click on HelloWorld.sln it will
open Visual Studio</div>
<div class="MsoNormal">
Now build if error then ITK install is not ok.</div>
<div class="MsoNormal">
After build open bin folder of test and check debug folder
if there is an exe of HelloWorld exist if it is then ITK installed and build is
ok.<br />
<br /></div>
</div>
VTK QT ITKhttp://www.blogger.com/profile/06611251907711598891noreply@blogger.com3tag:blogger.com,1999:blog-1926867569619153623.post-67734135906233712602013-02-11T22:49:00.000-08:002013-05-16T23:24:57.993-07:00Customize widget: Creating new signal and slots<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<h1>
Customize widget</h1>
<div class="MsoNormal">
<span style="font-family: Times, Times New Roman, serif;">Qt provide list of widgets that we can use with signal and
slot as we used in last blog. We used QWidget as a container in our last
example. We can make combination of Qt widgets, that can be used as a single object
or widget having its own signal and slots . It is possible by inheriting
QWidget class and adding components to it. Here is a complete example with
explanation: </span></div>
<div class="MsoNormal">
<span style="font-family: Times, Times New Roman, serif;">First we have to specify what it will do?</span></div>
<div class="MsoNormal">
<span style="font-family: Times, Times New Roman, serif;">We are going to make a widget which is a dialog box that can
take user's input to add or remove RGB point in a color transfer function of a
volume visualization object. It require following inputs:</span></div>
<div class="MsoNormal">
<span style="font-family: Times, Times New Roman, serif;"><br /></span></div>
<div class="MsoNormal">
</div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->1.<span style="font-size: 7pt;">
</span><!--[endif]-->Point where user want to add/remove RGB values</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->2.<span style="font-size: 7pt;">
</span><!--[endif]-->Value of R</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->3.<span style="font-size: 7pt;">
</span><!--[endif]-->Value of G</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->4.<span style="font-size: 7pt;">
</span><!--[endif]-->Value of B</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->5.<span style="font-size: 7pt;">
</span><!--[endif]-->User want to add</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; tab-stops: 133.5pt; text-indent: -.25in;">
<!--[if !supportLists]-->6.<span style="font-size: 7pt;"> </span><!--[endif]-->User
want to remove </div>
<div class="MsoListParagraphCxSpLast" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->7.<span style="font-size: 7pt;">
</span><!--[endif]-->User don't want any action</div>
<div class="MsoListParagraphCxSpLast" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<br /></div>
<div class="MsoListParagraphCxSpLast" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
</div>
<div class="MsoNormal">
Now we have to use appropriate Qt widgets to get these
inputs. So here is the list:</div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->1.<span style="font-size: 7pt;">
</span><!--[endif]-->Point where user want to add/remove RGB values:
spinbox that is QSpinBox.</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->2.<span style="font-size: 7pt;">
</span><!--[endif]-->Value of R: Since we want that user can specify
a smallest value 0.1 so we need a spinbox that take double value, so
QDoubleSpinBox.</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->3.<span style="font-size: 7pt;">
</span><!--[endif]-->Value of G: QDoubleSpinBox</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->4.<span style="font-size: 7pt;">
</span><!--[endif]-->Value of B: QDoubleSpinBox</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->5.<span style="font-size: 7pt;">
</span><!--[endif]-->User want to add: an Add button so QPushButton</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->6.<span style="font-size: 7pt;">
</span><!--[endif]-->User want to remove: A Remove button so again
QPushButton</div>
<div class="MsoListParagraphCxSpLast" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->7.<span style="font-size: 7pt;">
</span><!--[endif]-->User don't want any action: a cancel button,
QPushButton</div>
<div class="MsoNormal">
These input should be passed by widget to the main
application where these parameters will be used. So we have to make a signal
which will carry all the input information and pass it to slot of main
application that will be connected to it.</div>
<div class="MsoNormal">
We have decided the way of input and output now how widget
should appear?</div>
<div class="MsoNormal">
First we have to decide what other things required to make widget's
presentation more informative to user and second draw a rough layout where we
want to place these all widgets.</div>
<div class="MsoNormal">
We need labels for each spinbox to show which spinbox can be
use to input point/r/g/b. Also some layout objects to position these all widgets
as so that our widget appear as:</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcusFarL8ylsG11uriOnYdOOFldT85rEc69h2hkaa1H1l0o7RWuMJHWHAQWT300D_Q8E22DYMFmSiCYPoDA4z_8OEjkk25C_jkIv9zaADIkD-xtO4tqu93gbMDHaVRE1DQrffGEADA23w/s1600/blg.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcusFarL8ylsG11uriOnYdOOFldT85rEc69h2hkaa1H1l0o7RWuMJHWHAQWT300D_Q8E22DYMFmSiCYPoDA4z_8OEjkk25C_jkIv9zaADIkD-xtO4tqu93gbMDHaVRE1DQrffGEADA23w/s1600/blg.jpg" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="MsoNormal">
Now we have to define class
of our widget. Make a header file with name ColorTFWidget.h<o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: .0001pt; margin-bottom: 0in;">
as follow:<o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><span style="background: white; color: blue; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">#ifndef</span><span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> _ColorTFWidget_H_<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><span style="background: white; color: blue; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">#define</span><span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> _ColorTFWidget_H_<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><span style="background: white; color: blue; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">#include</span><span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: #a31515;"><QWidget><o:p></o:p></span></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><span style="background: white; color: blue; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">class</span><span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> QPushButton;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><span style="background: white; color: blue; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">class</span><span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> QSpinBox;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><span style="background: white; color: blue; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">class</span><span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> QDoubleSpinBox;<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><span style="background: white; color: blue; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">class</span><span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> ColorTFWidget : <span style="color: blue;">public</span> QWidget<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: blue;">Q_OBJECT<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><span style="background: white; color: blue; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">public</span><span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">:<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> ColorTFWidget(QWidget
* parent = 0);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> ~ColorTFWidget();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><span style="background: white; color: blue; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">private</span><span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">:<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> QSpinBox
* point ;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> QDoubleSpinBox
* r ; <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> QDoubleSpinBox
* g ;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> QDoubleSpinBox
* b;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> QPushButton
* Add;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> QPushButton
* Remove;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> QPushButton
* Cancel;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><span style="background: white; color: blue; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">signals</span><span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">:<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: blue;">void</span> SignalColorTF(<span style="color: blue;">int</span>
action, <span style="color: blue;">int</span> point, <span style="color: blue;">double</span>
r, <span style="color: blue;">double</span> g, <span style="color: blue;">double</span>
b );<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><br /></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><span style="background: white; color: blue; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">private</span><span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: blue;">slots</span>:<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: green;">//internal slots<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: blue;">void</span> OnAdd();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: blue;">void</span> OnRemove();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">};<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background-color: white;"><br /></span></div>
<div class="MsoNormal">
<span style="background-color: white;"><span style="background: white; color: blue; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;">#endif</span><span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-bidi-font-size: 15.0pt; mso-highlight: white; mso-no-proof: yes;"> _ColorTFWidget_H_</span></span><span style="font-size: 8.0pt; mso-bidi-font-size: 11.0pt; mso-no-proof: yes;"><o:p></o:p></span></div>
<div class="MsoNormal">
As a general rule starting
with header gaurds we are includeing QWidget since our class is inheriting it. For
other classes that belong to widgets we are using forwared declaration. <o:p></o:p></div>
<div class="MsoNormal">
If you having question that why
we are doing forward declaration? <a href="http://www.cplusplus.com/forum/articles/10627/">here</a> is a nice
explanation.<o:p></o:p></div>
<div class="MsoNormal">
We are inherting QWidget with
public scope. Since we are going to make our own signal and slots it is
mandatory to add Q_OBJECT macro in the class defination. <o:p></o:p></div>
<div class="MsoNormal">
Q_OBJECT macro is responsible
to involve meta object compiler(moc). Here
<i>moc</i> will generate neccessary code to
setup signal slot mechanism. You can
find more info about <i>moc </i><a href="http://qt-project.org/doc/qt-4.8/moc.html">here</a>.<o:p></o:p></div>
<div class="MsoNormal">
Constructor and destructor
will be defined in cpp file.<o:p></o:p></div>
<div class="MsoNormal">
We are creating data members
only those widgets that are input or output or objects those will be accessed
by any method of class.<o:p></o:p></div>
<div class="MsoNormal">
Other objects like layouts and labels will not
be changed once they created and not used by any method so they will be created
and added to widget in consturctor.<o:p></o:p></div>
<div class="MsoNormal">
Signal <i>SignalColorTF </i>will provide connectivty to our widget object to
share its data with other widget. This signal have five parameters which we
want to pass. action will be used as a flag whcih carry info about either user
want to remove point or add. <o:p></o:p></div>
<div class="MsoNormal">
Widget is having two internal
slots there use will be clear in cpp file by there defination.<o:p></o:p><br />
<br />
<a name='more'></a><br /></div>
<div class="MsoNormal">
cpp file of class is as
follows:<o:p></o:p></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: green; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">//include class declaration header<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: blue; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">#include</span><span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: #a31515;">"ColorTFWid.h"<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: green; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">//include all headers of widgets used in class else
those added in headers<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: blue; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">#include</span><span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: #a31515;"><QPushButton><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: blue; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">#include</span><span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: #a31515;"><QSpinBox><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: blue; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">#include</span><span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: #a31515;"><QDoubleSpinBox><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: blue; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">#include</span><span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: #a31515;"><QHBoxLayout><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: blue; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">#include</span><span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: #a31515;"><QVBoxLayout><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: blue; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">#include</span><span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: #a31515;"><QLabel><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">ColorTFWidget::ColorTFWidget(QWidget * parent
):QWidget(parent)<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: green; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">//parent is used to make this widget a child of some
other widget<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: green;">//creating label <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: green;">// ampersion symbol (&) before any word will make it as
a Alt+ shortcut key<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: green;">//to select its buddy widget<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> QLabel * pointlabel
= <span style="color: blue;">new</span> QLabel(<span style="color: #a31515;">"At
&Point: "</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: green;">//instantiating spin box<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> point = <span style="color: blue;">new</span> QSpinBox;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: green;">//setting range of spin box<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> point->setRange(0,1024);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: green;">//a buddy is widget that will be selected when Alt +
shortcut key pressed <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> pointlabel->setBuddy(point);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> QLabel * rlabel = <span style="color: blue;">new</span> QLabel(<span style="color: #a31515;">"&R:
"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> r = <span style="color: blue;">new</span> QDoubleSpinBox;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> r->setSingleStep(0.1);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> r->setRange(0,255);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> rlabel->setBuddy(r);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> QLabel * glabel = <span style="color: blue;">new</span> QLabel(<span style="color: #a31515;">"&G:
"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> g = <span style="color: blue;">new</span> QDoubleSpinBox;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> g->setSingleStep(0.1);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> r->setRange(0,255);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> glabel->setBuddy(g);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> QLabel * blabel = <span style="color: blue;">new</span> QLabel(<span style="color: #a31515;">"&B:
"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> b = <span style="color: blue;">new</span> QDoubleSpinBox;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> b->setSingleStep(0.1);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> b->setRange(0,255);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> blabel->setBuddy(b);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: green;">//creating layout to arrange labels in a horizontal line<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> QHBoxLayout *
labelLayout = <span style="color: blue;">new</span> QHBoxLayout;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: green;">//adding labels to layout according to order they shoud
appear<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> labelLayout->addWidget
(pointlabel);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> labelLayout->addWidget
(rlabel);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> labelLayout->addWidget
(glabel);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> labelLayout->addWidget
(blabel);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: green;">//creating layout for spin boxes<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> QHBoxLayout *
spinboxLayout = <span style="color: blue;">new</span> QHBoxLayout;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: green;">//adding spin box to layout according to order they should
appear<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> spinboxLayout->addWidget
(point);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> spinboxLayout->addWidget
(r);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> spinboxLayout->addWidget
(g);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> spinboxLayout->addWidget
(b);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: green;">//adding layouts to a vertical layout<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> QVBoxLayout *
upperLayout = <span style="color: blue;">new</span> QVBoxLayout;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> upperLayout->addLayout(labelLayout);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> upperLayout->addLayout(spinboxLayout);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: green;">//creating pushbuttons<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> Add = <span style="color: blue;">new</span> QPushButton(<span style="color: #a31515;">"Add"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> Remove = <span style="color: blue;">new</span> QPushButton(<span style="color: #a31515;">"Remove"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> Cancel = <span style="color: blue;">new</span> QPushButton(<span style="color: #a31515;">"Cancel"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: green;">//creating button layout and adding them <o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> QHBoxLayout *
buttonLayout = <span style="color: blue;">new</span> QHBoxLayout;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> buttonLayout->addWidget(Add);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> buttonLayout->addWidget(Remove);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> buttonLayout->addWidget(Cancel);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: green;">//arranging all layouts in a single layout<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> QVBoxLayout *
mainLayout = <span style="color: blue;">new</span> QVBoxLayout(<span style="color: blue;">this</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> mainLayout->addLayout(upperLayout);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> mainLayout->addLayout(buttonLayout);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: green;">//we can set single layout to a QWidget<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: blue;">this</span>->setLayout(mainLayout);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: green;">//adding title of window<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: blue;">this</span>->setWindowTitle(<span style="color: #a31515;">"Edit
Color TF"</span>);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: green;">//connecting buttons signal to internal slots<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> connect(Add,<span style="color: blue;">SIGNAL</span>(clicked()),<span style="color: blue;">this</span>,<span style="color: blue;">SLOT</span>(OnAdd()));<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> connect(Remove,<span style="color: blue;">SIGNAL</span>(clicked()),<span style="color: blue;">this</span>,<span style="color: blue;">SLOT</span>(OnRemove()));<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> connect(Cancel,<span style="color: blue;">SIGNAL</span>(clicked()),<span style="color: blue;">this</span>,<span style="color: blue;">SLOT</span>(close()));<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">ColorTFWidget::~ColorTFWidget()<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: green;">//delete all widgets<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: blue;">delete</span> point ;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: blue;">delete</span> r; <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: blue;">delete</span> g;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: blue;">delete</span> b;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: blue;">delete</span> Add;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: blue;">delete</span> Remove;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: blue;">delete</span> Cancel;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: blue; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">void</span><span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">
ColorTFWidget::OnAdd()<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: green;">// when Add is clicked this slot will emit signal with
following information<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: blue;">emit</span> SignalColorTF( 1, point->value(),
r->value(),g->value(),b->value());<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: blue;">this</span>->close();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">}<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: blue; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">void</span><span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">
ColorTFWidget::OnRemove()<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: green;">// when Remove is clicked this slot will emit signal with
following information<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: blue;">emit</span> SignalColorTF( 0, point->value(),
r->value(),g->value(),b->value());<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: blue;">this</span>->close();<o:p></o:p></span></div>
<div class="MsoNormal">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; line-height: 115%; mso-highlight: white; mso-no-proof: yes;">}</span><span style="font-family: "Courier New"; font-size: 12.0pt; line-height: 115%; mso-no-proof: yes;"><o:p></o:p></span></div>
<div class="MsoNormal">
<span style="font-size: 12.0pt; line-height: 115%; mso-no-proof: yes;">Now write a main.cpp to use this widget:<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: blue; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">#include</span><span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: #a31515;"><QApplication><o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: blue; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">#include</span><span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: #a31515;">"ColorTFWid.h"<o:p></o:p></span></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; color: blue; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">int</span><span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> main(<span style="color: blue;">int</span> argc, <span style="color: blue;">char</span>
*argv[])<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">{<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> QApplication
a(argc, argv);<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> ColorTFWidget w;<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> w.show();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;"> <span style="color: blue;">return</span> a.exec();<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="background: white; font-family: "Courier New"; font-size: 12.0pt; mso-highlight: white; mso-no-proof: yes;">}<o:p></o:p></span></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
To do:<o:p></o:p></div>
<div class="MsoNormal">
You can make another widget
in main and can connect ColorTFWidget's signal to slot of another widget to
display those values.<o:p></o:p></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Error log:</div>
<div class="MsoNormal">
1.If you make a mistake in connection like this:</div>
<div class="MsoNormal">
<span style="text-indent: 0px;">connect</span><span style="text-indent: 0px;">(</span><span style="color: maroon; text-indent: 0px;">Add</span><span style="text-indent: 0px;">,</span><span style="color: olive; text-indent: 0px;">SIGNAL</span><span style="text-indent: 0px;">(</span><span style="text-indent: 0px;">clicked</span><span style="text-indent: 0px;">()),</span><span style="color: olive; text-indent: 0px;">this</span><span style="text-indent: 0px;">,</span><span style="color: olive; text-indent: 0px;">SLOT</span><span style="text-indent: 0px;">(</span><span style="text-indent: 0px;">OnAdd</span><span style="text-indent: 0px;">(int)));</span></div>
<div class="MsoNormal">
<span style="text-indent: 0px;">It will not cause any compiler error but your signal will not be connected to slot. A warning will be print on command line.</span><br />
It happens usually when you edit slots or when slot have parameters.<br />
In slots that have parameters for example OnABCD(int a) if you write parameter name in connect<br />
connect(<span style="color: maroon;">Add</span>,<span style="color: olive;">SIGNAL</span>(clicked()),<span style="color: olive;">this</span>,<span style="color: olive;">SLOT</span>(OnABCD(int a)));<br />
same problem will appear.<br />
<br />
<br />
2. Some linker errors like following will appear if you forget to add header and cpp properly to .pro. Don't forget to qmake after any change in .pro file.<br />
<br />
main.obj:-1: error: LNK2019: unresolved external symbol "public: virtual __cdecl ColorTFWidget::~ColorTFWidget(void)" (??1ColorTFWidget@@UEAA@XZ) referenced in function main<br />
<br />
Sometimes you need to clean build and then qmake to generate new moc rules.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<br /></div>
VTK QT ITKhttp://www.blogger.com/profile/06611251907711598891noreply@blogger.com3tag:blogger.com,1999:blog-1926867569619153623.post-79607034282989061822013-02-03T22:32:00.000-08:002013-04-17T23:40:49.453-07:00Basic Qt Programming: Multiple widgets on a window<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<h1>
Multiple widgets</h1>
<div class="MsoNormal">
We can connect two Qt widgets through signal slot mechanism.
Also an introduction to QWidget and QLayout.
</div>
<div class="MsoNormal">
We are going to make a simple window having a text edit line
and a label which will show whatever text entered by user. In last example we
used only one widget that was QPushButton.
Now two new widgets QLineEdit for text edit line and QLabel for text
label will be used. If we go through the pattern of last example and code as :</div>
<pre><span style="color: navy; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">#include</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: green; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><QApplication></span></pre>
<pre><span style="color: navy; font-size: 13pt;">#include</span><span style="color: silver; font-size: 13pt;"> </span><span style="color: green; font-size: 13pt;"><QLineEdit></span></pre>
<pre><span style="color: navy; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">#include</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: green; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><QLabel></span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span></pre>
<pre><span style="color: olive; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">int</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">main(<span style="color: olive;">int</span><span style="color: silver;"> </span>argc,<span style="color: silver;"> </span><span style="color: olive;">char</span><span style="color: silver;"> </span>*argv[])<o:p></o:p></span></pre>
<pre><span style="font-size: 13pt;">{</span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QApplication</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">a(argc,</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">argv);</span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QLineEdit</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">*</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">lineEdit</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">=</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: olive; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">new</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QLineEdit</span><span style="font-size: 13pt;">(</span><span style="color: green; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">"Write here"</span><span style="font-size: 13pt;">);</span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QLabel</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">*</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">label</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">=</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: olive; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">new</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QLabel</span><span style="font-size: 13pt;">();</span></pre>
<pre><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> <span style="color: purple;">QObject</span>::connect(lineEdit,<span style="color: olive;">SIGNAL</span>(textChanged(<span style="color: purple;">QString</span>)), label, <span style="color: olive;">SLOT</span>(setText(<span style="color: purple;">QString</span>)));</span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">lineEdit-></span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">show();<o:p></o:p></span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">label-></span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">show();</span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: olive; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">return</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">a.</span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">exec();<o:p></o:p></span></pre>
<pre><span style="font-size: 13pt;">}</span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><o:p> </o:p></pre>
<div class="MsoNormal">
You will get some odd results. </div>
<div class="MsoNormal">
What we need should appear in a single window. So to get
more than one widget on a single window we have to use QWidget it provide a
plane window on which we can put multiple Qt widgets or I can say group those
in one.</div>
<div class="MsoNormal">
We will create a QWidget and then make it parent of all other
widgets that we want to be on a single window. </div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Now my code became as:</div>
<pre><span style="color: navy; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">#include</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: green; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><QApplication><o:p></o:p></span></pre>
<pre><span style="color: navy; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">#include</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: green; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><QWidget></span><span style="font-size: 16.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><span style="color: navy; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">#include</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: green; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><QLineEdit></span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><span style="color: navy; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">#include</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: green; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><QLabel></span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span></pre>
<pre><span style="color: olive; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">int</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">main(<span style="color: olive;">int</span><span style="color: silver;"> </span>argc,<span style="color: silver;"> </span><span style="color: olive;">char</span><span style="color: silver;"> </span>*argv[])<o:p></o:p></span></pre>
<pre><span style="font-size: 13pt;">{</span></pre>
<pre><span style="color: silver; font-size: 13pt;"> </span><span style="color: purple; font-size: 13pt;">QApplication</span><span style="color: silver; font-size: 13pt;"> </span><span style="font-size: 13pt;">a(argc,</span><span style="color: silver; font-size: 13pt;"> </span><span style="font-size: 13pt;">argv);</span><span style="font-size: 13pt;"> </span></pre>
<pre><span style="color: green; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">// Making parent widget</span><span style="font-size: 16.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QWidget</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">*</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">widget</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">=</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: olive; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">new</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QWidget</span><span style="font-size: 13pt;">;</span></pre>
<pre><span style="color: green; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">//arguemnt of constructor defining widget as a parent of line Edit</span><span style="font-size: 16.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QLineEdit</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">*</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">lineEdit</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">=</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: olive; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">new</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QLineEdit</span><span style="font-size: 13pt;">(</span><span style="color: green; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">"Writehere"</span><span style="font-size: 13pt;">,widget);</span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QLabel</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">*</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">label</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">=</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: olive; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">new</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QLabel</span><span style="font-size: 13pt;">(widget);</span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QObject</span><span style="font-size: 13pt;">::</span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">connect(lineEdit,<span style="color: olive;">SIGNAL</span>(textChanged(<span style="color: purple;">QString</span>)),label,<span style="color: olive;">SLOT</span>(setText(<span style="color: purple;">QString</span>)));</span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">widget-></span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">show();<span style="color: green;">//Showing parent will show all its childern</span></span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: olive; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">return</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">a.</span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">exec();<o:p></o:p></span></pre>
<pre><span style="font-size: 13pt;">}</span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span></pre>
<div class="MsoNormal">
When you run this you can see both widgets coming together but they are overlapped. Here
the need of layout come. So we have to make a layout. Here we are going to use
QVBoxLayout which will provide arrangement of widgets vertically you can use
QHBoxLayout for horizontal arrangement. We can add widgets in the layout and
then add that layout to the widget. </div>
<div class="MsoNormal">
A QWidget allow to set single layout. </div>
<div class="MsoNormal">
So our code became now:</div>
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;"><br clear="all" style="mso-special-character: line-break; page-break-before: always;" />
</span>
<br />
<div class="MsoNormal">
<br /></div>
<pre><span style="color: navy; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">#include</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: green; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><QApplication></span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><span style="color: navy; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">#include</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: green; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><QLineEdit></span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><span style="color: navy; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">#include</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: green; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><QLabel></span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><span style="color: navy; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">#include</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: green; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><QVBoxLayout></span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><span style="color: navy; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">#include</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: green; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><QWidget></span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span></pre>
<pre><span style="color: olive; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">int</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">main(<span style="color: olive;">int</span><span style="color: silver;"> </span>argc,<span style="color: silver;"> </span><span style="color: olive;">char</span><span style="color: silver;"> </span>*argv[])<o:p></o:p></span></pre>
<pre><span style="font-size: 13pt;">{</span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QApplication</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">a(argc,</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">argv);</span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QWidget</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">*</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">widget</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">=</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: olive; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">new</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QWidget</span><span style="font-size: 13pt;">;</span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QVBoxLayout</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">*</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">layout</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">=</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: olive; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">new</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QVBoxLayout</span><span style="font-size: 13pt;">;</span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QLineEdit</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">*</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">lineEdit</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">=</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: olive; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">new</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QLineEdit</span><span style="font-size: 13pt;">(</span><span style="color: green; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">"Write here"</span><span style="font-size: 13pt;">,widget);</span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QLabel</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">*</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">label</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">=</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: olive; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">new</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QLabel</span><span style="font-size: 13pt;">(widget);</span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">layout-></span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">addWidget(lineEdit);<o:p></o:p></span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">layout-></span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">addWidget(label);</span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">widget-></span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">setLayout(layout);</span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QObject</span><span style="font-size: 13pt;">::</span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">connect(lineEdit,<span style="color: olive;">SIGNAL</span>(textChanged(<span style="color: purple;">QString</span>)), label,<span style="color: olive;">SLOT</span>(setText(<span style="color: purple;">QString</span>)));<o:p></o:p></span></pre>
<pre><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">widget-></span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">show();</span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: olive; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">return</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">a.</span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">exec();<o:p></o:p></span></pre>
<pre><span style="font-size: 13pt;">}</span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><o:p> </o:p></pre>
<div class="MsoNormal">
Here we get final results. Here if you remove parent of
label and lineEdit they will still appear on window cause through layout they
are now inside window. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnUJV4NjK2snRM9F7nGr0k_0pL_Z7QSueVfeXPebLLDzkC7N6QwyISdmoIAb2dG7czWJeyj5qUWBQIVmhhE0vOLaN1RVaSTrl2Upq-FIAd15B_ugTVmmBrAeVq-jcSu2-_raoaxwMGWGw/s1600/Blog.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnUJV4NjK2snRM9F7nGr0k_0pL_Z7QSueVfeXPebLLDzkC7N6QwyISdmoIAb2dG7czWJeyj5qUWBQIVmhhE0vOLaN1RVaSTrl2Upq-FIAd15B_ugTVmmBrAeVq-jcSu2-_raoaxwMGWGw/s320/Blog.png" height="217" width="320" /></a></div>
<br />
<br /></div>
<div class="MsoNormal">
Now try these:</div>
<div style="margin-bottom: .0001pt; margin: 0in;">
1. <span style="font-family: "Calibri","sans-serif"; mso-ascii-theme-font: minor-latin; mso-bidi-theme-font: minor-latin; mso-hansi-theme-font: minor-latin;">Add these lines one by one before setLayout function call and see
what changes came due to each. Also try with changing their values.<o:p></o:p></span></div>
<div style="margin-bottom: .0001pt; margin: 0in;">
<br /></div>
<pre><span style="color: silver;"> </span><span style="font-size: 13pt;">layout-></span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">setMargin(<span style="color: navy;">55</span>);<o:p></o:p></span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">layout-></span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">setStretch(<span style="color: navy;">0</span>,<span style="color: navy;">1</span>);<o:p></o:p></span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">layout-></span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">setSpacing(<span style="color: navy;">50</span>);<o:p></o:p></span></pre>
</div>
VTK QT ITKhttp://www.blogger.com/profile/06611251907711598891noreply@blogger.com0tag:blogger.com,1999:blog-1926867569619153623.post-68676837085627139192013-01-08T06:07:00.000-08:002013-03-29T21:33:32.979-07:00Basic Qt Programming: Creator and First program<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div class="MsoNormal">
Before going to start programming in Qt here we explaining
how to start with Qt Creator to make your project.</div>
<div class="MsoNormal">
Launch Qt Creator and
go on file menu and choose new it will open following window:</div>
<div class="MsoNormal">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsUMOSCcOfohyVS3og12XrR750PMrQzB1N5Kc6Ngv81fMyBD86iKwX2Hn2AXzy8aRsUgh4OU48b-bmf8ptNmRLnOecM_BiwsjWXmpOF9NCjkzXhuBhxvf-FoFGHydIjsXEMd1ScqEqMVM/s1600/abc.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="253" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgsUMOSCcOfohyVS3og12XrR750PMrQzB1N5Kc6Ngv81fMyBD86iKwX2Hn2AXzy8aRsUgh4OU48b-bmf8ptNmRLnOecM_BiwsjWXmpOF9NCjkzXhuBhxvf-FoFGHydIjsXEMd1ScqEqMVM/s400/abc.png" width="400" /></a></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<o:wrapblock><v:shapetype coordsize="21600,21600" filled="f" id="_x0000_t75" o:preferrelative="t" o:spt="75" path="m@4@5l@4@11@9@11@9@5xe" stroked="f">
<v:stroke joinstyle="miter">
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0">
<v:f eqn="sum @0 1 0">
<v:f eqn="sum 0 0 @1">
<v:f eqn="prod @2 1 2">
<v:f eqn="prod @3 21600 pixelWidth">
<v:f eqn="prod @3 21600 pixelHeight">
<v:f eqn="sum @0 0 1">
<v:f eqn="prod @6 1 2">
<v:f eqn="prod @7 21600 pixelWidth">
<v:f eqn="sum @8 21600 0">
<v:f eqn="prod @7 21600 pixelHeight">
<v:f eqn="sum @10 21600 0">
</v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:f></v:formulas>
<v:path gradientshapeok="t" o:connecttype="rect" o:extrusionok="f">
<o:lock aspectratio="t" v:ext="edit">
</o:lock></v:path></v:stroke></v:shapetype><v:shape id="Picture_x0020_3" o:spid="_x0000_s1026" style="height: 192.75pt; margin-left: 51.75pt; margin-top: 7pt; mso-position-horizontal-relative: text; mso-position-horizontal: absolute; mso-position-vertical-relative: text; mso-position-vertical: absolute; mso-wrap-distance-bottom: 0; mso-wrap-distance-left: 9pt; mso-wrap-distance-right: 9pt; mso-wrap-distance-top: 0; mso-wrap-style: square; position: absolute; visibility: visible; width: 306.75pt; z-index: -1;" type="#_x0000_t75">
<v:imagedata cropbottom="8546f" cropleft="10101f" cropright="12402f" croptop="8895f" o:title="" src="file:///C:\Users\VM_3\AppData\Local\Temp\msohtmlclip1\01\clip_image001.png">
<w:wrap type="topAndBottom">
</w:wrap></v:imagedata></v:shape></o:wrapblock><br />
You have to choose Projects >>Application>>Qt Console Project and
click on “choose”</div>
<div class="MsoNormal">
Then in next window give project name and select location
and click on “Next”.</div>
<div class="MsoNormal">
Select “Desktop” in target setup
window click “Next” </div>
<div class="MsoNormal">
Click “Finish” in summery window.</div>
<div class="MsoNormal">
This will open your project.</div>
<div class="MsoNormal">
In the left you can see project
tree under which one .pro file and one .cpp file present.</div>
<div class="MsoNormal">
.pro file is Qt Project file which contains all the
information required by qmake to build your application, library, or plugin.</div>
<div class="MsoNormal">
qmake is a tool that helps simplify the build process for
development project across different platforms.</div>
<div class="MsoNormal">
Your .pro file will have some content as:</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<pre><span style="color: green;">#-------------------------------------------------</span></pre>
<pre><span style="color: green;">#</span></pre>
<pre><span style="color: green;">#</span><span style="color: silver;"> </span><span style="color: green;">Project</span><span style="color: silver;"> </span><span style="color: green;">created</span><span style="color: silver;"> </span><span style="color: green;">by</span><span style="color: silver;"> </span><span style="color: green;">QtCreator</span><span style="color: silver;"> </span><span style="color: green;">2013-01-07T00:02:18</span></pre>
<pre><span style="color: green;">#</span></pre>
<pre><span style="color: green;">#-------------------------------------------------</span></pre>
<pre><o:p> </o:p></pre>
<pre><span style="color: purple;">QT</span><span style="color: silver;"> </span>+=<span style="color: silver;"> </span>core</pre>
<pre><span style="color: purple;">QT</span><span style="color: silver;"> </span>-=<span style="color: silver;"> </span>gui</pre>
<pre><span style="color: purple;">TARGET</span><span style="color: silver;"> </span>=<span style="color: silver;"> </span>MyProject</pre>
<pre><span style="color: purple;">CONFIG</span><span style="color: silver;"> </span>+=<span style="color: silver;"> </span>console</pre>
<pre><span style="color: purple;">CONFIG</span><span style="color: silver;"> </span>-=<span style="color: silver;"> </span>app_bundle</pre>
<pre><span style="color: purple;">TEMPLATE</span><span style="color: silver;"> </span>=<span style="color: silver;"> </span>app</pre>
<pre><span style="color: purple;">SOURCES</span><span style="color: silver;"> </span>+=<span style="color: silver;"> </span>main.cpp</pre>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
Lines with # are comments </div>
<div class="MsoNormal">
After comments first line indicate that project include Qt
Core library and next line is for excluding Qt GUI module.</div>
<div class="MsoNormal">
Since we are going to learn Qt GUI programming </div>
<pre>So edit</pre>
<pre> <span style="color: purple;">QT</span><span style="color: silver;"> </span>-=<span style="color: silver;"> </span>gui</pre>
<div class="MsoNormal">
to </div>
<pre><span style="color: purple;">QT</span><span style="color: silver;"> </span>+=<span style="color: silver;"> </span>gui</pre>
<div class="MsoNormal">
<br /></div>
<span style="font-family: "Calibri","sans-serif"; font-size: 11.0pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: minor-latin; mso-bidi-font-family: "Times New Roman"; mso-bidi-language: AR-SA; mso-bidi-theme-font: minor-bidi; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-fareast; mso-hansi-theme-font: minor-latin;">For
more info about .pro file syntax refer <a href="http://qt-project.org/doc/qt-4.8/qmake-project-files.html">http://qt-project.org/doc/qt-4.8/qmake-project-files.html</a></span><br />
<br />
<br />
<h1>
Simple Qt program:</h1>
<div class="MsoNormal">
<o:p> A simple program to make a push button and its line by line explanation: </o:p></div>
<pre><span style="color: navy; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span></pre>
<pre><span style="color: navy; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">#include</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: green; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><QApplication></span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><span style="color: navy; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">#include</span><span style="color: green; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><QPushButton></span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><span style="color: olive; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">int</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">main(<span style="color: olive;">int</span><span style="color: silver;"> </span>argc,<span style="color: silver;"> </span><span style="color: olive;">char</span><span style="color: silver;"> </span>*argv[])<o:p></o:p></span></pre>
<pre><span style="font-size: 13pt;">{</span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QApplication</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">a(argc,</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">argv);</span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QPushButton</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">*</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">pushbutton</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">=</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: olive; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">new</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: purple; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">QPushButton</span><span style="font-size: 13pt;">(</span><span style="color: green; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">"Hello"</span><span style="font-size: 13pt;">);<o:p></o:p></span></pre>
<pre><span style="color: green;">//creating pushbutton and setting its text as Hello</span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">pushbutton-></span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">show();<o:p></o:p></span></pre>
<pre><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="color: olive; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">return</span><span style="color: silver; font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"> </span><span style="font-size: 13pt;">a.</span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;">exec();<o:p></o:p></span></pre>
<pre><span style="font-size: 13pt;">}</span><span style="font-size: 13.0pt; mso-bidi-font-size: 10.0pt;"><o:p></o:p></span></pre>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
The QApplication class manages the GUI application's control
flow and main settings. The QApplication constructor requires argc and argv
because Qt supports a few command-line arguments of its own.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
To use pushbutton we have to include its header QPushButton. We can pass string to its constructor to set
pushbutton’s text. </div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
show() method is
called to make it visible.</div>
<div class="MsoNormal">
<i><br /></i></div>
<div class="MsoNormal">
<i>return a.exec()</i>
enters the main event loop and waits until exit() is called, then returns the
value that was set to exit() (which is 0 if exit() is called via quit()).</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
It is necessary to call this function to start event
handling. The main event loop receives events from the window system and
dispatches these to the application widgets.</div>
</div>
VTK QT ITKhttp://www.blogger.com/profile/06611251907711598891noreply@blogger.com0tag:blogger.com,1999:blog-1926867569619153623.post-23967072339870217912012-12-30T23:11:00.000-08:002013-04-17T23:40:08.419-07:00Qt 64 bit Build<div style="border-bottom: solid #4F81BD 1.0pt; border: none; mso-border-bottom-themecolor: accent1; mso-element: para-border-div; padding: 0in 0in 4.0pt 0in;">
<h2>
<span style="font-family: Times, Times New Roman, serif;"><br /></span></h2>
<h3>
<span style="font-family: Times, Times New Roman, serif;">Steps:</span></h3>
</div>
<div>
<ul>
<li><span style="font-family: Times, Times New Roman, serif;"><span style="font-size: 11pt; line-height: 115%;">Download WindowSDK7.0 (we found compatibility issues with 7.1 ) through this link </span><span style="color: windowtext; font-size: 11pt; line-height: 115%;"><a href="http://www.microsoft.com/en-in/download/details.aspx?id=3138">http://www.microsoft.com/en-in/download/details.aspx?id=3138</a></span></span></li>
<li><span style="font-family: Times, Times New Roman, serif;"><span style="text-indent: -0.25in;">Run CMD Shell command line tool of SDK 7.0 which provide x64 compiling tool for build.</span><span style="text-indent: -24px;"> </span></span></li>
<li><span style="text-indent: -0.25in;"><span style="font-family: Times, Times New Roman, serif;">In shell change directory to QT folder (i.e. c:/Qt/4.8.3) which have configure.exe.</span></span></li>
<li><span style="font-family: Times, Times New Roman, serif;"><span style="text-indent: -24px;"><span style="font-size: 11pt; line-height: 115%;">You</span></span><span style="text-indent: -24px;"> </span><span style="text-indent: -24px;">should keep 32 bit bin separate than 64 bit, to do that</span><span style="text-indent: -24px;"> write </span></span></li>
</ul>
<span style="font-family: Times, Times New Roman, serif;"><b style="text-indent: -24px;"> configure.exe -prefix C:\Qt\4.7.4_vc9_x64</b><span style="text-indent: -24px;"> </span></span><br />
<ul>
<li><span style="text-indent: -24px;"><span style="font-family: Times, Times New Roman, serif;">If you go for build each module that is default option it will take long time (as it took around 20 hours) it is better to exclude modules that will not be used by your application. For excluding some module that will not useful for you can run like</span></span></li>
</ul>
<b><span style="font-family: Times, Times New Roman, serif;"> configure.exe -prefix C:\Qt\4.7.4_vc9_x64 -debug-and-release -qt-sql-sqlite -no-multimedia</span></b></div>
<div>
<span style="font-family: Times, Times New Roman, serif;"><b> -</b><b>no-audio-backend -no-phonon -no-phonon-backend -no-declarative -mp -nomake examples </b></span></div>
<div>
<b><span style="font-family: Times, Times New Roman, serif;"> -nomake demos -nomake docs</span></b></div>
<div>
<span style="font-family: Times, Times New Roman, serif;"> here nomakes will not build and build process will take less time (3-4 hours) </span></div>
<div>
<span style="font-family: Times, Times New Roman, serif;"> </span><span style="font-family: Times, 'Times New Roman', serif;"> (courtesy</span><b style="font-family: Times, 'Times New Roman', serif;"> :</b><span style="font-family: Times, 'Times New Roman', serif;"> </span><a href="http://docs.mitk.org/2013.03/BuildInstructionsPage.html" style="font-family: Times, 'Times New Roman', serif;"><span style="color: windowtext; text-decoration: none;">http://docs.mitk.org/2013.03/BuildInstructionsPage.html</span></a><span style="font-family: Times, 'Times New Roman', serif;">).</span><span style="font-family: Times, 'Times New Roman', serif; text-indent: -24px;"> </span><span style="font-family: Times, 'Times New Roman', serif; text-indent: -24px;"> </span></div>
<div>
<ul>
<li><span style="font-family: Times, Times New Roman, serif;"><span style="text-indent: -24px;">For more configuration option refer </span><a href="http://doc.qt.digia.com/4.7/configure-options.html" style="text-indent: -24px;">http://doc.qt.digia.com/4.7/configure-options.html</a><span style="text-indent: -24px;"> .</span></span></li>
<li><span style="text-indent: -24px;"><span style="font-family: Times, Times New Roman, serif;">When configuration done run command <b>nmake</b></span></span></li>
<li><span style="text-indent: -24px;"><span style="font-family: Times, Times New Roman, serif;">After that run command <b>nmake install</b></span></span></li>
</ul>
<div style="text-indent: -24px;">
<span style="font-family: Times, Times New Roman, serif;"><b> </b></span><br />
<span style="font-family: Times, Times New Roman, serif;"><b><br /></b></span>
<span style="font-family: Times, Times New Roman, serif;"><b><br /></b></span>
<span style="font-family: Times, Times New Roman, serif;"><b><br /></b></span>
<span style="font-family: Times, Times New Roman, serif;"><b><br /></b></span>
<span style="font-family: Times, Times New Roman, serif;"><b><br /></b></span>
<span style="font-family: Times, Times New Roman, serif;"><b><br /></b></span>
<span style="font-family: Times, Times New Roman, serif;"><b><br /></b></span>
<span style="font-family: Times, Times New Roman, serif;"><b><br /></b></span>
<span style="font-family: Times, Times New Roman, serif;"><b><span style="font-size: x-small;"> </span> </b>These steps are generalized any doubt/suggestions are most Welcome.</span></div>
<div style="text-indent: -24px;">
<br /></div>
<div style="text-indent: -24px;">
<span style="font-family: Times, Times New Roman, serif;"><b><br />
</b></span></div>
</div>
VTK QT ITKhttp://www.blogger.com/profile/06611251907711598891noreply@blogger.com1tag:blogger.com,1999:blog-1926867569619153623.post-70729198395622130852012-11-07T00:58:00.004-08:002013-04-17T22:16:35.754-07:00Qt Installation 32bit<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<div style="border-bottom: solid #4F81BD 1.0pt; border: none; mso-border-bottom-themecolor: accent1; mso-element: para-border-div; padding: 0in 0in 4.0pt 0in;">
<h2 style="text-align: left;">
<b>Qt Installation</b></h2>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiF5NTRAmTvTvpqn6gbNPk99l-95Du0w6s9zucm2WbddVvCFK2zXxwlJyk4T_kQaS9uTgrIO-bsJpZXdpEfiWyfSe7zMsRjkNKl9z54lY8adqJL_XiZvvSd2KpAk2-xMsUpvzSCptFsquM/s1600/image1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiF5NTRAmTvTvpqn6gbNPk99l-95Du0w6s9zucm2WbddVvCFK2zXxwlJyk4T_kQaS9uTgrIO-bsJpZXdpEfiWyfSe7zMsRjkNKl9z54lY8adqJL_XiZvvSd2KpAk2-xMsUpvzSCptFsquM/s400/image1.jpg" height="400" width="346" /></a></div>
<div class="MsoNormal" style="margin-left: 1.0in;">
<br /></div>
<div style="border-bottom: solid #4F81BD 1.0pt; border: none; mso-border-bottom-themecolor: accent1; mso-element: para-border-div; padding: 0in 0in 4.0pt 0in;">
<div class="MsoTitleCxSpFirst">
<br /></div>
<div class="MsoTitleCxSpMiddle">
<b>Prerequisite</b></div>
</div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l2 level1 lfo2; text-indent: -.25in;">
<!--[if !supportLists]-->1.<span style="font-size: 7pt;">
</span><!--[endif]-->Update.Net Framework into .Net Framework 4.</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l2 level1 lfo2; text-indent: -.25in;">
<!--[if !supportLists]-->2.<span style="font-size: 7pt;">
</span><!--[endif]-->Install windows SDK v7.1 by online installer
while installing check all options in window from link <a href="http://www.microsoft.com/en-us/download/details.aspx?id=8279%20">http://www.microsoft.com/en-us/download/details.aspx?id=8279</a>
[offline installer’s ISO file is having error].</div>
<div class="MsoListParagraphCxSpMiddle">
<br /></div>
<div class="MsoListParagraphCxSpMiddle">
<br /></div>
<div style="border-bottom: solid #4F81BD 1.0pt; border: none; margin-left: .25in; margin-right: 0in; mso-border-bottom-themecolor: accent1; mso-element: para-border-div; padding: 0in 0in 4.0pt 0in;">
<h3 style="text-align: left;">
<b>1)<span style="font-size: 7pt;">
</span><!--[endif]-->Using Qt SDK </b></h3>
</div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->1.<span style="font-size: 7pt;">
</span><!--[endif]-->Download: Qt SDK for windows [QtSdk-offline-win-x86-v1.2.1].</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->2.<span style="font-size: 7pt;">
</span><!--[endif]-->Install Qt SDK.</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->3.<span style="font-size: 7pt;">
</span><!--[endif]-->Set following in Qt Creator.</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo1; text-indent: -.25in;">
<!--[if !supportLists]-->4.<span style="font-size: 7pt;">
</span><!--[endif]-->Follow <b><i>step 5 of Qt Open Source with Creator </i></b>for
Creator settings after installation.</div>
<div class="MsoListParagraphCxSpLast">
*SDK is not available with latest Qt
libraries.</div>
<div style="border-bottom: solid #4F81BD 1.0pt; border: none; margin-left: .25in; margin-right: 0in; mso-border-bottom-themecolor: accent1; mso-element: para-border-div; padding: 0in 0in 4.0pt 0in;">
<h3 style="text-align: left;">
2)<span style="font-size: 7pt;">
</span><!--[endif]-->Using Qt Open Source library with Creator</h3>
</div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l3 level1 lfo3; text-indent: -.25in;">
<!--[if !supportLists]-->1.<span style="font-size: 7pt;">
</span><!--[endif]-->Download Qt open source from <a href="http://qt-project.org/downloads">http://qt-project.org/downloads</a>
[qt-win-opensource-4.8.3-vs2008]</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l3 level1 lfo3; text-indent: -.25in;">
<!--[if !supportLists]-->2.<span style="font-size: 7pt;">
</span><!--[endif]-->Download Qt Creator [qt-creator-win-opensource-2.5.2].</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l3 level1 lfo3; text-indent: -.25in;">
<!--[if !supportLists]-->3.<span style="font-size: 7pt;">
</span><!--[endif]-->Install Qt open source library.</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l3 level1 lfo3; text-indent: -.25in;">
<!--[if !supportLists]-->4.<span style="font-size: 7pt;">
</span><!--[endif]-->Install Qt Creator [check in post mortem
debugger option].</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l3 level1 lfo3; text-indent: -.25in;">
<!--[if !supportLists]-->5.<span style="font-size: 7pt;">
</span><!--[endif]-->Check following in creator</div>
<div class="MsoListParagraphCxSpMiddle" style="margin-left: 1.5in; mso-add-space: auto; mso-list: l1 level1 lfo5; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><b>Go in
Tools>> Options >> Build and Run<o:p></o:p></b></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijS3PUXlwCia1q6-UM0LJGXw-hVjkdadgfdrpuDh8QN9fo4EG_5YlBdCHotaFpCdctxNrHsCTXNoShyA_YiMshXsliefGKIX6UPmRhMeCGmvsAHeLaZ0vPikGhHKio8QP_rfQ5fTK8-Og/s1600/image2.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijS3PUXlwCia1q6-UM0LJGXw-hVjkdadgfdrpuDh8QN9fo4EG_5YlBdCHotaFpCdctxNrHsCTXNoShyA_YiMshXsliefGKIX6UPmRhMeCGmvsAHeLaZ0vPikGhHKio8QP_rfQ5fTK8-Og/s640/image2.jpg" height="371" width="640" /></a></div>
<div class="MsoListParagraphCxSpLast">
<br />
<!--[endif]--></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
If there is no Qt version available click on add and locate
Qt open source libraries folder go into bin and select qmake file [qmake.exe].</div>
<div class="MsoNormal">
<b><i>Path is C:\Qt\4.8.3\bin<o:p></o:p></i></b></div>
<div class="MsoNormal">
In bin you will find qmake file.</div>
<div class="MsoListParagraph" style="margin-left: 1.5in; mso-add-space: auto; mso-list: l1 level1 lfo5; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><b>Then check Tool Chain tab in options window <o:p></o:p></b></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTP_qZs1bEKR750ebnsNNc1u9kH1m34qFsV2ZVFbixDnNujogI1ksjLIGw5GDestpUj96jz09AtazioCUFF9efiaEYpvg-wOeOUW6hCIC7nmxy9Kmdqhad4pWHwOSkHfw2nEwTjpYwT1Q/s1600/image3.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTP_qZs1bEKR750ebnsNNc1u9kH1m34qFsV2ZVFbixDnNujogI1ksjLIGw5GDestpUj96jz09AtazioCUFF9efiaEYpvg-wOeOUW6hCIC7nmxy9Kmdqhad4pWHwOSkHfw2nEwTjpYwT1Q/s640/image3.jpg" height="376" width="640" /></a></div>
<div class="MsoNormal">
<br />
<br />
<br />
<!--[endif]--></div>
<div class="MsoNormal">
Check Compiler version [it should be 32 bit version], debugger,
and mkspec [32 bit].</div>
<div class="MsoNormal">
If it is not present in Auto Detect click on add and locate
folder of win SDK/Visual Studio and then check.</div>
<div class="MsoListParagraph" style="margin-left: 1.5in; mso-add-space: auto; mso-list: l1 level1 lfo5; text-indent: -.25in;">
<!--[if !supportLists]--><span style="font-family: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: 'Times New Roman'; font-size: 7pt;">
</span></span><!--[endif]--><b>Now
select Debugger in options and go on CDB tab<o:p></o:p></b></div>
<div class="MsoNormal">
Check in Use CDB console.</div>
<div class="MsoNormal">
Enter this path in Symbol Path</div>
<div class="MsoNormal">
<b><i>symsrv*symsrv.dll*C:\Users\volmo\AppData\Local\Temp\symbolcache*http://msdl.microsoft.com/download/symbols</i><o:p></o:p></b></div>
<div class="MsoNormal">
Now click on Apply then Ok.</div>
<div class="MsoNormal">
Restart Qt Creator.</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirWjRdWLlU_SnUX3fBGhCHRibD6IL_12KvVWzCBgKkH-8ybpVePzx43eAmInrfG5ObfqA44Bv5WPxTL9ixAlUhoji8h41ObGucyXj8IOYuPv_EnGaHfKnG4mjeFOeWdFKG2nZi_EilJyI/s1600/image4.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEirWjRdWLlU_SnUX3fBGhCHRibD6IL_12KvVWzCBgKkH-8ybpVePzx43eAmInrfG5ObfqA44Bv5WPxTL9ixAlUhoji8h41ObGucyXj8IOYuPv_EnGaHfKnG4mjeFOeWdFKG2nZi_EilJyI/s640/image4.jpg" height="374" width="640" /></a></div>
<div class="MsoNormal">
<br />
<!--[endif]--></div>
<div class="MsoNormal">
<br /></div>
<div style="border-bottom: solid #4F81BD 1.0pt; border: none; margin-left: .25in; margin-right: 0in; mso-border-bottom-themecolor: accent1; mso-element: para-border-div; padding: 0in 0in 4.0pt 0in;">
<h3 style="text-align: left;">
3)<span style="font-size: 7pt;">
</span><!--[endif]-->Using Qt add in Visual Studio</h3>
</div>
<div class="MsoListParagraphCxSpFirst" style="mso-list: l4 level1 lfo4; text-indent: -.25in;">
<!--[if !supportLists]-->1.<span style="font-size: 7pt;">
</span><!--[endif]-->Install Visual Studio 2008.</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l4 level1 lfo4; text-indent: -.25in;">
<!--[if !supportLists]-->2.<span style="font-size: 7pt;">
</span><!--[endif]-->Download Qt open source
[qt-win-opensource-4.8.3-vs2008].</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l4 level1 lfo4; text-indent: -.25in;">
<!--[if !supportLists]-->3.<span style="font-size: 7pt;">
</span><!--[endif]-->Download QT visual studio add in [qt-vs-addin-1.1.11-opensource].</div>
<div class="MsoListParagraphCxSpMiddle" style="mso-list: l4 level1 lfo4; text-indent: -.25in;">
<!--[if !supportLists]-->4.<span style="font-size: 7pt;">
</span><!--[endif]-->Install Qt open source.</div>
<div class="MsoListParagraphCxSpLast" style="mso-list: l4 level1 lfo4; text-indent: -.25in;">
<!--[if !supportLists]-->5.<span style="font-size: 7pt;">
</span><!--[endif]-->Install Qt visual studio add in.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
While making new project select classes which you have to
use to avoid linker error.</div>
<div class="MsoNormal">
<br /></div>
<div class="MsoNormal">
<br /></div>
<div style="border-bottom: solid #4F81BD 1.0pt; border: none; mso-border-bottom-themecolor: accent1; mso-element: para-border-div; padding: 0in 0in 4.0pt 0in;">
<h2 style="text-align: left;">
Linker Error</h2>
</div>
<div class="MsoNormal">
In a console application a default .pro file have following
content:</div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: green; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">#-------------------------------------------------</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: green; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">#</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: green; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">#</span><span style="color: silver; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> </span><span style="color: green; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">Project</span><span style="color: silver; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> </span><span style="color: green; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">created</span><span style="color: silver; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> </span><span style="color: green; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">by</span><span style="color: silver; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> </span><span style="color: green; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">QtCreator</span><span style="color: silver; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> </span><span style="color: green; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">2012-11-06T16:24:44</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: green; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">#</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: green; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">#-------------------------------------------------</span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: purple; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">QT</span><span style="color: silver; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> </span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">+=<span style="color: silver;"> </span>core<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: purple; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">QT</span><span style="color: silver; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> </span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">-=<span style="color: silver;"> </span>gui<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: purple; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">TARGET</span><span style="color: silver; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> </span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">=<span style="color: silver;"> </span>untitled2<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: purple; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">CONFIG</span><span style="color: silver; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> </span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">+=<span style="color: silver;"> </span>console<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: purple; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">CONFIG</span><span style="color: silver; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> </span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">-=<span style="color: silver;"> </span>app_bundle<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: purple; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">TEMPLATE</span><span style="color: silver; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> </span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">=<span style="color: silver;"> </span>app<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="color: purple; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">SOURCES</span><span style="color: silver; font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";"> </span><span style="font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">+=<span style="color: silver;"> </span>main.cpp<o:p></o:p></span></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<br /></div>
<div class="MsoNormal" style="margin-bottom: 0.0001pt;">
<span style="font-family: "Courier New"; font-size: 10.0pt; mso-fareast-font-family: "Times New Roman";">Here
:<o:p></o:p></span></div>
<div class="MsoNormal">
<i><span style="font-size: 14.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">QT += core </span></i><span style="font-size: 14.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;"> </span>include QtCore library </div>
<div class="MsoNormal">
And next line <i><span style="font-size: 14.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;">QT -= gui</span></i><span style="font-size: 14.0pt; line-height: 115%; mso-bidi-font-size: 11.0pt;"> </span>will remove GUI
library.</div>
<div class="MsoNormal">
If you are using some classes which are defined in another
library modules [see class hierarchy of Qt for selecting right module] add them
as of above syntax in .pro file else it will create linker error.</div>
<div class="MsoNormal">
For example if you remove GUI library and then will use a
push button it will generate following error:</div>
<div class="MsoNormal">
<span style="color: red;">main.obj:-1: error: LNK2019:
unresolved external symbol "__declspec(dllimport) public: void __thiscall
QWidget::show(void)" (__imp_?show@QWidget@@QAEXXZ) referenced in function
_main<o:p></o:p></span></div>
<div style="border-bottom: solid #4F81BD 1.0pt; border: none; mso-border-bottom-themecolor: accent1; mso-element: para-border-div; padding: 0in 0in 4.0pt 0in;">
<div class="MsoTitleCxSpFirst">
<br /></div>
<div class="MsoTitleCxSpMiddle">
<br /></div>
<div class="MsoTitleCxSpMiddle">
<br /></div>
<h2 style="text-align: left;">
Debugger Error</h2>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy766Wn9TNS1_VVs5_-bEQ51Wkt65p9LeoMWIE8qLPCFAGKLBGdB4c0Y6nqtmJjsGtsKfyce1m2F6KJOK1JrQYU7a7JJyWVV_DqUIqOcebKRiWITiaQjPS_4Jn3ZNX1ZN-3GusHSsnR6E/s1600/image6.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiy766Wn9TNS1_VVs5_-bEQ51Wkt65p9LeoMWIE8qLPCFAGKLBGdB4c0Y6nqtmJjsGtsKfyce1m2F6KJOK1JrQYU7a7JJyWVV_DqUIqOcebKRiWITiaQjPS_4Jn3ZNX1ZN-3GusHSsnR6E/s400/image6.jpg" height="115" width="400" /></a></div>
<div align="center" class="MsoNormal" style="text-align: center;">
<br />
<!--[endif]--></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDBkmqTQKTAOgMmBOgY688ohwS9PelgtoSL5vuvsP2Yd2Rq2_GMxpPELxnbNa5miE1plSefg43wnKGb9f9UW590unlLnSsetgQZww0-xsRNGwowUa9Cv-jyQFZcdyTZhhY1wrYjchyphenhyphenzxE/s1600/image5.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDBkmqTQKTAOgMmBOgY688ohwS9PelgtoSL5vuvsP2Yd2Rq2_GMxpPELxnbNa5miE1plSefg43wnKGb9f9UW590unlLnSsetgQZww0-xsRNGwowUa9Cv-jyQFZcdyTZhhY1wrYjchyphenhyphenzxE/s640/image5.jpg" height="376" width="640" /></a></div>
<div align="center" class="MsoNormal" style="text-align: center;">
To remove this error
check windows SDK folder if there is cdb.exe file selected.<!--[endif]--></div>
<div class="MsoNormal">
If it is not selected then browse it in another folder
locate it in Debugger. To browse it. Make clone of detected tool or add manually.
Then find debugger’s exe [as cdb.exe] file and add it. Most probably you will
find it in debugger tool. If you don’t find the tool in folders then download
window SDK and search for debugger folder in it and locate the cdb.exe. </div>
</div>
VTK QT ITKhttp://www.blogger.com/profile/06611251907711598891noreply@blogger.com0