[Insight-users] BinaryImageType

Karthik Krishnan Karthik.Krishnan at kitware.com
Fri Jul 14 10:20:15 EDT 2006


Henning Meyer wrote:

> Hello,
>
> what would be needed to do in order implement a BinaryImageType< int
> dimension>, which uses all bits of its allocated memory, so that 32
> pixels can be stored inside a unsigned int.
> Would it just mean to have a specialization of Image< BinaryPixelType

Yes. I would think so. The same happens in the C++ STL library for 
std::vector

   
http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/stl__bvector_8h-source.html

See the definitions of vector< T > and the partial specialization for 
vector< bool >, which packs 8 boolean bits into a char and does 
something similar to what you are proposing.

Partial specializations are not supported on VS6, a legacy compiler that 
ITK supports ! So bear in mind that this may never make it to ITK.

>> and ImageIterator< Image< BinaryPixelType> >?
>
> Do filters just use the iterators, or can they access the memory 
> directly?
>
> Background: I'm running out of memory, when handling various
> segmentations of large CT datasets. But each segmentation uses at
> least 8x the memory it needs. I would like to improve the situation.
>
> Would this be feasible?
>
> Henning
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>


More information about the Insight-users mailing list