<div dir="ltr"><div><span style="color:rgb(0,0,150);font-family:"Courier";font-size:8.25pt">Hi all,</span></div><div><span style="color:rgb(0,0,150);font-family:"Courier";font-size:8.25pt"> thank you.</span></div>
<div><span style="color:rgb(0,0,150);font-family:"Courier";font-size:8.25pt">At the moment there's no way to add a list of seeds in sitkIsolatedConnectedImageFilter, since there are no methods AddSeed/AddSeed1/AddSeed2.</span></div>
<div><span style="color:rgb(0,0,150);font-family:"Courier";font-size:8.25pt"></span> </div><div><span style="color:rgb(0,0,150);font-family:"Courier";font-size:8.25pt">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).</span></div>
<div><span style="color:rgb(0,0,150);font-family:"Courier";font-size:8.25pt"></span> </div><div><span style="color:rgb(0,0,150);font-family:"Courier";font-size:8.25pt">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.</span></div>
<div><span style="color:rgb(0,0,150);font-family:"Courier";font-size:8.25pt"></span> </div><div><span style="color:rgb(0,0,150);font-family:"Courier";font-size:8.25pt">Thanks</span></div><div><span style="color:rgb(0,0,150);font-family:"Courier";font-size:8.25pt">Chiara</span></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-05-13 15:34 GMT+01:00 Padfield, Dirk R (GE Global Research) <span dir="ltr"><<a href="mailto:padfield@research.ge.com" target="_blank">padfield@research.ge.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Brad and Chiara,<br>
<br>
Thanks for the clarification. I have a couple of thoughts:<br>
<br>
1) The "SetSeed" methods are deprecated not the "AddSeed" methods.<br>
<br>
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).<br>
<br>
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:<br>
ConfidenceConnected(Image imageA, VectorUIntList seedList, unsigned int numberOfIterations=4u, double multiplier=4.5, unsigned int initialNeighborhoodRadius=1u, uint8_t replaceValue=1u) -> Image<br>
<br>
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.<br>
<br>
5) According to <a href="http://www.itk.org/SimpleITKDoxygen/html/classitk_1_1simple_1_1IsolatedConnectedImageFilter.html" target="_blank">http://www.itk.org/SimpleITKDoxygen/html/classitk_1_1simple_1_1IsolatedConnectedImageFilter.html</a>, 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:<br>
<br>
GetSeeds1<br>
ClearSeeds1<br>
AddSeed1<br>
SetSeed1<br>
<br>
but it does not have AddSeed1 or AddSeed2.<br>
<br>
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.<br>
<br>
Thanks,<br>
Dirk<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
On May 13, 2014, at 9:58 AM, Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>> wrote:<br>
<br>
> Dirk,<br>
><br>
> Here is the SimpleITK template with the expected "Seed" interface:<br>
><br>
> <a href="https://github.com/SimpleITK/SimpleITK/blob/master/Code/BasicFilters/templates/sitkRegionGrowingImageFilterTemplate.h.in#L35-L66" target="_blank">https://github.com/SimpleITK/SimpleITK/blob/master/Code/BasicFilters/templates/sitkRegionGrowingImageFilterTemplate.h.in#L35-L66</a><br>
><br>
> The methods are as followed:<br>
><br>
> SetSeedList<br>
> GetSeedList<br>
> ClearSeeds<br>
> SetSeed<br>
> AddSeed<br>
><br>
> This template is used for ConfidenceConnected, ConnectedThreshold, NeighborhoodConnected and VectorConfidenceConnected<br>
><br>
> For the IsolatedConnected we have the following:<br>
><br>
> GetSeeds1<br>
> CearSeeds1<br>
> AddSeed1<br>
> SetSeed1<br>
><br>
> Notice the missing SetSeed1[List] method, and the missing "List" suffix.<br>
><br>
> 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.<br>
><br>
> Brad<br>
><br>
> On May 13, 2014, at 9:36 AM, Padfield, Dirk R (GE Global Research) <<a href="mailto:padfield@research.ge.com">padfield@research.ge.com</a>> wrote:<br>
><br>
>> Hi Brad and Chiara,<br>
>><br>
>> 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: <a href="http://www.itk.org/Doxygen/html/classitk_1_1IsolatedConnectedImageFilter.html" target="_blank">http://www.itk.org/Doxygen/html/classitk_1_1IsolatedConnectedImageFilter.html</a>. 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).<br>
>><br>
>> 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.<br>
>><br>
>> 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.<br>
>><br>
>> 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.<br>
>><br>
>> 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.<br>
>><br>
>> Dirk<br>
>><br>
>><br>
>> ________________________________<br>
>> From: Bradley Lowekamp [<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>]<br>
>> Sent: Tuesday, May 13, 2014 9:09 AM<br>
>> To: Chiara Caborni<br>
>> Cc: <a href="mailto:insight-users@itk.org">insight-users@itk.org</a>; <a href="mailto:community@itk.org">community@itk.org</a>; <a href="mailto:slicer-users@bwh.harvard.edu">slicer-users@bwh.harvard.edu</a>; Padfield, Dirk R (GE Global Research)<br>
>> Subject: Re: [ITK] Add Seed in SimpleITK.IsolatedConnectedImageFilter<br>
>><br>
>> Hello Chaira,<br>
>><br>
>> 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.<br>
>><br>
>> 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.<br>
>><br>
>> 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.<br>
>><br>
>> What is your time frame on this?<br>
>><br>
>> Brad<br>
>><br>
>> On May 13, 2014, at 7:02 AM, Chiara Caborni <<a href="mailto:chiara.caborni@gmail.com">chiara.caborni@gmail.com</a><mailto:<a href="mailto:chiara.caborni@gmail.com">chiara.caborni@gmail.com</a>>> wrote:<br>
>><br>
>><br>
>> Hello,<br>
>><br>
>> I'm using Slicer 4.3.1, which has SimpleFilters module in it.<br>
>><br>
>> I'm trying adding seeds (using methods SetSeed1/SetSeed2) to a SimpleITK.IsolatedConnectedImageFilter.<br>
>><br>
>> I succedeed adding a list of seeds as input to a SimpleITK.ConnectedThresholdImageFilter,<br>
>> using the method, AddSeed(), so that I can iteratively add seeds and then obtain a list of seeds with the method GetSeedList().<br>
>><br>
>> But since the IsolatedConnectedImageFilter has no method addSeed, but just SetSeed#, I can just add one seed using SetSeed1 and another one using SetSeed2.<br>
>> How can I specify more than one seed for both regions 1&2 to separate?<br>
>><br>
>> In the DOxygen page, <a href="http://www.itk.org/SimpleITKDoxygen/html/classitk_1_1simple_1_1IsolatedConnectedImageFilter.html" target="_blank">http://www.itk.org/SimpleITKDoxygen/html/classitk_1_1simple_1_1IsolatedConnectedImageFilter.html</a><br>
>> , I read the method SetSeed1/2 is deprecated, please use AddSeed, but there's no AddSeed method in IsolatedConnectedImageFilter.<br>
>><br>
>> Any help appreciated, thank you<br>
>> kind regards<br>
>> Chiara<br>
>> --<br>
>> Chiara<br>
>> _______________________________________________<br>
>> Community mailing list<br>
>> <a href="mailto:Community@itk.org">Community@itk.org</a><mailto:<a href="mailto:Community@itk.org">Community@itk.org</a>><br>
>> <a href="http://public.kitware.com/cgi-bin/mailman/listinfo/community" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/community</a><br>
>><br>
><br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Chiara
</div>