<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi Brad,</div><div class=""><br class=""></div><div class="">It is an excellent idea to extract attributes calculation from Shape/StatisticsLabelMapFilter to be able to reuse it.</div><div class="">I can give a hand on this effort, but to be honest I have really high interest on the bounding box / region and can work this one out from early next week.</div><div class=""><br class=""></div><div class="">Arnaud</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 17 Apr 2015, at 15:04, Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov" class="">blowekamp@mail.nih.gov</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=windows-1252" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">So essentially you are talking about moving some computational code from the ShapeLabelMapFilter [1]  into the LabelObject class? As there is already an ShapeLabelObject::GetBoundingBox method perhaps the naming of LabelObject::ComputeBoundingBox would be appropriate?</div><div class=""><br class=""></div><div class="">In general the design of the LabelMap frame work should be considered. Currently, it's a very pipeline focus approach, where all the LabelMap attributes are computed as in filters. This is different than other label statistics frameworks where the the attributes are computed on demand when needed. It's a slippery slope to add procedural computational methods one by one to classes.</div><div class=""><br class=""></div><div class="">One option to consider to to refactor the code which calculates attributes in the ShapeLabelMapFilter and StatisticsLabelMapFilter in to a type of Calculator support class? So that the same code can be reused by multiple filters and procedural methods?</div><div class=""><br class=""></div><div class="">Just a thought,</div><div class="">HTH,</div><div class="">Brad</div><div class=""><br class=""></div><div class="">[1] <a href="https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/LabelMap/include/itkShapeLabelMapFilter.hxx#L272-L283" class="">https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/LabelMap/include/itkShapeLabelMapFilter.hxx#L272-L283</a></div><div class=""><br class=""><div class=""><div class="">On Apr 17, 2015, at 8:47 AM, Arnaud Gelas <<a href="mailto:arnaudgelas@gmail.com" class="">arnaudgelas@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite" class="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">More precisely, I’d be really interested in having a BoundingBox or Region for each LabelObject by using one method (I do not really need to maintain it), and then it can be directly be deduced form each LabelObject.<div class=""><br class=""></div><div class="">If that’s ok with you, early next week I could add one method to the LabelObject to get such information (?), then you can still work main features you need.</div><div class=""><br class=""></div><div class="">Arnaud<br class=""><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On 17 Apr 2015, at 14:24, Pol Monsó Purtí <<a href="mailto:lluna.nova@gmail.com" class="">lluna.nova@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Yes sorry I had to pospone it because of an stressful deadline I have, but hopefully next week, two tops.<br class=""></div><div class="gmail_extra"><br class=""><div class="gmail_quote">2015-04-17 12:09 GMT+02:00 Arnaud Gelas <span dir="ltr" class=""><<a href="mailto:arnaudgelas@gmail.com" target="_blank" class="">arnaudgelas@gmail.com</a>></span>:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Hi Pol,<div class=""><br class=""></div><div class="">I am extremely interested in this change!!!</div><div class="">Do you have any idea when you think you could submit a patch for it?</div><div class=""><br class=""></div><div class="">thanks,</div><div class="">Arnaud</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br class=""><div class="gmail_quote">On Fri, Apr 3, 2015 at 6:44 PM, Pol Monsó Purtí <span dir="ltr" class=""><<a href="mailto:lluna.nova@gmail.com" target="_blank" class="">lluna.nova@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class=""><div class=""><div class="">Thanks Matt,<br class=""><br class=""></div>I've set the Git and Gerrit access. I believe everything's ok. I'll get to it next Tuesday.<br class=""><br class=""></div>Cheers,<br class=""><br class=""></div>Pol<br class=""></div><div class=""><div class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">2015-04-02 15:22 GMT+02:00 Matt McCormick <span dir="ltr" class=""><<a href="mailto:matt.mccormick@kitware.com" target="_blank" class="">matt.mccormick@kitware.com</a>></span>:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Pol,<br class="">
<br class="">
Thanks for considering make improvements to this code.  Instructions<br class="">
to submit a patch can be found here [1].  Please let us know if you<br class="">
have any questions.<br class="">
<br class="">
Thanks,<br class="">
Matt<br class="">
<br class="">
[1] <a href="https://insightsoftwareconsortium.github.io/ITKBarCamp-doc/CommunitySoftwareProcess/SubmitAPatchToGerrit/index.html" target="_blank" class="">https://insightsoftwareconsortium.github.io/ITKBarCamp-doc/CommunitySoftwareProcess/SubmitAPatchToGerrit/index.html</a><br class="">
<div class=""><div class=""><br class="">
On Thu, Apr 2, 2015 at 8:52 AM, Pol Monsó Purtí <<a href="mailto:lluna.nova@gmail.com" target="_blank" class="">lluna.nova@gmail.com</a>> wrote:<br class="">
> Hello Gaëtan,<br class="">
><br class="">
> Yes I agree, Thinking about it later I also reached the same conclusion that<br class="">
> a filter that changes the regions internally without warning could be a<br class="">
> pitfall.<br class="">
><br class="">
> The RegionFromReferenceLabelMapFilter might actually work for me given that<br class="">
> I do have the original ROI region and roi image, but I can implement the<br class="">
> ComputeBoundingBox() function anyway, it's cleaner if I don't use the<br class="">
> original ROI.<br class="">
><br class="">
> What's the workflow for submitting code? Fork the itk repository, add the<br class="">
> method and PR or something else?<br class="">
><br class="">
> If you'd rather have a filter that does this, I unfortunatelly won't have<br class="">
> the time to do it this month (and maybe next)...<br class="">
><br class="">
> Cheers,<br class="">
><br class="">
> Pol<br class="">
><br class="">
><br class="">
><br class="">
> 2015-04-02 14:32 GMT+02:00 Gaetan Lehmann <<a href="mailto:gaetan.lehmann@gmail.com" target="_blank" class="">gaetan.lehmann@gmail.com</a>>:<br class="">
>><br class="">
>> Hi Pol,<br class="">
>><br class="">
>> 2015-03-30 23:02 GMT+02:00 Pol Monsó Purtí <<a href="mailto:lluna.nova@gmail.com" target="_blank" class="">lluna.nova@gmail.com</a>>:<br class="">
>>><br class="">
>>><br class="">
>>> Hello all,<br class="">
>>><br class="">
>>> I have two label objects, how can I merge the two BoundingBoxes together<br class="">
>>> so I know the necessary size of the image? (other than creating it myself by<br class="">
>>> searching max/min of each dimension)<br class="">
>>><br class="">
>>> How come LabelMap doesn't resize automatically when objects are added? It<br class="">
>>> could.<br class="">
>><br class="">
>><br class="">
>> The LabelMap class was designed to work as much as possible as the Image<br class="">
>> class, that does not have this kind of behavior, and to avoid as much as<br class="">
>> possible the costly operations.<br class="">
>><br class="">
>> So while I don't think this should be done automatically, we should have<br class="">
>> some methods or filters to make this easy to do.<br class="">
>><br class="">
>> There are a few filters to manipulate the regions of a LabelMap, but none<br class="">
>> of them does exactly what you need:<br class="">
>><br class="">
>> * PadLabelMapFilter that can enlarge the LabelMap region, but not based on<br class="">
>> its content<br class="">
>> * CropLabelMapFilter that can shrink the LabelMap region, but not based on<br class="">
>> its content<br class="">
>> * RegionFromReferenceLabelMapFilter that makes the LabelMap region match<br class="">
>> the region of a reference input image<br class="">
>> * AutoCropLabelMapFilter that reduce the region covered by a label map<br class="">
>> based on its content, but can't enlarge it<br class="">
>><br class="">
>> In my opinion, we should have a ComputeBoundingBox() method in LabelMap<br class="">
>> that compute the region covered by all the label objects - the code can be<br class="">
>> moved from AutoCropLabelMapFilter. We could then do<br class="">
>><br class="">
>>   labelMap->AddLabelObject(labelObject1);<br class="">
>>   labelMap->AddLabelObject(labelObject2);<br class="">
>>   labelMap->SetRegions(labelMap->ComputeBoundingBox());<br class="">
>><br class="">
>> to update the region.<br class="">
>><br class="">
>> Would you agree to implement such a method for the LabelMap class?<br class="">
>><br class="">
>> Optionally, we could also think to a filter to do that in a pipeline.<br class="">
>><br class="">
>> Regards,<br class="">
>><br class="">
>> Gaëtan<br class="">
>><br class="">
><br class="">
><br class="">
><br class="">
</div></div><div class=""><div class="">> _____________________________________<br class="">
> Powered by <a href="http://www.kitware.com/" target="_blank" class="">www.kitware.com</a><br class="">
><br class="">
> Visit other Kitware open-source projects at<br class="">
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank" class="">http://www.kitware.com/opensource/opensource.html</a><br class="">
><br class="">
> Kitware offers ITK Training Courses, for more information visit:<br class="">
> <a href="http://www.kitware.com/products/protraining.php" target="_blank" class="">http://www.kitware.com/products/protraining.php</a><br class="">
><br class="">
> Please keep messages on-topic and check the ITK FAQ at:<br class="">
> <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank" class="">http://www.itk.org/Wiki/ITK_FAQ</a><br class="">
><br class="">
> Follow this link to subscribe/unsubscribe:<br class="">
> <a href="http://public.kitware.com/mailman/listinfo/insight-users" target="_blank" class="">http://public.kitware.com/mailman/listinfo/insight-users</a><br class="">
><br class="">
</div></div></blockquote></div><br class=""></div>
</div></div><br class="">_____________________________________<br class="">
Powered by <a href="http://www.kitware.com/" target="_blank" class="">www.kitware.com</a><br class="">
<br class="">
Visit other Kitware open-source projects at<br class="">
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank" class="">http://www.kitware.com/opensource/opensource.html</a><br class="">
<br class="">
Kitware offers ITK Training Courses, for more information visit:<br class="">
<a href="http://www.kitware.com/products/protraining.php" target="_blank" class="">http://www.kitware.com/products/protraining.php</a><br class="">
<br class="">
Please keep messages on-topic and check the ITK FAQ at:<br class="">
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank" class="">http://www.itk.org/Wiki/ITK_FAQ</a><br class="">
<br class="">
Follow this link to subscribe/unsubscribe:<br class="">
<a href="http://public.kitware.com/mailman/listinfo/insight-users" target="_blank" class="">http://public.kitware.com/mailman/listinfo/insight-users</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</div></div></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></div></div>_____________________________________<br class="">Powered by <a href="http://www.kitware.com/" class="">www.kitware.com</a><br class=""><br class="">Visit other Kitware open-source projects at<br class=""><a href="http://www.kitware.com/opensource/opensource.html" class="">http://www.kitware.com/opensource/opensource.html</a><br class=""><br class="">Kitware offers ITK Training Courses, for more information visit:<br class=""><a href="http://www.kitware.com/products/protraining.php" class="">http://www.kitware.com/products/protraining.php</a><br class=""><br class="">Please keep messages on-topic and check the ITK FAQ at:<br class="">http://www.itk.org/Wiki/ITK_FAQ<br class=""><br class="">Follow this link to subscribe/unsubscribe:<br class="">http://public.kitware.com/mailman/listinfo/insight-users<br class=""></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></body></html>