I believe you need to include vtkImageData.h in your main.<br><br>- Wes<br><br><div><span class="gmail_quote">On 1/17/07, <b class="gmail_sendername">ºúÕýçõ</b> &lt;<a href="mailto:zhengh.hu@gmail.com">zhengh.hu@gmail.com</a>
&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">To all vtkuser:<br><br> &nbsp; &nbsp; &nbsp; &nbsp;i am a VTK novice, i have the following program, but it has the following wrong.
<br><br>D:\C PROGRAM\test\test.cpp(53) : error C2664: &#39;void __thiscall vtkImageBlend::SetInput(int,class vtkDataObject *)&#39; : cannot convert parameter 2 from &#39;class vtkImageData *&#39; to &#39;class vtkDataObject *&#39;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast<br>D:\C PROGRAM\test\test.cpp(54) : error C2664: &#39;void __thiscall vtkImageBlend::SetInput(int,class vtkDataObject *)&#39; : cannot convert parameter 2 from &#39;class vtkImageData *&#39; to &#39;class vtkDataObject *&#39;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast<br>Error executing cl.exe.<br><br>test.obj - 2 error(s), 0 warning(s)<br><br>&nbsp;How should i do? anyone can give me some advices? thank you in advance.
<br><br>//============================<div style="direction: ltr;">============================================================================<br><br>#include &quot;vtkImageGridSource.h&quot;<br>#include &quot;vtkBMPReader.h

&quot;<br>#include &quot;vtkImageBlend.h&quot;<br>#include &quot;vtkImageViewer.h&quot;<br>#include &quot;vtkImageGaussianSmooth.h&quot;<br>#include &quot;vtkImageMathematics.h&quot;<br><br>int main()<br>{<br><br> &nbsp; &nbsp;vtkImageGridSource *imageGrid = vtkImageGridSource::New();
<br> &nbsp; &nbsp;imageGrid-&gt;SetGridSpacing(16, 16, 0);<br> &nbsp; &nbsp;imageGrid-&gt;SetGridOrigin(0, 0, 0);<br> &nbsp; &nbsp;imageGrid-&gt;SetDataExtent(0, 255, 0, 255, 0, 0);<br> &nbsp; &nbsp;imageGrid-&gt;SetLineValue(4095);<br> &nbsp; &nbsp;imageGrid-&gt;SetFillValue(0);
<br> &nbsp; &nbsp;imageGrid-&gt;SetDataScalarTypeToShort();<br><br> &nbsp; &nbsp;vtkBMPReader *bmpReader = vtkBMPReader::New();<br> &nbsp; &nbsp;bmpReader-&gt;SetFileName(&quot;aaa10.bmp&quot;);<br><br> &nbsp; &nbsp;vtkImageBlend *blend = vtkImageBlend::New();
<br>
 &nbsp; &nbsp;blend-&gt;SetOpacity(0, 0.5);<br> &nbsp; &nbsp;blend-&gt;SetOpacity(1, 0.5);<br> &nbsp; &nbsp;blend-&gt;AddInput(0, imageGrid-&gt;GetOutput());<br> &nbsp; &nbsp;blend-&gt;AddInput(1, bmpReader-&gt;GetOutput());<br><br> &nbsp; &nbsp;vtkImageViewer *viewer = vtkImageViewer::New();
<br> &nbsp; &nbsp;viewer-&gt;SetInput(blend-&gt;GetOutput());<br> &nbsp; &nbsp;viewer-&gt;SetColorWindow(1000);<br> &nbsp; &nbsp;viewer-&gt;SetColorLevel(500);<br> &nbsp; &nbsp;viewer-&gt;Render();<br><br> &nbsp; &nbsp;imageGrid-&gt;Delete();<br> &nbsp; &nbsp;bmpReader-&gt;Delete();
<br> &nbsp; &nbsp;blend-&gt;Delete();<br> &nbsp; &nbsp;viewer-&gt;Delete();<br><br><br>return 0;<br><br>}</div><br>

<br>_______________________________________________<br>This is the private VTK discussion list.<br>Please keep messages on-topic. Check the FAQ at: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers
</a><br><br><br></blockquote></div><br><br clear="all"><br>-- <br>Wesley D. Turner, Ph.D.<br>R&amp;D Engineer<br>28 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-371-3971 x120