[Insight-users] Reducing the footprint of GetVectorDistanceMap() in SignedDanielssonDistanceMapImageFilter

Ramón Casero Cañas rcasero at gmail.com
Sun Sep 30 06:28:46 EDT 2012


Hi all,

This question is about whether it's possible to reduce the memory
footprint of one of the outputs of
itk::SignedDanielssonDistanceMapImageFilter.

In detail:

itk::SignedDanielssonDistanceMapImageFilter declares one of its outputs as

VectorImageType * 	GetVectorDistanceMap (void)

where VectorImageType is

 typedef Image< OffsetType,
  itkGetStaticConstMacro(InputImageDimension) > VectorImageType;

and OffsetType are, in this case, 3 elements of type signed long.

That is, in a 64-bit architecture, a 648x494x1648 image allocates
memory for 3x648x494x1648 elements of type "signed long" (4 bytes
each), almost 6 GB of RAM.

However, the elements in this output are vectors to the closest
foreground voxel. Thus, the largest value possible in any element of
this output would be 1648-1, which can be accommodated in 2 bytes.


Is there a way to make VectorDistanceMap of a signed 2 byte type (signed short)?

My understanding is that if one adds an itk::CastImageFilter, this
will cast the output *after* memory has been allocated and the output
has been computed, but maybe I'm wrong?

Best regards,

Ramon.

-- 
Dr. Ramón Casero Cañas

Oxford e-Research Centre (OeRC)
University of Oxford
7 Keble Rd
Oxford OX1 3QG

tlf     +44 (0) 1865 610739
web     http://www.cs.ox.ac.uk/people/Ramon.CaseroCanas
photos  http://www.flickr.com/photos/rcasero/


More information about the Insight-users mailing list