[Insight-developers] itk::VectorImage

Karthik Krishnan karthik.krishnan at kitware.com
Tue Apr 14 13:28:00 EDT 2009


On Tue, Apr 14, 2009 at 1:14 PM, Brady McCary
<brady.mccary+ITK at gmail.com<brady.mccary%2BITK at gmail.com>
> wrote:

> insight-developers,
>
> itk::VectorImage is an image class that has itk::VariableLengthVector
> as it's pixel type. The reason why these classes were created was for
> memory layout purposes. For more info, see


Brady:

The intent was to avoid both memory fragmentation, as you point out, and to
allow for an image whose dimensionality could be changed at run time.

If your length is fixed at compile time and you want to avoid memory
fragmentation, I think (I have to double check with the developers here)
that you can use  Image< Vector< T, N >, D >

I believe this would avoid fragmentation and allocate the Vectors as a
contiguous chunk as opposed to  Image< Array< T >, D >  which would result
in heavy fragmentation.

--
karthik



>
>
> http://www.itk.org/Doxygen/html/classitk_1_1VectorImage.html
> http://www.itk.org/Doxygen/html/classitk_1_1VariableLengthVector.html
>
> The number of components in itk::VariableLengthVector is modifiable at
> run-time, as opposed to itk::Vector which takes its number of
> components as a template parameter. Is there a reason why the original
> developer made the number of components modifiable at run time?
>
> Brady
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.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
>



-- 
Karthik Krishnan
R&D Engineer,
Kitware Inc.
Ph: 518 881 4919
Fax: 518 371 4573
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090414/675fa894/attachment.htm>


More information about the Insight-developers mailing list