[Insight-developers] JoinImageFilter

Miller, James V (CRD) millerjv@crd.ge.com
Wed, 10 Oct 2001 08:24:39 -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_01C15186.882EA3B0
Content-Type: multipart/alternative;
	boundary="----_=_NextPart_001_01C15186.882EA3B0"


------_=_NextPart_001_01C15186.882EA3B0
Content-Type: text/plain;
	charset="iso-8859-1"

I added a new filter that allows you combine (concatenate/join) the pixels from two input images.
For instance, you can pass it two images of scalars and it outputs an image of two component vectors.
You can pass it a scalar image and a vector image, and it will output a vector image where each pixel
is one component larger than the input vector image.  You can pass it two vector images and it will
output a vector image whose pixel length is the sum of the two input image vector lengths.
 
The input images can have different value types, for instance one could have chars, the other
unsigned shorts.  The output value type is determined using a trait such that the output can handle
the dynamic range of the input types.  Joining a char with an unsigned short results in an output
vector value type of int since that is the smallest datatype that can handle the dynamic range of a
char and an unsigned short. I brought itkPixelTraits.h back to life. But don't worry, the file is
nothing like the original. No ScalarTraits or VectorTraits.  There is PixelTraits trait and a
JoinTraits class. PixelTraits determines the dimension and value type of a pixel.  JoinTraits takes
two pixel types and defines a value type that is big enough to handle their dynamic range (see
below).
 
JoinImageFilter is a subclass of BinaryFunctorImageFilter.  Joining these disparate data types was
rather tricky (especially since we can't use partial specialization and some compilers do not
templated member functions we are templated over an integral value).  I modelled the solution off an
email Brad King had sent to the list last February on how to have a single object have separate
methods for 2D, 3D, and ND execution.  The technique was pertinent here because you need to call
different routines to "paste" and input value into the output vector depending on whether the input
pixel type was a scalar value type or a vector value type.


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

millerjv@crd.ge.com < mailto:millerjv@crd.ge.com <mailto:millerjv@crd.ge.com> >
(518) 387-4005, Dial Comm: 8*833-4005, 
Cell: (518) 505-7065, Fax: (518) 387-6981 


 

------_=_NextPart_001_01C15186.882EA3B0
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 5.50.4807.2300" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=154130512-10102001><FONT size=2>I added a new filter that 
allows you combine (concatenate/join) the pixels from two input images.&nbsp; 
For instance, you can pass it two images of scalars and it outputs an image of 
two component vectors.&nbsp; You can pass it a scalar image and a vector image, 
and it will output a vector image where each pixel is one component larger than 
the input vector image.&nbsp; You can pass it two vector images and it will 
output a vector image whose pixel length is the sum of the two input image 
vector lengths.</FONT></SPAN></DIV>
<DIV><SPAN class=154130512-10102001><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=154130512-10102001><FONT size=2>The input images can have 
different value types, for instance one could have chars, the other unsigned 
shorts.&nbsp; The output value type is determined using a trait such that the 
output can handle the dynamic range of the input types.&nbsp; Joining a char 
with an unsigned short results in an output vector value type of int since that 
is the smallest datatype that can handle the dynamic range of a char and an 
unsigned short. I brought itkPixelTraits.h back to life. But don't worry, the 
file is nothing like the original. No ScalarTraits or VectorTraits.&nbsp; There 
is PixelTraits trait and a JoinTraits class. PixelTraits determines the 
dimension and value type of a pixel.&nbsp; JoinTraits takes two pixel types and 
defines a value type that is big enough to handle their dynamic range (see 
below).</FONT></SPAN></DIV>
<DIV><SPAN class=154130512-10102001><FONT size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=154130512-10102001><FONT size=2>JoinImageFilter is a subclass 
of BinaryFunctorImageFilter.&nbsp; Joining these disparate data types was rather 
tricky (especially since we can't use partial specialization and some compilers 
do not templated member functions we are templated over an integral 
value).&nbsp; I modelled the solution off an email Brad King had sent to the 
list last February on how to have a single object have separate methods for 2D, 
3D, and ND execution.&nbsp; The technique was pertinent here because you need to 
call different routines to "paste" and input value into the output vector 
depending on whether the input pixel type was a scalar value type or a vector 
value type.</FONT></SPAN></DIV><BR>
<P><B><FONT face="Comic Sans MS" color=#000080>Jim Miller</FONT></B> 
<BR><B><I><FONT face=Arial color=#ff0000 
size=2>_____________________________________</FONT></I></B><I></I><BR><I></I><I><FONT 
face=Arial color=#000000 size=1>Visualization &amp; Computer Vision<BR>GE 
Corporate Research &amp; Development<BR>Bldg. KW, Room C218B<BR>P.O. Box 8, 
Schenectady NY 12301<BR><BR></FONT><U><FONT face=Arial color=#0000ff 
size=1>millerjv@crd.ge.com &lt;<A 
href="mailto:millerjv@crd.ge.com">mailto:millerjv@crd.ge.com</A>&gt;</FONT></U></I><BR><I><FONT 
face=Arial color=#000000 size=1>(518) 387-4005, Dial Comm: 8*833-4005, 
</FONT></I><BR><I><FONT face=Arial color=#000000 size=1>Cell: (518) 505-7065, 
Fax: (518) 387-6981</FONT></I> </P><BR>
<DIV>&nbsp;</DIV></BODY></HTML>

------_=_NextPart_001_01C15186.882EA3B0--

------_=_NextPart_000_01C15186.882EA3B0
Content-Type: application/octet-stream;
	name="Miller, James V (CRD).vcf"
Content-Disposition: attachment;
	filename="Miller, James V (CRD).vcf"

BEGIN:VCARD
VERSION:2.1
N:Miller;James
FN:Miller, James V (CRD)
ORG:CRD;ESL
TITLE:Computer Scientist
TEL;WORK;VOICE:*833-4005
TEL;WORK;VOICE:1 518 387-4005
ADR;WORK:;KW-C218B;P.O. Box 8;Schenectady;New York;12301;USA
LABEL;WORK;ENCODING=QUOTED-PRINTABLE:KW-C218B=0D=0AP.O. Box 8=0D=0ASchenectady, New York 12301=0D=0AUSA
EMAIL;PREF;INTERNET:millerjv@crd.ge.com
REV:20010420T140329Z
END:VCARD

------_=_NextPart_000_01C15186.882EA3B0--