[Insight-users] Missing some initializations for ShapeKeepNObjectsLabelMapFilter.

Luis Ibanez luis.ibanez at kitware.com
Sun Sep 12 09:38:28 EDT 2010


Hi Denis,

Thanks for pointing this out.

After giving it a try at adding these elements,
we found out that the reason why they were
not there, is that the operator "less than" can't be
(or at least is not currently) defined for this types.

The ShapeKeepNObjectsLabelMapFilter removes
objects whose attribute value is less than a
user-provided value.

Since this comparison operation cannot be easily
defined for something like "Centroid", or "PrincipalAxes",
these attributes are not part of the filter.

Probably the only way to include them in the filter
is by referring to their elements, instead of the full
type.

For example, we could filter the image by


              Centroid_X   <  156.0

but we can't do

               Centroid  < 156.0         :-/


---


The fix for itkShapeLableObject.h,
on the other hand, has been pushed to Gerrit:

   http://review.source.kitware.com/#change,69


  Thanks !


       Regards,


              Luis


----------------------------------------------------------------------------
On Fri, Sep 10, 2010 at 9:04 AM, Denis Shamonin <dshamoni at gmail.com> wrote:

> Hi all,
>
> The ShapeKeepNObjectsLabelMapFilter class missing number of
> AccessorType's initializations in GenerateData()
> But they are defined in itkShapeKeepNObjectsLabelMapFilter.h
>
> Here is the missing list:
>
> Centroid
> Region
> BinaryPrincipalMoments
> BinaryPrincipalAxes
> EquivalentEllipsoidSize
>
> You have to add this type of initializations for GenerateData() switch(...)
>
>   case LabelObjectType::CENTROID:
>      {
>      typedef typename Functor::CentroidLabelObjectAccessor<
> LabelObjectType > AccessorType;
>      AccessorType accessor;
>      this->TemplatedGenerateData( accessor );
>      break;
>      }
> ...
>
> BTW: please add extra line to itkShapeLabelObject.h
>  static std::string GetNameFromAttribute( const AttributeType & a )
>    {
>    switch( a )
>      {
>      ...
>      case CENTROID:
>        return "Centroid";
>        break; // <---------------------------------- THIS LINE, not a
> bug, just style.
>      ...
>      }
>
> Please fix it, Thanks.
>
> -Denis
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20100912/1636a10a/attachment.htm>


More information about the Insight-users mailing list