[ITK Community] Some questions about RegionGrowingSegmentation

Bill Lorensen bill.lorensen at gmail.com
Mon Feb 10 08:18:29 EST 2014


Building with FLTK is very tricky and depends on a particular version
and configuration of the library. This is why we provide a superbuild
for the ITKApps. Try building your standalone app against the FLTK
that was built by the superbuild.


On Mon, Feb 10, 2014 at 7:51 AM, Jon Haitz Legarreta
<jhlegarreta at vicomtech.org> wrote:
> Hi Ruturaj,
> you are right. However, if you are using CMake you shouldn't modify your
> compiler's include/link libraries within your compiler's environment; CMake
> does it for you.
>
> Thus, concerning the errors you are getting, in CMake's terms, you would
> interpret that you are not including FLTK as a library in your CMakeLists.
>
> If the error persisted even after you manually added the FLTK folder, then
> the file fltkImageViewer.h is not within that folder.
>
> But anyway, try not to alter the project's properties within your compiler;
> you can do that through your CMakeLists.
>
> Make sure also that you include it in your target link libraries' list.
>
> If errors persist, sharing your CMakeLists may be useful.
>
> HTH,
> JON HAITZ
>
>
> On 10 February 2014 12:20, Girish, Gavaskar Ruturaj
> <gavaskar.ruturaj.girish at philips.com> wrote:
>>
>> Dear Jon,
>>
>>
>>
>> I did as you told. Actually I am using FLTK only to view the images
>> (fltkImageViewer.h). I am not using it for user interaction. After making
>> the relevant changes in CMakeLists.txt, I am able to configure and generate
>> the Visual Studio project. However, now I get errors while building the
>> solution in Visual Studio. Here are the 2 errors I get:
>>
>>                 (In my main header file:) fatal error C1083: Cannot open
>> include file: 'fltkImageViewer.h': No such file or directory
>>
>>        and
>>
>>                 C:\Program Files\FLTK\include\FL\math.h(22): fatal error
>> C1083: Cannot open include file: '/usr/include/math.h': No such file or
>> directory
>>
>>
>>
>> I think the issue is something to do with the directories where VS
>> searches for the #included files. I have added the following directories in
>> 'Additional Include Directories' in C/C++ Properties for the project (don't
>> know if all are needed):
>>
>>                 <My source directory for cmake>
>>
>>                 <My build directory for cmake>
>>
>>                 C:\Program Files\ITK\include\ITK-4.6
>>
>>                 C:\Program Files\FLTK\include\FL
>>
>>                 <Binary directory of superbuild>
>> \ITKApps-build\Auxiliary\ITKFlFileWriter
>>
>>                 <Binary directory of superbuild>
>> \ITKApps-build\Auxiliary\FltkImageViewer
>>
>>                 <Binary directory of superbuild>
>> \ITKApps-build\Auxiliary\VtkFltk
>>
>>
>>
>> Any idea why these errors are occurring? Do I need to include any other
>> directories?
>>
>>
>>
>> Thanks in advance & also for your previous reply.
>>
>>
>>
>> Regards
>>
>> Ruturaj
>>
>> From: Jon Haitz Legarreta [mailto:jhlegarreta at vicomtech.org]
>> Sent: Friday, February 07, 2014 5:57 PM
>>
>>
>> To: Girish, Gavaskar Ruturaj
>> Cc: community at itk.org
>> Subject: Re: [ITK Community] Some questions about
>> RegionGrowingSegmentation
>>
>>
>>
>> Dear Ruturaj,
>>
>> if you don't need FLTK (as you mentioned, you don't need a GUI), then you
>> need to modify the CMakeLists accordingly, i.e. remove all FLTK-related
>> CMake variables in your new, fresh CMakeLists.txt
>>
>> You will just need to tell CMake that your projects depends only on ITK.
>>
>> In the ITK wiki, you will find quite a few examples on how to do this [1].
>> You even have a segmentation section there.
>>
>>
>> HTH,
>> JON HAITZ
>>
>> [1] http://www.itk.org/Wiki/ITK/Examples#About_the_Examples
>>
>>
>>
>> On 7 February 2014 12:36, Girish, Gavaskar Ruturaj
>> <gavaskar.ruturaj.girish at philips.com> wrote:
>>
>> Dear Friends,
>>
>>
>>
>> I am not able to build the app RegionGrowingSegmentation separately
>> without using Superbuild. I have already installed Superbuild once. Here is
>> what I did:
>>
>>
>>
>> In cmake, I gave the source directory as ITKApps/RegionGrowingSegmentation
>> and hit 'Configure', upon which CMake showed me the following error.
>>
>>
>>
>> CMake Error: Error required internal CMake variable not set, cmake may be
>> not be built correctly.
>> Missing variable is:
>> FLTK_FLUID_EXECUTABLE
>>
>> CMake Error: Error required internal CMake variable not set, cmake may be
>> not be built correctly.
>> Missing variable is:
>> FLTK_FLUID_EXECUTABLE
>>
>> CMake Error at CMakeLists.txt:42 (ITK_DISABLE_FLTK_GENERATED_WARNINGS):
>> Unknown CMake command "ITK_DISABLE_FLTK_GENERATED_WARNINGS".
>>
>> CMake Warning (dev) in CMakeLists.txt:
>> No cmake_minimum_required command is present. A line of code such as
>>
>> cmake_minimum_required(VERSION 2.8)
>>
>> should be added at the top of the file. The version specified may be lower
>> if you wish to support older CMake versions for this project. For more
>> information run "cmake --help-policy CMP0000".
>> This warning is for project developers. Use -Wno-dev to suppress it.
>>
>> FLTK_WRAP_UI was called with a target that was never created:
>> RegionGrowingSegmentation. The problem was found while processing the source
>> directory: D:/ITKApps-27-01-2014/RegionGrowingSegmentation. This
>> FLTK_WRAP_UI call will be ignored.
>>
>> FLTK_WRAP_UI was called with a target that was never created:
>> RegionGrowingSegmentation2D. The problem was found while processing the
>> source directory: D:/ITKApps-27-01-2014/RegionGrowingSegmentation. This
>> FLTK_WRAP_UI call will be ignored.
>>
>> Configuring incomplete, errors occurred!
>>
>> See also "D:/RegionGrowingSegmentation-Build/CMakeFiles/CMakeOutput.log".
>>
>>
>>
>> So I added the following 3 commands to CMakeLists.txt:
>>
>>
>>
>> 1)      SET(FLTK_FLUID_EXECUTABLE "C:/Program Files/FLTK/bin/fluid.exe")
>>
>> 2)      CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
>>
>> 3)      (Copied from ITKApps/CMakeLists.txt)
>>
>> MACRO(ITK_DISABLE_FLTK_GENERATED_WARNINGS files)
>>
>>   IF(CMAKE_COMPILER_IS_GNUCXX)
>>
>>     FOREACH(f ${files})
>>
>>       STRING(REGEX REPLACE "\\.fl$" ".cxx" SRC "${f}")
>>
>>       STRING(REGEX REPLACE ".*/([^/]*)$" "\\1" SRC "${SRC}")
>>
>>       SET_SOURCE_FILES_PROPERTIES(${SRC} PROPERTIES COMPILE_FLAGS -w)
>>
>>     ENDFOREACH(f)
>>
>>   ENDIF(CMAKE_COMPILER_IS_GNUCXX)
>>
>>   IF(MSVC)
>>
>>     FOREACH(f ${files})
>>
>>       STRING(REGEX REPLACE "\\.fl$" ".cxx" SRC "${f}")
>>
>>       STRING(REGEX REPLACE ".*/([^/]*)$" "\\1" SRC "${SRC}")
>>
>>       SET_SOURCE_FILES_PROPERTIES(${SRC} PROPERTIES COMPILE_FLAGS /w)
>>
>>     ENDFOREACH(f)
>>
>>   ENDIF(MSVC)
>>
>> ENDMACRO(ITK_DISABLE_FLTK_GENERATED_WARNINGS)
>>
>>
>>
>> Then I got the following error in cmake:
>>
>>
>>
>> CMake Error at CMakeLists.txt:82 (ADD_GUI_EXECUTABLE):
>> Unknown CMake command "ADD_GUI_EXECUTABLE".
>>
>> FLTK_WRAP_UI was called with a target that was never created:
>> RegionGrowingSegmentation. The problem was found while processing the source
>> directory: D:/ITKApps-27-01-2014/RegionGrowingSegmentation. This
>> FLTK_WRAP_UI call will be ignored.
>>
>> FLTK_WRAP_UI was called with a target that was never created:
>> RegionGrowingSegmentation2D. The problem was found while processing the
>> source directory: D:/ITKApps-27-01-2014/RegionGrowingSegmentation. This
>> FLTK_WRAP_UI call will be ignored.
>>
>> Configuring incomplete, errors occurred!
>>
>>
>>
>> Please tell me if I did anything wrong and what I need to do to build this
>> app. I need to find a way to build it separately since I wish to modify it a
>> little. Thanks.
>>
>>
>>
>> Regards
>>
>> Ruturaj
>>
>>
>>
>>
>>
>> From: Community [mailto:community-bounces at itk.org] On Behalf Of Girish,
>> Gavaskar Ruturaj
>> Sent: Friday, February 07, 2014 1:37 PM
>> To: Jon Haitz Legarreta
>>
>>
>> Cc: community at itk.org
>> Subject: Re: [ITK Community] Some questions about
>> RegionGrowingSegmentation
>>
>>
>>
>> Dear Jon,
>>
>>
>>
>> Thanks for your suggestion. I am looking to modify the source code to
>> accept multiple seed points so that more than one region can be segmented. I
>> find it much easier without a GUI as I never worked with developing a GUI
>> before. I will go through the links you posted.
>>
>>
>>
>> Regards
>>
>> Ruturaj
>>
>>
>>
>>
>>
>> From: Jon Haitz Legarreta [mailto:jhlegarreta at vicomtech.org]
>> Sent: Friday, February 07, 2014 1:15 PM
>> To: Girish, Gavaskar Ruturaj
>> Cc: community at itk.org
>> Subject: Re: [ITK Community] Some questions about
>> RegionGrowingSegmentation
>>
>>
>>
>> Dear Ruturaj,
>>
>> 1.- Haven't got the example with me, but if you intend to use a region
>> growing segmentation filter a good point to start is the ITK software guide,
>> chapter 9.1 [1]. There, you will be able to see which are the available
>> build-in algorithms/strategies, and you will see which are the methods you
>> need to call in order to make them work. Please, bear in mind that
>> segmentation is highly application-specific, and you may need to at least
>> adjust the parameters, when it's not to develop your own strategy based on
>> what's available in ITK, for example. Nevertheless, the available examples
>> in ITK are quite useful.
>>
>> 2.- Sure. The seed point can be read from wherever you need (user
>> interaction, program arguments, external file). The seed-setting method (or
>> whichever method actually requiring the seed point) will only require a
>> vector/array or individual coordinates, regardless of where you picked up
>> them.
>>
>> 3.- As said, haven't got the app in front of me, but surely you will be
>> able to build your own application for region growing segmentation without
>> any GUI. ITK is independent of any GUI (now, the apps may use a specific
>> one); you can just build an application with the GUI library that you most
>> like. Having said, that, may be the most common and easiest choice is Qt
>> [2], which has an open source version.
>>
>>
>>
>> [1] http://www.itk.org/ItkSoftwareGuide.pdf
>> [2] http://qt-project.org/
>>
>>
>>
>> On 7 February 2014 06:27, Girish, Gavaskar Ruturaj
>> <gavaskar.ruturaj.girish at philips.com> wrote:
>>
>> Hello All,
>>
>>
>>
>> I am new to ITK & C++ and I have some questions related to the ITK app
>> RegionGrowingSegmentation:
>>
>> 1.       Please explain to me the purpose of the function
>> RegionGrowingSegmentation:: ClickSelectCallback(float x, float y, float z,
>> float itkNotUsed(value), void * args), along with the meaning of the
>> arguments (Line 451 in RegionGrowingSegmentation.cxx)
>>
>> 2.       Is it possible to pass the coordinates of the seed point without
>> user interaction (for example, as arguments or by storing them in a file
>> etc.) ?
>>
>> 3.       Can this app be built without a GUI, so that the coordinates of
>> the seed point, along with other parameters, can be directly passed from the
>> command line? If yes, what is the procedure to build it?
>>
>>
>>
>> Thanks.
>>
>>
>>
>> Regards
>>
>> Ruturaj
>>
>>
>>
>>
>>
>> ________________________________
>>
>> The information contained in this message may be confidential and legally
>> protected under applicable law. The message is intended solely for the
>> addressee(s). If you are not the intended recipient, you are hereby notified
>> that any use, forwarding, dissemination, or reproduction of this message is
>> strictly prohibited and may be unlawful. If you are not the intended
>> recipient, please contact the sender by return e-mail and destroy all copies
>> of the original message.
>>
>>
>> _______________________________________________
>> Community mailing list
>> Community at itk.org
>> http://public.kitware.com/cgi-bin/mailman/listinfo/community
>>
>>
>>
>>
>> _______________________________________________
>> Community mailing list
>> Community at itk.org
>> http://public.kitware.com/cgi-bin/mailman/listinfo/community
>>
>>
>
>
>
> _______________________________________________
> Community mailing list
> Community at itk.org
> http://public.kitware.com/cgi-bin/mailman/listinfo/community
>



-- 
Unpaid intern in BillsBasement at noware dot com



More information about the Community mailing list