<br>Hi Denis,<br><br>Thanks for pointing this out.<br><br>After giving it a try at adding these elements,<br>we found out that the reason why they were <br>not there, is that the operator "less than" can't be<br>
(or at least is not currently) defined for this types.<br><br>The ShapeKeepNObjectsLabelMapFilter removes<br>objects whose attribute value is less than a <br>user-provided value.<br><br>Since this comparison operation cannot be easily <br>
defined for something like "Centroid", or "PrincipalAxes",<br>these attributes are not part of the filter.<br><br>Probably the only way to include them in the filter<br>is by referring to their elements, instead of the full <br>
type.<br><br>For example, we could filter the image by<br><br><br> Centroid_X < 156.0<br><br>but we can't do<br><br> Centroid < 156.0 :-/<br><br><br>---<br><br><br>The fix for itkShapeLableObject.h, <br>
on the other hand, has been pushed to Gerrit:<br><br> <a href="http://review.source.kitware.com/#change,69">http://review.source.kitware.com/#change,69</a><br><br><br> Thanks !<br><br><br> Regards,<br><br><br> Luis<br>
<br><br>----------------------------------------------------------------------------<br><div class="gmail_quote">On Fri, Sep 10, 2010 at 9:04 AM, Denis Shamonin <span dir="ltr"><<a href="mailto:dshamoni@gmail.com">dshamoni@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi all,<br>
<br>
The ShapeKeepNObjectsLabelMapFilter class missing number of<br>
AccessorType's initializations in GenerateData()<br>
But they are defined in itkShapeKeepNObjectsLabelMapFilter.h<br>
<br>
Here is the missing list:<br>
<br>
Centroid<br>
Region<br>
BinaryPrincipalMoments<br>
BinaryPrincipalAxes<br>
EquivalentEllipsoidSize<br>
<br>
You have to add this type of initializations for GenerateData() switch(...)<br>
<br>
case LabelObjectType::CENTROID:<br>
{<br>
typedef typename Functor::CentroidLabelObjectAccessor<<br>
LabelObjectType > AccessorType;<br>
AccessorType accessor;<br>
this->TemplatedGenerateData( accessor );<br>
break;<br>
}<br>
...<br>
<br>
BTW: please add extra line to itkShapeLabelObject.h<br>
static std::string GetNameFromAttribute( const AttributeType & a )<br>
{<br>
switch( a )<br>
{<br>
...<br>
case CENTROID:<br>
return "Centroid";<br>
break; // <---------------------------------- THIS LINE, not a<br>
bug, just style.<br>
...<br>
}<br>
<br>
Please fix it, Thanks.<br>
<br>
-Denis<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote></div><br>