[Insight-developers] RFC: Proposal for Pixel Interpolation Methods
Vikram Chalana
vikram@statsci.com
Fri, 5 Jan 2001 12:53:26 -0800
This is a multi-part message in MIME format.
------=_NextPart_000_0026_01C07716.7F99DDF0
Content-Type: text/plain;
charset="US-ASCII"
Content-Transfer-Encoding: 7bit
I agree with Stephen. I thought interpolation would be performed using the
Image Adapter classes that Luis proposed or the ImageFunction type classes
that Lydia checked in.
Vikram
-----Original Message-----
From: insight-developers-admin@public.kitware.com
[mailto:insight-developers-admin@public.kitware.com]On Behalf Of Stephen
Aylward
Sent: Friday, January 05, 2001 12:38 PM
To: Paul Hughett
Cc: insight-developers@public.kitware.com
Subject: Re: [Insight-developers] RFC: Proposal for Pixel Interpolation
Methods
I don't think interpolation should be part of the base image class.
Many methods don't need interpolation.
Shouldn't these be part of a derived class? Otherwise, anytime anyone
wants to add a new type of interpolation, they have to modify our base image
class. Also, this adds to the complexity of an already complex class.
s
Paul Hughett wrote:
Here is a proposed interface for adding pixel interpolation methods
(and some related methods) to the Image class. Comments are welcome.
Paul Hughett
/**
* Interpolation method
*
* The possible values of this enum select among different methods for
* interpolating the value of an image at points between those defined.
* NearestNeighbor takes the value at the defined pixel nearest the
* desired point. Linear interpolates linearly between the nearest
* neighbors along each coordinate axis, using a total of 2^N
* neighboring pixels (where N is the number of dimensions).
* CubicSpline uses a cubic spline interpolation along each axes, using
* a total of 4^N * neighboring pixels.
*/
enum InterpolationType {NearestNeighbor, Linear, CubicSpline};
/**
* Interpolate pixel value at random point
*
* This method interpolates to estimate the pixel value at points
between
* the sample points of the image, using a given interpolation method.
* If the given point is near or outside the RequestedRegion of the
image,
* the missing points are assumed to have the value given by pad; in
effect,
* the RequestedRegion of the image is treated as if it were embedded in
* an infinite image of pad values. By default, the point is assumed to
* be in the physical coordinates defined by the Origin and Spacing
attributes
* of the Image. If useindex is set to true, then index coordinates are
used
* instead; this may improve efficiency if many points are computed
using
* some transformation that can be composed with the physical-to-index
* transformation.
*/
PixelType
Image::
erpolatePixel(
const Point<VImageDimension,double> &point,
const InterpolationType type,
const PixelType &pad = 0,
const bool useindex = 0) const;
/**
* Get pixel value or default
*
* If the given index is inside the RequestedRegion, return the value
* of the pixel at that index; otherwise return the default value.
* This method may be useful in algorithms that can treat an image
* as embedded in a infinite image of some default value; for example,
* convolution and resampling algorithms would use a default of zero.
* (Note that morphological operators might want a non-zero default.)
*/
PixelType
Image::
GetPixelOrDefault(
const IndexType &index,
const PixelType &default) const;
/**
* Return physical-to-index transform
*
* This method returns the AffineTransform which defines the transformation
* from physical to index coordinates for this Image.
*/
AffineTransform<double, VImageDimension>
Image::
GetPhysicalToIndexTransform() const;
/**
* Return index-to-physical transform
*
* This method returns the AffineTransform which defines the transformation
* from index to physical coordinates for this
Image.
*/
AffineTransform<double, VImageDimension>
Image::
GetIndexToPhysicalTransform() const;
_______________________________________________
Insight-developers mailing list
Insight-developers@public.kitware.com
http://public.kitware.com/mailman/listinfo/insight-developers
--
===============================================
Stephen R. Aylward, Ph.D.
Assistant Professor of Radiology
Adjunct Assistant Professor of Computer Science
http://www.cs.unc.edu/~aylward
aylward@unc.edu
(919)966-9695
------=_NextPart_000_0026_01C07716.7F99DDF0
Content-Type: text/html;
charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META content=3D"MSHTML 5.00.3103.1000" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
class=3D620445020-05012001>I=20
agree with Stephen. I thought interpolation would be performed using the =
Image=20
Adapter classes that Luis proposed or the ImageFunction type classes =
that Lydia=20
checked in. </SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D620445020-05012001></SPAN></FONT> </DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D620445020-05012001>Vikram</SPAN></FONT></DIV>
<BLOCKQUOTE>
<DIV align=3Dleft class=3DOutlookMessageHeader dir=3Dltr><FONT =
face=3DTahoma=20
size=3D2>-----Original Message-----<BR><B>From:</B>=20
insight-developers-admin@public.kitware.com=20
[mailto:insight-developers-admin@public.kitware.com]<B>On Behalf Of=20
</B>Stephen Aylward<BR><B>Sent:</B> Friday, January 05, 2001 12:38=20
PM<BR><B>To:</B> Paul Hughett<BR><B>Cc:</B>=20
insight-developers@public.kitware.com<BR><B>Subject:</B> Re:=20
[Insight-developers] RFC: Proposal for Pixel Interpolation=20
Methods<BR><BR></DIV></FONT>I don't think interpolation should be part =
of the=20
base image class.=20
<P>Many methods don't need interpolation.=20
<P>Shouldn't these be part of a derived class? Otherwise, =
anytime=20
anyone wants to add a new type of interpolation, they have to modify =
our base=20
image class. Also, this adds to the complexity of an =
already=20
complex class.=20
<P>s=20
<P>Paul Hughett wrote:=20
<BLOCKQUOTE TYPE=3D"CITE">Here is a proposed interface for adding =
pixel=20
interpolation methods <BR>(and some related methods) to the Image=20
class. Comments are welcome.=20
<P>Paul Hughett=20
<P>/** <BR> * Interpolation method <BR> * <BR> * The =
possible=20
values of this enum select among different methods for <BR> *=20
interpolating the value of an image at points between those defined. =
<BR> * NearestNeighbor takes the value at the defined pixel =
nearest the=20
<BR> * desired point. Linear interpolates linearly =
between the=20
nearest <BR> * neighbors along each coordinate axis, using a =
total of=20
2^N <BR> * neighboring pixels (where N is the number of =
dimensions).=20
<BR> * CubicSpline uses a cubic spline interpolation along each =
axes,=20
using <BR> * a total of 4^N * neighboring pixels. <BR> */=20
<P>enum InterpolationType {NearestNeighbor, Linear, CubicSpline};=20
<P>/** <BR> * Interpolate pixel value at random point =
<BR> *=20
<BR> * This method interpolates to estimate the pixel value at =
points=20
between <BR> * the sample points of the image, using a given=20
interpolation method. <BR> * If the given point is near or =
outside the=20
RequestedRegion of the image, <BR> * the missing points are =
assumed to=20
have the value given by pad; in effect, <BR> * the =
RequestedRegion of=20
the image is treated as if it were embedded in <BR> * an =
infinite image=20
of pad values. By default, the point is assumed to <BR> * =
be in=20
the physical coordinates defined by the Origin and Spacing =
attributes=20
<BR> * of the Image. If useindex is set to true, then =
index=20
coordinates are used <BR> * instead; this may improve =
efficiency if=20
many points are computed using <BR> * some transformation that =
can be=20
composed with the physical-to-index <BR> * transformation. =
<BR> */=20
<P>PixelType <BR>Image:: <BR>InterpolatePixel( =
<BR> const=20
Point<VImageDimension,double> &point, =
<BR> const=20
InterpolationType type, <BR> const PixelType =
&pad =3D 0,=20
<BR> const bool useindex =3D 0) const;=20
<P>/** <BR> * Get pixel value or default <BR> * =
<BR> * If the=20
given index is inside the RequestedRegion, return the value =
<BR> * of=20
the pixel at that index; otherwise return the default value. =
<BR> *=20
This method may be useful in algorithms that can treat an image =
<BR> *=20
as embedded in a infinite image of some default value; for example,=20
<BR> * convolution and resampling algorithms would use a =
default of=20
zero. <BR> * (Note that morphological operators might want a =
non-zero=20
default.) <BR> */=20
<P>PixelType <BR>Image:: <BR>GetPixelOrDefault( =
<BR> const=20
IndexType &index, <BR> const PixelType =
&default)=20
const;=20
<P>/** <BR> * Return physical-to-index transform <BR> *=20
<BR> * This method returns the AffineTransform which defines =
the=20
transformation <BR> * from physical to index coordinates for =
this=20
Image. <BR> */=20
<P>AffineTransform<double, VImageDimension> <BR>Image::=20
<BR>GetPhysicalToIndexTransform() const;=20
<P>/** <BR> * Return index-to-physical transform <BR> *=20
<BR> * This method returns the AffineTransform which defines =
the=20
transformation <BR> * from index to physical coordinates for =
this=20
Image. <BR> */=20
<P>AffineTransform<double, VImageDimension> <BR>Image::=20
<BR>GetIndexToPhysicalTransform() const;=20
<P>_______________________________________________ =
<BR>Insight-developers=20
mailing list <BR>Insight-developers@public.kitware.com <BR><A=20
=
href=3D"http://public.kitware.com/mailman/listinfo/insight-developers">ht=
tp://public.kitware.com/mailman/listinfo/insight-developers</A></P></BLOC=
KQUOTE><PRE>--
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Stephen R. Aylward, Ph.D.
Assistant Professor of Radiology
Adjunct Assistant Professor of Computer Science
<A =
href=3D"http://www.cs.unc.edu/~aylward">http://www.cs.unc.edu/~aylward</A=
>
aylward@unc.edu
(919)966-9695</PRE> </BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_0026_01C07716.7F99DDF0--