<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<STYLE>BODY {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana
}
PRE {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
BLOCKQUOTE {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
A {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
MENU {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
DD {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
UL {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
DT {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
DIR {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
ADDRESS {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
H5 {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
H6 {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
HR {
        MARGIN-TOP: 0em; FONT-SIZE: 10pt; MARGIN-BOTTOM: 0em; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
P {
        FONT-SIZE: 10pt; MARGIN: 0in 0in 6pt; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
TD {
        FONT-SIZE: 10pt; MARGIN: 0in 0in 6pt; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
TR {
        FONT-SIZE: 10pt; MARGIN: 0in 0in 6pt; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
P.MsoNormal {
        FONT-SIZE: 10pt; MARGIN: 0in 0in 6pt; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
LI.MsoNormal {
        FONT-SIZE: 10pt; MARGIN: 0in 0in 6pt; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
DIV.MsoNormal {
        FONT-SIZE: 10pt; MARGIN: 0in 0in 6pt; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
LI {
        MARGIN-TOP: 3pt; FONT-SIZE: 10pt; MARGIN-BOTTOM: 3pt; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
UL {
        MARGIN-TOP: 3pt; FONT-SIZE: 10pt; MARGIN-BOTTOM: 3pt; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
OL {
        MARGIN-TOP: 3pt; FONT-SIZE: 10pt; MARGIN-BOTTOM: 3pt; COLOR: #000000; FONT-FAMILY: Verdana,Arial,sans-serif
}
H1 {
        FONT-SIZE: 16pt; MARGIN: 12pt 0in 3pt; COLOR: #003366; FONT-FAMILY: Verdana,Arial,sans-serif
}
H2 {
        FONT-SIZE: 14pt; MARGIN: 12pt 0in 3pt; COLOR: #003366; FONT-STYLE: italic; FONT-FAMILY: Verdana,Arial,sans-serif
}
H3 {
        FONT-SIZE: 12pt; MARGIN: 12pt 0in 3pt; COLOR: #003366; FONT-FAMILY: Verdana,Arial,sans-serif
}
H4 {
        FONT-SIZE: 11pt; MARGIN: 12pt 0in 3pt; COLOR: #003366; FONT-FAMILY: Verdana,Arial,sans-serif
}
</STYLE>

<META name=GENERATOR content="MSHTML 8.00.7600.16588"></HEAD>
<BODY style="FONT-FAMILY: Verdana; COLOR: #000000; FONT-SIZE: 10pt" id=ridBody 
background="">
<DIV>&nbsp;</DIV>
<DIV align=left><SPAN class=368361607-12082010>Hi</SPAN></DIV>
<DIV align=left><SPAN class=368361607-12082010></SPAN>&nbsp;</DIV>
<DIV align=left><SPAN class=368361607-12082010>I want to make a vtk filter which 
hast two input images and one output whereby the input images can have different 
sizes and the output has the size of the first input. </SPAN></DIV>
<DIV align=left><SPAN class=368361607-12082010></SPAN>&nbsp;</DIV>
<DIV align=left><SPAN class=368361607-12082010>My filter is working but when the 
first input is bigger than the second input i get an Update Extent error 
(Requested region is (at least partially) outside the largest possible 
region).</SPAN></DIV>
<DIV align=left><SPAN class=368361607-12082010></SPAN>&nbsp;</DIV>
<DIV align=left><SPAN class=368361607-12082010>Can anyone say me what i making 
wrong:</SPAN></DIV>
<DIV align=left><SPAN class=368361607-12082010></SPAN>&nbsp;</DIV>
<DIV align=left><SPAN class=368361607-12082010>here some code snippets, it would 
be also great if anyone can say me how to make a better type handling than the 
if(dim ==3), switch(datatype) stuff:</SPAN></DIV>
<DIV align=left><SPAN class=368361607-12082010></SPAN>&nbsp;</DIV>
<DIV align=left><SPAN class=368361607-12082010>
<P>class C<SPAN class=368361607-12082010>Filter</SPAN> : <FONT 
color=#0000ff><FONT color=#0000ff>public</FONT></FONT> vtkImageAlgorithm </P>
<P>{</P>
<P><FONT color=#0000ff><FONT color=#0000ff>public</FONT></FONT>:</P>
<P><FONT color=#0000ff><SPAN class=368361607-12082010>&nbsp;&nbsp; 
</SPAN>static</FONT> C<SPAN class=368361607-12082010>Filter</SPAN> *New();</P>
<P><FONT color=#0000ff><SPAN class=368361607-12082010>&nbsp;&nbsp; 
</SPAN>void</FONT> PrintSelf(ostream&amp; oStream, vtkIndent oIndent);</P>
<P><FONT color=#0000ff><FONT color=#0000ff>protected</FONT></FONT>:</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp; </SPAN>C<SPAN 
class=368361607-12082010>Filter</SPAN> ();</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp; </SPAN>~C<SPAN 
class=368361607-12082010>Filter</SPAN> (); </P>
<P><FONT color=#0000ff><SPAN class=368361607-12082010>&nbsp;&nbsp;&nbsp; 
</SPAN>int</FONT> RequestData(vtkInformation *poRequest, vtkInformationVector** 
ppoInputVector, vtkInformationVector* poOutputVector);</P>
<P><FONT color=#0000ff><FONT color=#0000ff>private</FONT></FONT>:</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp;&nbsp; </SPAN>C<SPAN 
class=368361607-12082010>Filter</SPAN> (C<SPAN 
class=368361607-12082010>Filter</SPAN> &amp;); </P>
<P><FONT color=#0000ff><SPAN class=368361607-12082010>&nbsp;&nbsp;&nbsp; 
</SPAN>void</FONT> <FONT color=#0000ff><FONT 
color=#0000ff>operator</FONT></FONT>=(<FONT color=#0000ff><FONT 
color=#0000ff>const</FONT></FONT> C<SPAN class=368361607-12082010>Filter</SPAN> 
&amp;); </P>
<P>};</P>
<P>&nbsp;</P>
<P>C<SPAN class=368361607-12082010>Filter</SPAN> ::C<SPAN 
class=368361607-12082010>Filter</SPAN> ()</P>
<P>{</P>
<P><FONT color=#0000ff><SPAN class=368361607-12082010>&nbsp;&nbsp;&nbsp; 
</SPAN>this</FONT>-&gt;SetNumberOfInputPorts(2);</P>
<P>}</P>
<P>&nbsp;</P><FONT color=#0000ff><FONT color=#0000ff>
<P>int</P></FONT></FONT>
<P>C<SPAN class=368361607-12082010>Filter</SPAN> ::RequestData(vtkInformation 
*poRequest, vtkInformationVector** ppoInputVector, vtkInformationVector* 
poOutputVector)</P>
<P>{</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp; </SPAN>vtkInformation* 
oInputInfo;</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp; </SPAN>oInputInfo = 
ppoInputVector[0]-&gt;GetInformationObject(0);</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp; </SPAN>vtkImageData *oInput1 = 
vtkImageData::SafeDownCast(oInputInfo-&gt;Get(vtkDataObject::DATA_OBJECT()));</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp; </SPAN>oInputInfo = 
ppoInputVector[1]-&gt;GetInformationObject(0);</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp; </SPAN>vtkImageData *oInput2 = 
vtkImageData::SafeDownCast(oInputInfo-&gt;Get(vtkDataObject::DATA_OBJECT()));</P>
<P><FONT color=#0000ff></FONT>
<P></P><FONT color=#0000ff><SPAN class=368361607-12082010>&nbsp;&nbsp; 
</SPAN>unsigned</FONT> <FONT color=#0000ff><FONT color=#0000ff>int</FONT></FONT> 
iDim;</P>
<P><FONT color=#0000ff><SPAN class=368361607-12082010>&nbsp;&nbsp; 
</SPAN>if</FONT>((oInput1-&gt;GetDataDimension() == 3) &amp;&amp; 
(oInput2-&gt;GetDataDimension() == 3))</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp; </SPAN>{</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>iDim = 3;</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp;&nbsp;</SPAN>}</P>
<P><FONT color=#0000ff><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;</SPAN>else</FONT> <FONT 
color=#0000ff><FONT color=#0000ff>if</FONT></FONT> 
((oInput1-&gt;GetDataDimension() == 2) &amp;&amp; 
(oInput2-&gt;GetDataDimension() == 2))</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp; </SPAN>{</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>iDim = 2;</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp; </SPAN>}</P>
<P><FONT color=#0000ff><SPAN class=368361607-12082010>&nbsp;&nbsp; 
</SPAN>else</FONT></P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp; </SPAN>{</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>std::cout &lt;&lt; <FONT color=#a31515><FONT color=#a31515>"Error: This 
filter requires two or three dimensional data!"</FONT></FONT> &lt;&lt; 
std::endl;</P>
<P><FONT color=#0000ff><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>return</FONT> 0;</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp; </SPAN>}</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp; </SPAN>vtkInformation* oInfo = 
poOutputVector-&gt;GetInformationObject(0);</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp;&nbsp;</SPAN>vtkImageData *oOutput 
= vtkImageData::SafeDownCast(oInfo-&gt;Get(vtkDataObject::DATA_OBJECT()));</P>
<P>&nbsp;</P><FONT color=#0000ff><FONT color=#0000ff>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp; </SPAN>int</FONT></FONT> 
iScalarType = oInput1-&gt;GetScalarType();</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp; 
</SPAN>vtkSmartPointer&lt;vtkImageCast&gt; oInputCaster1 = 
vtkImageCast::New();</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp; 
</SPAN>oInputCaster1-&gt;ReleaseDataFlagOn();</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp; 
</SPAN>oInputCaster1-&gt;SetInput(oInput1);</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp; 
</SPAN>vtkSmartPointer&lt;vtkImageCast&gt; oInputCaster2 = 
vtkImageCast::New();</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp; 
</SPAN>oInputCaster2-&gt;ReleaseDataFlagOn();</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp; 
</SPAN>oInputCaster2-&gt;SetInput(oInput2);</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp; 
</SPAN>vtkSmartPointer&lt;vtkImageCast&gt; oOutputCaster = 
vtkImageCast::New();</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp; 
</SPAN>oOutputCaster-&gt;SetOutputScalarType(iScalarType);</P>
<P><FONT color=#0000ff><SPAN class=368361607-12082010>&nbsp;&nbsp; 
</SPAN>if</FONT>(iDim == 2)</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp; </SPAN>{</P>
<P><FONT color=#0000ff><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>switch</FONT>(iScalarType)</P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{</P>
<P><FONT color=#0000ff><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>case</FONT> VTK_FLOAT:</P>
<P><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>{<SPAN class=368361607-12082010> </SPAN></P>
<P><FONT color=#0000ff><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>typedef</FONT> itk::Image&lt;<FONT color=#0000ff><FONT 
color=#0000ff>float</FONT></FONT>, 2&gt; TInputImage;</P>
<P><FONT color=#0000ff><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>typedef</FONT> itk::Image&lt;<FONT color=#0000ff><FONT 
color=#0000ff>float</FONT></FONT>, 2&gt; TOutputImage;</P>
<P><FONT color=#0000ff><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>typedef</FONT>&nbsp;<SPAN 
class=368361607-12082010>MyITKFilter</SPAN>&lt;TInputImage,TOutputImage&gt; 
TFilter;</P>
<P><FONT color=#0000ff><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>typedef</FONT> 
itk::VTKImageToImageFilter&lt;TInputImage&gt; TInputConverter;</P>
<P><FONT color=#0000ff><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>typedef</FONT> itk::ImageToVTKImageFilter&lt;TOutputImage&gt; 
TOutputConverter;</P>
<P><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>oInputCaster1-&gt;SetOutputScalarTypeToFloat();</P>
<P><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>oInputCaster2-&gt;SetOutputScalarTypeToFloat();</P>
<P><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>TInputConverter::Pointer oInputConverter1 = TInputConverter::New();</P>
<P><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>oInputConverter1-&gt;ReleaseDataFlagOn();</P>
<P><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>oInputConverter1-&gt;SetInput(oInputCaster1-&gt;GetOutput());</P>
<P><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>TInputConverter::Pointer oInputConverter2 = TInputConverter::New();</P>
<P><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>oInputConverter2-&gt;ReleaseDataFlagOn();</P>
<P><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>oInputConverter2-&gt;SetInput(oInputCaster2-&gt;GetOutput());</P>
<P><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>TFilter::Pointer oFilter = TFilter::New();</P>
<P><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>oFilter-&gt;Set<SPAN 
class=368361607-12082010>Input1</SPAN>(oInputConverter1-&gt;GetOutput());</P>
<P><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>oFilter-&gt;Set<SPAN 
class=368361607-12082010>Input2</SPAN>(oInputConverter2-&gt;GetOutput());</P>
<P><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>oFilter-&gt;ReleaseDataFlagOn();</P>
<P><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>TOutputConverter::Pointer oOutputConverter = TOutputConverter::New();</P>
<P><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>oOutputConverter-&gt;ReleaseDataFlagOn();</P>
<P><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>oOutputConverter-&gt;SetInput(oFilter-&gt;GetOutput());</P>
<P><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>oOutputCaster-&gt;SetInput(oOutputConverter-&gt;GetOutput()); </P>
<P><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>oOutputCaster-&gt;Update();</P>
<P><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>}</P>
<P><FONT color=#0000ff><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>break</FONT>;</P>
<P><FONT color=#0000ff><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>case</FONT> VTK_UNSIGNED_CHAR:</P>
<P><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>{</P>
<P><FONT color=#0000ff><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>typedef</FONT> itk::Image&lt;<FONT color=#0000ff><FONT 
color=#0000ff>unsigned</FONT></FONT> <FONT color=#0000ff><FONT 
color=#0000ff>char</FONT></FONT>, 2&gt; TInputImage;</P>
<P><FONT color=#0000ff><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>typedef</FONT> itk::Image&lt;<FONT color=#0000ff><FONT 
color=#0000ff>unsigned</FONT></FONT> <FONT color=#0000ff><FONT 
color=#0000ff>char</FONT></FONT>, 2&gt; TOutputImage;</P>
<P><FONT color=#0000ff><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>typedef</FONT> CCheckerboard&lt;TInputImage,TOutputImage&gt; TFilter;</P>
<P><FONT color=#0000ff><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>typedef</FONT> itk::VTKImageToImageFilter&lt;TInputImage&gt; 
TInputConverter;</P>
<P><FONT color=#0000ff><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>typedef</FONT> itk::ImageToVTKImageFilter&lt;TOutputImage&gt; 
TOutputConverter;</P>
<P><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>oInputCaster1-&gt;SetOutputScalarTypeToUnsignedChar();</P>
<P><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</SPAN>oInputCaster2-&gt;SetOutputScalarTypeToUnsignedChar();</P>
<P>&nbsp;</P>
<P><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
blablabla</SPAN></P>
<P><SPAN 
class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}</SPAN></P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
//do for all cases</SPAN></P>
<P><SPAN class=368361607-12082010>&nbsp;&nbsp;&nbsp;&nbsp; }</SPAN></P>
<P><SPAN class=368361607-12082010>}</SPAN></P>
<P><SPAN class=368361607-12082010>else if (iDim==3)</SPAN></P>
<P><SPAN class=368361607-12082010>{</SPAN></P>
<P><SPAN class=368361607-12082010>//do for dim = 3 and all cases</SPAN></P>
<P><SPAN class=368361607-12082010>}</SPAN></P>
<P>}</P><FONT size=2>
<P>oOutput-&gt;ShallowCopy(oOutputCaster-&gt;GetOutput());</P>
<P></P>
<P>oOutputCaster-&gt;Delete();</P>
<P>oInputCaster1-&gt;Delete();</P>
<P>oInputCaster2-&gt;Delete();</P>
<P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff 
size=2>return</FONT></FONT><FONT size=2> 1;</P></FONT>
<P><SPAN class=368361607-12082010>}</SPAN></P></SPAN></DIV></BODY></HTML>