[Insight-users] CMake Stack size

Matthias Dodt matthias.dodt at mdc-berlin.de
Thu Oct 8 07:30:36 EDT 2009


Hi Daniel!

Thanks for the advice - i know only of the non recursive scanline 
algorithm, but i would have liked to avoid re-implementing it. Ill have 
a look at itkShapeLabelObject. I need to compute although the centroid 
and find pixels which lie in a certain range of a seed, so i'll have to 
iterate over all pixels of the itkShapeLabelObject. Ill have to check 
how it works...

Thanks so far!

Greetings

Mat


Daniel Blezek schrieb:
> Hi Mat,
>
>   Flood fills don't have to be recursive.  It is much more efficient to
> manage a stack (using stl::vector) of voxels than to use recursion.  Then no
> worries about stack size for recursion.
>
>   If you just want to figure out the area of a given object, you can use the
> itkShapeLabelObject in the Review directory.
>
> -dan
>
>
> On 10/7/09 11:05 AM, "Matthias Dodt" <matthias.dodt at mdc-berlin.de> wrote:
>
>   
>> Hey Guys!
>>
>> I wrote a simple ITK ImageToImage filter using the floodfill algorithm
>> and doing some more computation. Unfortunately it crashes with big
>> images (floodfill works via recursion). Is there a way to increase the
>> stack size in CMakeLists.txt? For now it looks as follows:
>>
>> PROJECT(itk_tracker_project)
>>
>> SET ( ITK_DIR /usr/local/lib/InsightToolkit )
>> SET ( CMAKE_MODULE_PATH /users/mat/Documents/InsightToolkit-3.14.0/CMake )
>>
>> FIND_PACKAGE(ITK)
>> IF(ITK_FOUND)
>>   INCLUDE(${ITK_USE_FILE})
>> ELSE(ITK_FOUND)
>>   MESSAGE(FATAL_ERROR "Cannot build without ITK.  Please set ITK_DIR.")
>> ENDIF(ITK_FOUND)
>>
>> LINK_LIBRARIES(
>>     ITKAlgorithms ITKCommon ITKNumerics ITKIO ITKBasicFilters )
>>
>> SET(AutoRegistration
>> src/main.cpp
>> src/HuangWangLiuThinner.h
>> src/DattaPauriThinner.h
>> src/Skeletonizer.h
>> )
>>
>> ADD_EXECUTABLE ( itk_tracker_project_main ${AutoRegistration} )
>> INSTALL_TARGETS ( /itk_build itk_tracker_project_main  )
>>
>>
>> I konw there is although a connected-components filter- but i need to
>> know the number of pixels in a label (area) and it seems to me
>> connectedComponents doesnt return this...
>>
>> Thanks!
>>
>> Greetings
>>
>> Mat
>> _____________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the ITK FAQ at:
>> http://www.itk.org/Wiki/ITK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.itk.org/mailman/listinfo/insight-users
>>     
>
>   



More information about the Insight-users mailing list