[Insight-users] ITK with QT4

Luis Ibanez luis.ibanez at kitware.com
Fri Mar 28 13:15:05 EDT 2008


Hi Prabhat,

The flags that are inconsistent are not the ones used
for building CMake, but the ones used for building ITK
with respect to the ones used for building Qt,... and
any other library that you are linking together in your
final application.


      Did you build Qt on your own ?

Are you using any other libraries besides ITK & Qt ?

Have you manually changed the flags used for configuring
your own application ?


Please let us know,


    Thanks


       Luis


----------------------
Prabhat Gupta wrote:
> Hi Luis,
> 
>  
> 
> Thanks a lot for reply.
> 
>  
> 
> As you said :
> 
> "The CMake messages indicate that you are using
>     inconsitent compiler flags when building ITK and CMake."
> 
> 
> I downloaded CMake 2.4 patch 8 installer from site. I didn't built it.
> 
> and I built ITK as suggested in "Gettingstarted" guide by itk.
> 
>  
> 
> *Can you tell me how to check what is inconsistent and how to correct??*
> 
> ** 
> 
> *Please I am unable to find on google.*
> 
> ** 
> 
> Thanks a lot
> 
>  
> 
> Prabhat
> 
> 
> --- On *Fri, 28/3/08, Luis Ibanez /<luis.ibanez at kitware.com>/* wrote:
> 
>     From: Luis Ibanez luis.ibanez at kitware.com
>     <mailto:luis.ibanez at kitware.com>.
> 
> 
>     Subject: Re: [Insight-users] ITK with QT4
>     To: "prabhat246" <prabhat246 at yahoo.com>
>     Cc: insight-users at itk.org
>     Date: Friday, 28 March, 2008, 9:18 PM
> 
> Hi Prabhat,
> 
> 1) The CMake messages indicate that you are using
>     inconsitent compiler flags when building ITK and CMake.
> 
>     A common mistake is to build one library for Release,
>     and the other for Debug.
> 
>     Please use *only one* compilation mode for all the
>     libraries.
> 
> 2) It seems that a Qt library is missing from the link
>     command. (I'll have to double check on this one...)
> 
> 
> About your Questions:
> 
> a) About how to read DICOM images:
>     See the example:
> 
>     Insight/Examples/IO/DicomSeriesReadImageWrite2.cxx
> 
>     Look also at: InsightApplications/LiverTumorSegmentation
> 
> 
> b) For Showing images in Qt, the simplest way is to use
>     ITK + VTK + Qt, as it is done in IGSTK (www.igstk.org).
> 
> 
> c) For how to use Marching Cubes (iso-surface extraction)
>     look at the example:
> 
>     InsightApplications/Auxiliary/vtk/
>         itkReadITKImage3DSegmentShowVTK.cxx
> 
> 
> d) For, visualizing the results...
>     look also at the example above in (c).
> 
> 
> 
> 
>     Regards,
> 
> 
>         Luis
> 
> 
> -----------------
> prabhat246 wrote:
>> Please reply me, I am stuck....
>> 
>> Oh yes. I was using example from Insight Applications 3.4 
>> 
>> Well I downloaded the New Version of this example and got following errors
> 
>> 
>> When doing cmake 
>> -------------------- 
>> CMake says while first time configuring. 
>> 
>> FOUND Qt-Version 4.3.2 
>> 
>> Then 
>> Error D:/Libs/Qt4.3/include 
>> Press cancel to suppress any further messages.
>> 
>> configuring again : 
>> 
>> Warning : CMake is forcing CMAKE_CXX_FLAGS_RELEASE to "/MD /O2 /Ob2
> /D
>> /NDEBUG" to Match that imported from ITK. 
>> If this message appears for more tahn one imported project, You have
>> conflicting Options and will have to rebuild one of those projects.
>> 
>> and this appear again as 
>> 
>> Warning : CMake is forcing CMAKE_CXX_FLAGS_MINSIZEREL to "/MD /O1
> /Ob2 /D
>> /NDEBUG" to Match that imported from ITK. 
>> If this message appears for more tahn one imported project, You have
>> conflicting Options and will have to rebuild one of those projects. 
>> 
>> AND ONE MORE TIME 
>> 
>> Warning : CMake is forcing CMAKE_CXX_FLAGS_RELWITHDEBINFO to "/MD /O1
> /Ob2
>> /D /NDEBUG" to Match that imported from ITK. 
>> If this message appears for more tahn one imported project, You have
>> conflicting Options and will have to rebuild one of those projects.
>> 
>> 
>> Well anyhow it generates the project. Building QtSlicer gives following : 
>> 
>> 
>> 1>QtGlSliceView.obj : error LNK2001: unresolved external symbol
> "public:
>> virtual struct QMetaObject const * __thiscall
>> QtGlSliceView::metaObject(void)const "
>> (?metaObject at QtGlSliceView@@UBEPBUQMetaObject@@XZ) 
>> 1>QtGlSliceView.obj : error LNK2001: unresolved external symbol
> "public:
>> virtual void * __thiscall QtGlSliceView::qt_metacast(char const *)"
>> (?qt_metacast at QtGlSliceView@@UAEPAXPBD at Z) 
>> 1>QtGlSliceView.obj : error LNK2001: unresolved external symbol
> "public:
>> virtual int __thiscall QtGlSliceView::qt_metacall(enum
>> QMetaObject::Call,int,void * *)"
>> (?qt_metacall at QtGlSliceView@@UAEHW4Call at QMetaObject@@HPAPAX at Z)
>> 
>> 
>> These linking error seems to be resolved by moccing. I generated
>> moc_QtGlSliceview.cpp by moccing QtGlSliceview.h and added into project
> but
>> then I get following errors 
>> 
>> ..\QtImgViewer\moc_QtglSliceView.cpp(73) : error C3861:
> 'Position':
>> identifier not found 
>> 1>..\QtImgViewer\moc_QtglSliceView.cpp(86) : error C2039:
> 'Position' : is
>> not a member of 'QtGlSliceView' 
>> 1>       
> c:\users\prabhat\desktop\qtimgviewer\QtGlSliceView.h(85) :
> see
>> declaration of 'QtGlSliceView' 
>> 1>..\QtImgViewer\moc_QtglSliceView.cpp(87) : error C2365:
> 'Position' :
>> redefinition; previous definition was 'formerly unknown
> identifier' 
>> 1>..\QtImgViewer\moc_QtglSliceView.cpp(89) : error C2673:
> 'Position' :
>> global functions do not have 'this' pointers 
>> 1>..\QtImgViewer\moc_QtglSliceView.cpp(89) : error C2065:
> 'staticMetaObject'
>> : undeclared identifier 
>> 1>QtSlicer.cxx
>> 
>> 
>> Hope this helps to identify what wrong is happening. 
>> 
>> also Please suggest me from your experiences best way to do the following.
> 
>> 
>> 1. I want to read a series a dicom images and display it in a Qt widget. 
>> 2. Do Marching cubes on Volume of dicom data (isosurface extraction) ans
>> save the mesh into some standard formates.
>> 3. Visualize the results. 
>> 
>> For GUI I want to Use Qt 4.3.2, 
>> For Image Processing/Visualization ITK/VTK. 
>> 
>> Please suggest me related examples and simple and straightforward
> approaches
>> to do things. 
>> 
>> 
>> 
>> Thanks a lot. 
>> 
>> Prabhat 
>> 
>> Luis Ibanez wrote:
>> 
>>>
>>>Hi Prabhat246,
>>>
>>>What version of ITK are you using ?
>>>
>>>QtImageViewer in InsightApplications was updated
>>>for QT4 ion February 3rd 2008.
>>>
>>>See here the CVS logs:
>>>http://www.itk.org/cgi-bin/viewcvs.cgi/Auxiliary/QtImageViewer/?root=InsightApplications&sortby=date#dirlist
>>>
>>>
>>>Please post to the list any error messages that you
>>>get when trying to build QtImageViewer.
>>>
>>>
>>>     Thanks
>>>
>>>
>>>         Luis
>>>
>>>
>>>
>>>--------------------
>>>prabhat246 wrote:
>>>
>>>>Hi Insight-Users
>>>>I am trying to integrate ITK with Qt4. I want to display an Dicom
> Image
>>>>on
>>>>ITK Label.
>>>>
>>>>I've gone through QtImageViewer example. But I guess it is not
> for QT 4.
>>>>
>>>>1. Can any One tell me how can I do it.
>>>>2. Please provide me QtImageViewer for QT 4 or above. if anyone
>>>>has.[either
>>>>mail me or attach in reply]
>>>>
>>>>
>>>>Thanks a lot
>>>>
>>>>Regards
>>>>Prabhat Kumar Gupta
>>>>prabhat246 at yahoo.com
>>>
>>>_______________________________________________
>>>Insight-users mailing list
>>>Insight-users at itk.org
>>>http://www.itk.org/mailman/listinfo/insight-users
>>>
>>>
>> 
>>
> 
> 
> ------------------------------------------------------------------------
> Save all your chat conversations. Find them online. 
> <http://in.rd.yahoo..com/tagline_webmessenger_3/*http://in.messenger.yahoo.com/webmessengerpromo.php> 
> 


More information about the Insight-users mailing list