[Insight-developers] ImageRegion utility functions

Miller, James V (Research) millerjv@crd.ge.com
Tue, 16 Apr 2002 08:49:24 -0400


Lydia,

The problem here is that you cannot correctly compute
the offset from a single region. The calculations in ImageBase 
are based off of the BufferedRegion parameters. So you would need
to know the buffered region in order to determine the index
and offset.

Also, I would try to avoid the extra storage in the iterators
(and hence Regions).  Regions get copied a lot. The iterators
(at least the ImageRegionIterator) does not copy the offset table
but rather asks the image to compute the index and offset.

Why can't you use the methods is ImageBase?  I am assuming that
if you are calculating an index and an offset you plan to access
an Image.  So you probably have access to the image and can make
the calls to Image to convert between offsets and indices.



-----Original Message-----
From: Lydia Ng [mailto:lng@insightful.com]
Sent: Monday, April 15, 2002 6:52 PM
To: insight-developers@public.kitware.com
Subject: [Insight-developers] ImageRegion utility functions



At the UNC meeting I had agree to change
MutualInformationImageToImageMetric
so that one can limit the fixed image region for which the metric is
computed.

To do this I need some ImageRegion utility functions in particular:

  OffsetValueType ComputeOffset(const IndexType &ind) const;
    IndexType ComputeIndex(OffsetValueType offset) const;


They will behave similar to those in ImageBase.
Does anyone have problem with me doing the following?

[1] Add the above function to the ImageRegion class?

[2] The most efficient way of computing offset and index is
to keep a offset table? This requires extra storage space of

OffsetValueType  m_OffsetTable[VImageDimension+1];

Is adding an OffsetTable to ImageRegion acceptable to everyone?

[3] Once this functionality is inside region one can possibly remove
them from ImageBase itself and defer the calculation to the 
BufferedRegion? Do people want me to change ImageBase or do they
want it left the way it is?

- Lydia 
_______________________________________________
Insight-developers mailing list
Insight-developers@public.kitware.com
http://public.kitware.com/mailman/listinfo/insight-developers