[ITK-users] [ITK] Add Seed in SimpleITK.IsolatedConnectedImageFilter
Bradley Lowekamp
blowekamp at mail.nih.gov
Tue May 13 09:58:08 EDT 2014
Dirk,
Here is the SimpleITK template with the expected "Seed" interface:
https://github.com/SimpleITK/SimpleITK/blob/master/Code/BasicFilters/templates/sitkRegionGrowingImageFilterTemplate.h.in#L35-L66
The methods are as followed:
SetSeedList
GetSeedList
ClearSeeds
SetSeed
AddSeed
This template is used for ConfidenceConnected, ConnectedThreshold, NeighborhoodConnected and VectorConfidenceConnected
For the IsolatedConnected we have the following:
GetSeeds1
CearSeeds1
AddSeed1
SetSeed1
Notice the missing SetSeed1[List] method, and the missing "List" suffix.
The current marking of the deprecation of the AddSeed methods was not apparent to me. I do fine the method convenient, and I think it's common to use these filters with only one seed.
Brad
On May 13, 2014, at 9:36 AM, Padfield, Dirk R (GE Global Research) <padfield at research.ge.com> wrote:
> Hi Brad and Chiara,
>
> In IsolatedConnected, the SetSeed1() and SetSeed2() are deprecated methods marked as such both in the doxygen and using the ITK_FUTURE_LEGACY_REMOVE in the code: http://www.itk.org/Doxygen/html/classitk_1_1IsolatedConnectedImageFilter.html. When I recently was looking at this filter, I found that these methods were listed as deprecated, so I added the ITK_FUTURE_LEGACY_REMOVE blocks around them. In the code, these methods simply call the corresponding AddSeed1() and AddSeed2() methods (after clearing the seeds).
>
> Although I wasn't the one who initially marked these methods as deprecated, I can understand why they are. AddSeed makes more sense because it enables the setting of multiple seeds for each of the two regions to be isolated from each other, and once you have AddSeed, there is no longer any reason to have SetSeed.
>
> The SetSeed methods are also marked as deprecated in ConfidenceConnected. They should be marked as deprecated in both ConnectedThreshold and NeighborhoodConnected. In all cases, the SetSeed methods are just shells that call AddSeed.
>
> It would be good to have an ITK patch that marks SetSeed as deprecated in all of these region growing algorithms and also adds corresponding ITK_FUTURE_LEGACY_REMOVE blocks around the code.
>
> I have had success passing lists of seed points into ConfidenceConnected using SimpleITK, and it works very well. The best approach for SimpleITK would probably be to enable this for all of these region growing filters and to get rid of SetSeed for all of them.
>
> Dirk
>
>
> ________________________________
> From: Bradley Lowekamp [blowekamp at mail.nih.gov]
> Sent: Tuesday, May 13, 2014 9:09 AM
> To: Chiara Caborni
> Cc: insight-users at itk.org; community at itk.org; slicer-users at bwh.harvard.edu; Padfield, Dirk R (GE Global Research)
> Subject: Re: [ITK] Add Seed in SimpleITK.IsolatedConnectedImageFilter
>
> Hello Chaira,
>
> 1) I don't think those methods should be deprecated. I think that the Seed interfaces for the two filters you mentioned should match. That means this method should not be removed.
>
> 2) The SimpleITK filter currently doesn't consider Seed1 and Seed2 to be list it's just treating them like single points. In my experience when I tries to use many seeds very frequently the filter would fail to find a valid value and fail.
>
> I think it's most useful for the procedural method to stay as it is just accepting the two points. What could be done is to add a methods just to the class interface which allows for the Set/Get as a list. I would not be inclined to add the Clear and Add function methods as the interface.
>
> What is your time frame on this?
>
> Brad
>
> On May 13, 2014, at 7:02 AM, Chiara Caborni <chiara.caborni at gmail.com<mailto:chiara.caborni at gmail.com>> wrote:
>
>
> Hello,
>
> I'm using Slicer 4.3.1, which has SimpleFilters module in it.
>
> I'm trying adding seeds (using methods SetSeed1/SetSeed2) to a SimpleITK.IsolatedConnectedImageFilter.
>
> I succedeed adding a list of seeds as input to a SimpleITK.ConnectedThresholdImageFilter,
> using the method, AddSeed(), so that I can iteratively add seeds and then obtain a list of seeds with the method GetSeedList().
>
> But since the IsolatedConnectedImageFilter has no method addSeed, but just SetSeed#, I can just add one seed using SetSeed1 and another one using SetSeed2.
> How can I specify more than one seed for both regions 1&2 to separate?
>
> In the DOxygen page, http://www.itk.org/SimpleITKDoxygen/html/classitk_1_1simple_1_1IsolatedConnectedImageFilter.html
> , I read the method SetSeed1/2 is deprecated, please use AddSeed, but there's no AddSeed method in IsolatedConnectedImageFilter.
>
> Any help appreciated, thank you
> kind regards
> Chiara
> --
> Chiara
> _______________________________________________
> Community mailing list
> Community at itk.org<mailto:Community at itk.org>
> http://public.kitware.com/cgi-bin/mailman/listinfo/community
>
More information about the Insight-users
mailing list