[Insight-developers] Modifying MaskImageFilter to work on VectorImage

Luis Ibanez luis.ibanez at kitware.com
Sun Apr 10 17:50:11 EDT 2011


Hi David,

We have been discussing this problem with Julien Malik from the
Orfeo Toolbox team.

In summary, there is a function in the NumericTraits that is intended
to deal with management of size in containers of variable size
such as the VariableLengthVector and the std::vector.

Regarding your questions, please see below.

On Thu, Apr 7, 2011 at 7:50 PM, David Doria <daviddoria at gmail.com> wrote:
> We have been having some discussion on the best way to allow MaskImageFilter
> to work on VectorImage (with pixels of type VariableLengthVector) . The
> problem is that the length of a VariableLengthVector is not defined at
> compile time. This means that in the MaskInput functor, the
> member m_OutsideValue cannot be initialized.
>
> Brad has identified two problems,
>
> 1) How do we initialized the member variable in the functor?
>

We usually add "Set" methods to the functor,
the add "Set" methods to the Filter itself,
and they simply call the "Set" methods of the functor.

> This seems to be the main issue I'm not sure how to address.
>
> 2) When do we detect the size of the vector image, and use reasonable
> defaults?
>


At run time,
by asking them for their "GetNumberOfComponents()
from the vector image.

Reasonable default (otherwise) is "1".

> We think this could be done in BeforeThreadedGenerateData.
>

Yes, that's a good place.

The GenerateInputInformation() or
GenerateOutputInformation() may
be good places as well.


> The complete conversation is here:
>
> http://review.source.kitware.com/#change,1338
> Any thoughts are welcome!
> Thanks,
>
> David
>
> _______________________________________________
> 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://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-developers
>
>


More information about the Insight-developers mailing list