[Insight-developers] SmartConstNeighborhoodIterator

Miller, James V (Research) millerjv at crd . ge . com
Thu, 29 Aug 2002 17:19:51 -0400


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_000_01C24FA1.CF9C56D8
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C24FA1.CF9C56D8"


------_=_NextPart_001_01C24FA1.CF9C56D8
Content-Type: text/plain;
	charset="iso-8859-1"

I made a change to the SmartConstNeighborhoodIterators which simplifies writing filters (somewhat).
 
Many of the filters using neighborhood iterators use the "FaceCalculator" to divide the work into one
region that had no boundary conditions and a set of regions where boundary conditions need to be
taken into account.  In these filters, the algorithm was essentially implemented twice.  Once using a
standard NeighborhoodIterator and a second time for the boundary regions using a
SmartNeighborhoodIterator.
 
Since the syntax of this duplicated code was almore identical, I modified the
SmartNeighborhoodIterator such that it determines at constructor time whether it would ever bump into
the boundary of the image (provided it only walked the region specified at constructor time).  Based
on this evaluation, calls to GetPixel() can avoid the boundary check.
 
This allows the SmartNeighborhoodIterator to approach the speed of the NeighborhoodIterator when
walking the interior of the image.  A filter can now just implement the algorithm once.  It will
still use the face calculators to divide the image into boundary and non-boundary regions.  But
instead of one implementation with NeighborhoodIterators and one implementation with
SmartNeighborhoodIterators, there is a single implementation using SmartNeighborhoodIterators.
 
The BilateralImageFilter uses this new technique and Bill is in the process of modifying the
GradientMagnitudeImageFilter and the GradientImageFilter.

 <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Jim Miller 
_____________________________________
Visualization & Computer Vision
GE Research
Bldg. KW, Room C218B
P.O. Box 8, Schenectady NY 12301

millerjv@research.ge.com <mailto:millerjv@research.ge.com> 

james.miller@research.ge.com
(518) 387-4005, Dial Comm: 8*833-4005, 
Cell: (518) 505-7065, Fax: (518) 387-6981 

 

 

------_=_NextPart_001_01C24FA1.CF9C56D8
Content-Type: text/html;
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 6.00.2715.400" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=318145120-29082002><FONT size=2>I made a change to the 
SmartConstNeighborhoodIterators which simplifies writing filters 
(somewhat).</FONT></SPAN></DIV>
<DIV><SPAN class=318145120-29082002><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=318145120-29082002><FONT size=2>Many of the filters using 
neighborhood iterators use the "FaceCalculator" to divide the work into one 
region that had no boundary conditions and a set of regions where boundary 
conditions need to be taken into account.&nbsp; In these filters, the algorithm 
was essentially implemented twice.&nbsp; Once using a standard 
NeighborhoodIterator and a second time for the boundary regions using a 
SmartNeighborhoodIterator.</FONT></SPAN></DIV>
<DIV><SPAN class=318145120-29082002><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=318145120-29082002><FONT size=2>Since the syntax of this 
duplicated code was almore identical, I modified the SmartNeighborhoodIterator 
such that it determines at constructor time whether it would ever bump into the 
boundary of the image (provided it only walked the region specified at 
constructor time).&nbsp; Based on this evaluation, calls to GetPixel() can avoid 
the boundary check.</FONT></SPAN></DIV>
<DIV><SPAN class=318145120-29082002><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=318145120-29082002><FONT size=2>This allows the 
SmartNeighborhoodIterator to approach the speed of the NeighborhoodIterator when 
walking the interior of the image.&nbsp; A filter can now just implement the 
algorithm once.&nbsp; It will still use the face calculators to divide the image 
into boundary and non-boundary regions.&nbsp; But instead of one implementation 
with NeighborhoodIterators and one implementation with 
SmartNeighborhoodIterators, there is a single implementation using 
SmartNeighborhoodIterators.</FONT></SPAN></DIV>
<DIV><SPAN class=318145120-29082002><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=318145120-29082002><FONT size=2>The BilateralImageFilter uses 
this new technique and Bill is in the process of modifying the 
GradientMagnitudeImageFilter and the GradientImageFilter.</FONT></SPAN></DIV>
<DIV class=Section1>
<P class=MsoNormal>&nbsp;<?xml:namespace prefix = o ns = 
"urn:schemas-microsoft-com:office:office" /><o:p></o:p></P>
<P style="MARGIN: 0in 0in 0pt"><B><SPAN 
style="COLOR: navy; FONT-FAMILY: 'Comic Sans MS'">Jim Miller</SPAN></B> 
<BR><B><I><SPAN 
style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: Arial">_____________________________________</SPAN></I></B><BR><EM><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial">Visualization &amp; 
Computer Vision</SPAN></EM><I><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial"><BR><EM>GE 
Research</EM><BR><EM>Bldg. KW, Room C218B</EM><BR><EM>P.O. Box 8, Schenectady NY 
12301</EM><BR><BR></SPAN></I><EM><U><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: blue"><A 
href="mailto:millerjv@research.ge.com">millerjv@research.ge.com</A></SPAN></U></EM></P>
<P style="MARGIN: 0in 0in 0pt"><EM><U><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: blue">james.miller@research.ge.com</SPAN></U></EM><BR><I><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial">(518) 387-4005, Dial 
Comm: 8*833-4005, </SPAN></I><BR><I><SPAN 
style="FONT-SIZE: 7.5pt; COLOR: black; FONT-FAMILY: Arial">Cell: (518) 505-7065, 
Fax: (518) 387-6981</SPAN></I> </P>
<P class=MsoNormal>&nbsp;<o:p></o:p></P></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>

------_=_NextPart_001_01C24FA1.CF9C56D8--

------_=_NextPart_000_01C24FA1.CF9C56D8
Content-Type: application/octet-stream;
	name="James Miller (E-mail).vcf"
Content-Disposition: attachment;
	filename="James Miller (E-mail).vcf"

BEGIN:VCARD
VERSION:2.1
N:Miller;James
FN:James Miller (E-mail)
ORG:GE Reseach;Imaging Technologies
TEL;WORK;VOICE:(518) 387-4005
TEL;WORK;VOICE:*833-4005
TEL;CELL;VOICE:(518) 505-7065
TEL;WORK;FAX:(518) 387-6981
ADR;WORK;ENCODING=QUOTED-PRINTABLE:;Visualization and Computer Vision;BLDG KW, RM C218B=0D=0APO Box 8;Schenecta=
dy;NY;12301;United States of America
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:Visualization and Computer Vision=0D=0ABLDG KW, RM C218B=0D=0APO Box 8=0D=
=0ASchenectady, NY 12301=0D=0AUnited States of America
EMAIL;PREF;INTERNET:millerjv@research.ge.com
REV:20020405T145025Z
END:VCARD

------_=_NextPart_000_01C24FA1.CF9C56D8--