[ITK] Add Seed in SimpleITK.IsolatedConnectedImageFilter
Chiara Caborni
chiara.caborni at gmail.com
Tue May 13 11:05:38 EDT 2014
Hi all,
thank you.
At the moment there's no way to add a list of seeds in
sitkIsolatedConnectedImageFilter, since there are no methods
AddSeed/AddSeed1/AddSeed2.
In ITK, v3.2 for example, the itkIsolatedConnectedImageFilter.h has the
methods AddSeed1, AddSeed2, which uses push_back, to add seeds into the
list. So I could use that class in a cxx code which is run from
os.system(that_code.exe inputs¶meters&output).
But if there's the chance, I'd happy for these methods to be added also in
the SimpleITK class, sitkIsolatedConnectedImageFilter, since it's easier to
use the SimpleITK filter interface already in Slicer Simple filters.
Thanks
Chiara
2014-05-13 15:34 GMT+01:00 Padfield, Dirk R (GE Global Research) <
padfield at research.ge.com>:
> Hi Brad and Chiara,
>
> Thanks for the clarification. I have a couple of thoughts:
>
> 1) The "SetSeed" methods are deprecated not the "AddSeed" methods.
>
> 2) There is no need for SetSeed. AddSeed does exactly the same thing.
> The only difference is that, when AddSeed is called multiple times, it
> adds additional seeds. This is also evident in the link you sent to the
> "Seed" interface (granted, SetSeed clears the seeds first, but the first
> time AddSeed is called, the list is also cleared already).
>
> 3) Along the same lines, having a seed list as the only option in
> SimpleITK seems sufficient to me because having only one seed is just a
> list with one entry. For example, the functional interface to
> ConfidenceConnected uses the seedList:
> ConfidenceConnected(Image imageA, VectorUIntList seedList, unsigned int
> numberOfIterations=4u, double multiplier=4.5, unsigned int
> initialNeighborhoodRadius=1u, uint8_t replaceValue=1u) -> Image
>
> 4) Why does IsolatedConnected not have seed lists? I can't see any reason
> why it shouldn't have the same methods as the others with the only
> difference being that it has two of each: one each for Seed1 and Seed2.
> Note that Seed1 and Seed2 are defined differently here: they are seeds in
> two different regions of the image that need to be "isolated" from each
> other. The other region growing algorithms only have one set of seeds.
>
> 5) According to
> http://www.itk.org/SimpleITKDoxygen/html/classitk_1_1simple_1_1IsolatedConnectedImageFilter.html,
> the documentation states that SetSeed is deprecated and that we should use
> AddSeed instead, but there are no AddSeed methods. This is consistent with
> what Chiara was saying in the first place. In the last email, you stated
> that IsolatedConnected has:
>
> GetSeeds1
> ClearSeeds1
> AddSeed1
> SetSeed1
>
> but it does not have AddSeed1 or AddSeed2.
>
> 6) There *might* be value to adding seed lists to the ITK versions of the
> filters. This would enable us to call the algorithms without having to
> loop through the AddSeed method if we already have the seeds stored in a
> vector.
>
> Thanks,
> Dirk
>
>
>
> On May 13, 2014, at 9:58 AM, Bradley Lowekamp <blowekamp at mail.nih.gov>
> wrote:
>
> > 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
> >>
> >
>
>
--
Chiara
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20140513/0dc2f00c/attachment-0002.html>
More information about the Community
mailing list