<pre>Dear Luis and all ITK users,<br></pre><div style="text-align: left;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I want to RegionGrowingSegmentation outside InsightApplications.(makes it has its own *.dsw)&nbsp; 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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Here is my CMakeList.txt:<br><br>PROJECT( RegionGrowingSegmentation )<br><br># The fluid-generated fltk sources have many warnings.&nbsp; This macro<br># will disable warnings for the generated files on some compilers.
<br>MACRO(ITK_DISABLE_FLTK_GENERATED_WARNINGS files)<br>&nbsp; IF(CMAKE_COMPILER_IS_GNUCXX)<br>&nbsp;&nbsp;&nbsp; FOREACH(f ${files})<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; STRING(REGEX REPLACE &quot;\\.fl$&quot; &quot;.cxx&quot; SRC &quot;${f}&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; STRING(REGEX REPLACE &quot;.*/([^/]*)$&quot; &quot;\\1&quot; SRC &quot;${SRC}&quot;)
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SET_SOURCE_FILES_PROPERTIES(${SRC} PROPERTIES COMPILE_FLAGS -w)<br>&nbsp;&nbsp;&nbsp; ENDFOREACH(f)<br>&nbsp; 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>&nbsp;&nbsp;&nbsp; FIND_PROGRAM(ITK_APPLE_RESOURCE Rez /Developer/Tools)<br>&nbsp;&nbsp;&nbsp; FIND_FILE(ITK_FLTK_RESOURCE mac.r /usr/local/include/FL)<br>&nbsp;&nbsp;&nbsp; IF(NOT ITK_FLTK_RESOURCE)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MESSAGE(&quot;Fltk resources not found, GUI application will not respond to mouse events&quot;)
<br>&nbsp;&nbsp;&nbsp; ENDIF(NOT ITK_FLTK_RESOURCE)<br><br>&nbsp;&nbsp;&nbsp; MACRO(ADD_GUI_EXECUTABLE name sources)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ADD_EXECUTABLE(${name} ${sources})<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INSTALL_TARGETS(/bin ${name})<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SET(EXEC_PATH ${EXECUTABLE_OUTPUT_PATH})<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF(NOT EXEC_PATH)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SET(EXEC_PATH ${CMAKE_CURRENT_BINARY_DIR})<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ENDIF(NOT EXEC_PATH)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IF(ITK_APPLE_RESOURCE)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ADD_CUSTOM_COMMAND(SOURCE ${name}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; COMMAND ${ITK_APPLE_RESOURCE}
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ARGS -t APPL ${ITK_FLTK_RESOURCE} -o<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ${EXEC_PATH}/${name}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TARGET ${name})<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ENDIF(ITK_APPLE_RESOURCE)<br>&nbsp;&nbsp;&nbsp; ENDMACRO(ADD_GUI_EXECUTABLE)
<br>ELSE(APPLE AND NOT FLTK_USE_X)<br>&nbsp; MACRO(ADD_GUI_EXECUTABLE name sources)<br>&nbsp;&nbsp;&nbsp; ADD_EXECUTABLE(${name} ${sources})<br>&nbsp;&nbsp;&nbsp; INSTALL_TARGETS(/bin ${name})<br>&nbsp; ENDMACRO(ADD_GUI_EXECUTABLE)<br>ENDIF(APPLE AND NOT FLTK_USE_X)
<br><br>&nbsp; FIND_PACKAGE(ITK)<br>&nbsp; IF(ITK_FOUND)<br>&nbsp;&nbsp;&nbsp; INCLUDE(${ITK_USE_FILE})<br>&nbsp; ELSE(ITK_FOUND)<br>&nbsp;&nbsp;&nbsp; MESSAGE(FATAL_ERROR<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &quot;Cannot build InsightApplications without ITK.&nbsp; Please set ITK_DIR.&quot;)
<br>&nbsp; ENDIF(ITK_FOUND)<br><br>&nbsp; FIND_PACKAGE(FLTK)<br>&nbsp; IF(FLTK_FOUND)<br>&nbsp;&nbsp;&nbsp; INCLUDE_DIRECTORIES(${FLTK_INCLUDE_DIR})<br>&nbsp; ENDIF(FLTK_FOUND)<br><br>&nbsp; FIND_PACKAGE(VTK)<br>&nbsp; IF (VTK_FOUND)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; INCLUDE (${VTK_USE_FILE})
<br>&nbsp; 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&nbsp;&nbsp; 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 &quot;${RegionGrowingSegmentation2D_SRCS}&quot;)
<br>ADD_GUI_EXECUTABLE(RegionGrowingSegmentation &quot;${RegionGrowingSegmentation_SRCS}&quot;)<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: &#39;ClickPoint&#39; : no appropriate default constructor available
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xmemory(66) : while compiling class-template member function &#39;void __thiscall fltk::ImageViewer&lt;float,unsigned char&gt;::UpdateClickedPoints(void)&#39;
<br>E:\RegionGrowingSegmentation_Bin\fltkImageViewer.txx(445) : error C2660: &#39;getClickedPoint&#39; : function does not take 2 parameters<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xmemory(66) : while compiling class-template member function &#39;void __thiscall fltk::ImageViewer&lt;float,unsigned char&gt;::UpdateClickedPoints(void)&#39;
<br>E:\RegionGrowingSegmentation_Bin\fltkImageViewer.txx(444) : error C2512: &#39;ClickPoint&#39; : no appropriate default constructor available<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xmemory(66) : while compiling class-template member function &#39;void __thiscall fltk::ImageViewer&lt;short,unsigned char&gt;::UpdateClickedPoints(void)&#39;
<br>E:\RegionGrowingSegmentation_Bin\fltkImageViewer.txx(445) : error C2660: &#39;getClickedPoint&#39; : function does not take 2 parameters<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\xmemory(66) : while compiling class-template member function &#39;void __thiscall fltk::ImageViewer&lt;short,unsigned char&gt;::UpdateClickedPoints(void)&#39;
<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>