<pre>Dear Luis and all ITK users,<br></pre><div style="text-align: left;"> I want to RegionGrowingSegmentation outside InsightApplications.(makes it has its own *.dsw) So I moved the RegionGrowingSegmentation directory to the E:\ root and just added two macros(ITK_DISABLE_FLTK_GENERATED_WARNINGS and ADD_GUI_EXECUTABLE) to the original
CMakeList.txt.<br><br> Here is my CMakeList.txt:<br><br>PROJECT( RegionGrowingSegmentation )<br><br># The fluid-generated fltk sources have many warnings. This macro<br># will disable warnings for the generated files on some compilers.
<br>MACRO(ITK_DISABLE_FLTK_GENERATED_WARNINGS files)<br> IF(CMAKE_COMPILER_IS_GNUCXX)<br> FOREACH(f ${files})<br> STRING(REGEX REPLACE "\\.fl$" ".cxx" SRC "${f}")<br> STRING(REGEX REPLACE ".*/([^/]*)$" "\\1" SRC "${SRC}")
<br> SET_SOURCE_FILES_PROPERTIES(${SRC} PROPERTIES COMPILE_FLAGS -w)<br> ENDFOREACH(f)<br> ENDIF(CMAKE_COMPILER_IS_GNUCXX)<br>ENDMACRO(ITK_DISABLE_FLTK_GENERATED_WARNINGS)<br><br># Macro for adding resources to GUI application on the Mac
<br>#<br>IF(APPLE AND NOT FLTK_USE_X)<br> FIND_PROGRAM(ITK_APPLE_RESOURCE Rez /Developer/Tools)<br> FIND_FILE(ITK_FLTK_RESOURCE mac.r /usr/local/include/FL)<br> IF(NOT ITK_FLTK_RESOURCE)<br> MESSAGE("Fltk resources not found, GUI application will not respond to mouse events")
<br> ENDIF(NOT ITK_FLTK_RESOURCE)<br><br> MACRO(ADD_GUI_EXECUTABLE name sources)<br> ADD_EXECUTABLE(${name} ${sources})<br> INSTALL_TARGETS(/bin ${name})<br> SET(EXEC_PATH ${EXECUTABLE_OUTPUT_PATH})<br>
IF(NOT EXEC_PATH)<br> SET(EXEC_PATH ${CMAKE_CURRENT_BINARY_DIR})<br> ENDIF(NOT EXEC_PATH)<br> IF(ITK_APPLE_RESOURCE)<br> ADD_CUSTOM_COMMAND(SOURCE ${name}<br> COMMAND ${ITK_APPLE_RESOURCE}
<br> ARGS -t APPL ${ITK_FLTK_RESOURCE} -o<br> ${EXEC_PATH}/${name}<br> TARGET ${name})<br> ENDIF(ITK_APPLE_RESOURCE)<br> ENDMACRO(ADD_GUI_EXECUTABLE)
<br>ELSE(APPLE AND NOT FLTK_USE_X)<br> MACRO(ADD_GUI_EXECUTABLE name sources)<br> ADD_EXECUTABLE(${name} ${sources})<br> INSTALL_TARGETS(/bin ${name})<br> ENDMACRO(ADD_GUI_EXECUTABLE)<br>ENDIF(APPLE AND NOT FLTK_USE_X)
<br><br> FIND_PACKAGE(ITK)<br> IF(ITK_FOUND)<br> INCLUDE(${ITK_USE_FILE})<br> ELSE(ITK_FOUND)<br> MESSAGE(FATAL_ERROR<br> "Cannot build InsightApplications without ITK. Please set ITK_DIR.")
<br> ENDIF(ITK_FOUND)<br><br> FIND_PACKAGE(FLTK)<br> IF(FLTK_FOUND)<br> INCLUDE_DIRECTORIES(${FLTK_INCLUDE_DIR})<br> ENDIF(FLTK_FOUND)<br><br> FIND_PACKAGE(VTK)<br> IF (VTK_FOUND)<br> INCLUDE (${VTK_USE_FILE})
<br> ENDIF (VTK_FOUND)<br><br><br><br>INCLUDE_DIRECTORIES(<br>${InsightApplications_SOURCE_DIR}/Auxiliary/FltkImageViewer<br>${InsightApplications_SOURCE_DIR}/Auxiliary/VtkFltk<br>${InsightApplications_SOURCE_DIR}/Auxiliary/vtk
<br>${InsightApplications_BINARY_DIR}/Auxiliary/FltkImageViewer<br>${InsightApplications_BINARY_DIR}/Auxiliary/VtkFltk<br>${RegionGrowingSegmentation_SOURCE_DIR}<br>${RegionGrowingSegmentation_BINARY_DIR}<br>)<br><br><br>
FLTK_WRAP_UI( RegionGrowingSegmentation RegionGrowingSegmentationGUI.fl)<br>FLTK_WRAP_UI( RegionGrowingSegmentation2D RegionGrowingSegmentation2DGUI.fl)<br><br><br>ITK_DISABLE_FLTK_GENERATED_WARNINGS(RegionGrowingSegmentationGUI.fl
)<br>ITK_DISABLE_FLTK_GENERATED_WARNINGS(RegionGrowingSegmentation2DGUI.fl)<br><br><br>SET(RegionGrowingSegmentation2D_SRCS<br>RegionGrowingSegmentationBase2D.cxx<br>RegionGrowingSegmentation2D.cxx<br>${RegionGrowingSegmentation2D_FLTK_UI_SRCS}
<br>)<br><br><br>SET(RegionGrowingSegmentation_SRCS<br>RegionGrowingSegmentationBase.cxx<br>RegionGrowingSegmentation.cxx<br>${RegionGrowingSegmentation_FLTK_UI_SRCS}<br>)<br><br><br>LINK_LIBRARIES (<br>ITKCommon<br>ITKNumerics
<br>ITKBasicFilters<br>ITKIO<br>ITKFltkImageViewer<br>ITKVtkFltk<br>vtkRendering<br>vtkGraphics<br>vtkHybrid<br>vtkImaging<br>vtkIO<br>vtkFiltering<br>vtkCommon<br>)<br><br><br>ADD_GUI_EXECUTABLE(RegionGrowingSegmentation2D "${RegionGrowingSegmentation2D_SRCS}")
<br>ADD_GUI_EXECUTABLE(RegionGrowingSegmentation "${RegionGrowingSegmentation_SRCS}")<br><br><br>Looks like it works. After running cMake, I got a RegionGrowingSegmentation.dsw and received no errors. But when I built the
RegionGrowingSegmentation.dsw in VC++ 6.0, it reported that some files(fltkImageViewer.h etc.) were missing. I found these files in Insight ToolKit or InsightApp directory and added them to the local directory one by one. At last it stop asking for
files.And some new errors occoured.<br>--------------------Configuration: RegionGrowingSegmentation - Win32 Debug--------------------<br>Compiling...<br>RegionGrowingSegmentation.cxx<br>E:\RegionGrowingSegmentation_Bin\fltkImageViewer.txx(444) : error C2512: 'ClickPoint' : no appropriate default constructor available
<br> C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xmemory(66) : while compiling class-template member function 'void __thiscall fltk::ImageViewer<float,unsigned char>::UpdateClickedPoints(void)'
<br>E:\RegionGrowingSegmentation_Bin\fltkImageViewer.txx(445) : error C2660: 'getClickedPoint' : function does not take 2 parameters<br> C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xmemory(66) : while compiling class-template member function 'void __thiscall fltk::ImageViewer<float,unsigned char>::UpdateClickedPoints(void)'
<br>E:\RegionGrowingSegmentation_Bin\fltkImageViewer.txx(444) : error C2512: 'ClickPoint' : no appropriate default constructor available<br> C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xmemory(66) : while compiling class-template member function 'void __thiscall fltk::ImageViewer<short,unsigned char>::UpdateClickedPoints(void)'
<br>E:\RegionGrowingSegmentation_Bin\fltkImageViewer.txx(445) : error C2660: 'getClickedPoint' : function does not take 2 parameters<br> C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xmemory(66) : while compiling class-template member function 'void __thiscall fltk::ImageViewer<short,unsigned char>::UpdateClickedPoints(void)'
<br>Error executing cl.exe.<br><br>ALL_BUILD - 4 error(s), 0 warning(s)<br><br></div><pre>I am a novice. Can you tell me how to fix it?<br>Or what I have done is totally wrong.I can do it in another way?<br><br>Thank you very much in advance!
<br><br><br>Regards,<br>Xing-Sheng Liu<br><br></pre>