It appears that vtkImageVariance produces only float output. vtkImageMathamtics should have reported an error that its two inputs were of a different type.<br><br><div class="gmail_quote">On Wed, Aug 15, 2012 at 8:01 PM, Matheus Viana <span dir="ltr">&lt;<a href="mailto:vianamp@gmail.com" target="_blank">vianamp@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi David.<div><br></div><div>Thank you for replying. I fixed the problem replacing the line &quot;cast -&gt; SetOutputScalarTypeToDouble();&quot; to &quot;cast -&gt; SetOutputScalarTypeToFloat();&quot;.</div>
<div><br></div>
<div>Not sure why float type is required, but it works.</div><div><br></div><div>Best,</div><div><div><div><font color="#555555" face="Helvetica, Arial, sans-serif"><span style="line-height:16px"><b>Matheus Viana</b></span></font></div>

<div><font color="#555555" face="Helvetica, Arial, sans-serif"><span style="line-height:16px"><b>Postdoctoral Research Employee</b></span></font></div><div><b><span style="color:rgb(85,85,85);line-height:16px;font-family:Helvetica,Arial,sans-serif;font-size:13px">Developmental and Cell Biology</span></b></div>

<div><font color="#555555" face="Helvetica, Arial, sans-serif"><span style="line-height:16px"><b>University of California Irvine</b></span></font></div><div><font color="#555555" face="Helvetica, Arial, sans-serif"><span style="line-height:16px"><b><br>

</b></span></font><b><i><br></i></b></div></div><div><div class="h5"><br>
<br><br><div class="gmail_quote">2012/8/15 David Doria <span dir="ltr">&lt;<a href="mailto:daviddoria@gmail.com" target="_blank">daviddoria@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

On Wed, Aug 15, 2012 at 6:37 PM, matheus_viana &lt;<a href="mailto:vianamp@gmail.com" target="_blank">vianamp@gmail.com</a>&gt; wrote:<br>
&gt; Hi Folks,<br>
&gt;<br>
&gt; I&#39;m trying to sum two ImageDatas, but I&#39;m getting a blank image as result.<br>
&gt; This is my code:<br>
&gt;<br>
&gt;         vtkImageCast *cast = vtkImageCast::New();<br>
&gt;         cast -&gt; SetInput(ImageData);<br>
&gt;         cast -&gt; SetOutputScalarTypeToDouble();<br>
&gt;         cast -&gt; Update();<br>
&gt;<br>
&gt;         vtkImageGaussianSmooth *Gauss = vtkImageGaussianSmooth::New();<br>
&gt;         Gauss -&gt; ReleaseDataFlagOff();<br>
&gt;         Gauss -&gt; SetInput(cast -&gt; GetOutput());<br>
&gt;         Gauss -&gt; SetDimensionality(3);<br>
&gt;         Gauss -&gt; SetRadiusFactors(1,1,1);<br>
&gt;         Gauss -&gt; SetStandardDeviations(1,1,1);<br>
&gt;         Gauss -&gt; Update();<br>
&gt;<br>
&gt;         vtkImageVariance3D *Variance  = vtkImageVariance3D::New();<br>
&gt;         Variance -&gt; SetInput(cast-&gt;GetOutput());<br>
&gt;         Variance -&gt; SetKernelSize(3,3,3);<br>
&gt;         Variance -&gt; Update();<br>
&gt;<br>
&gt;         vtkImageMathematics *mat = vtkImageMathematics::New();<br>
&gt;         mat -&gt; SetOperationToAdd();<br>
&gt;         mat -&gt; SetInput1(Gauss-&gt;GetOutput());<br>
&gt;         mat -&gt; SetInput2(Variance-&gt;GetOutput());<br>
&gt;         mat -&gt; Update();<br>
&gt;<br>
&gt; You guys have any idea?<br>
<br>
Please make a self-contained, compilable example of the problem. You<br>
can start with this as a shell:<br>
<br>
<a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/ImageMathematics" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/Images/ImageMathematics</a><br>
<span><font color="#888888"><br>
David<br>
</font></span></blockquote></div><br></div></div></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Unpaid intern in BillsBasement at noware dot com<br><br>