<div dir="ltr">Hi vtk users<div><br></div><div style>I want to add two mesh models(eg. skin and liver).I have followed following steps.</div><div style><br></div><div style>1. Generated mesh models of liver and skin by segmenting VHP (visible human project) abdomen data set.</div>
<div style><br></div><div style>2 Then they were triangulated.(from paraview)</div><div style><br></div><div style>3  Then triangulated meshes were converted to binary  using  itk::TriangleMeshToBinaryImageFilter. Then it was written to another file  as .vtk format using   itk::ImageFileWriter&lt;ImageType &gt; WriterType; <br>
</div><div style>codes are as follows.My program was properly built and could be able to open the image(livertriangulated1.vtk&quot;).tThe same is done to the skin and visualized well.</div><div>  imageWriter-&gt;SetInput(imageFilter-&gt;GetOutput() );</div>
<div>  imageWriter-&gt;SetFileName(&quot;D:\\binary1\\livertriangulated1.vtk&quot;);</div><div>  imageWriter-&gt;UseCompressionOn();</div><div>  imageWriter-&gt;Update();</div><div><br></div><div style><br></div><div style>
4 Now What I want to add these two images, as my ultimate gall is to check a point is inside/outside either organ models. I used  vtkImageWeightedSum filter as follows to add the two images.</div><div>     </div><div>vtkSmartPointer&lt;vtkImageWeightedSum&gt; sumFilter =<br>
</div><div>    vtkSmartPointer&lt;vtkImageWeightedSum&gt;::New();</div><div>  sumFilter-&gt;SetWeight(0,.8);</div><div>  sumFilter-&gt;SetWeight(1,.2);</div><div>  sumFilter-&gt;AddInputConnection(reader1-&gt;GetOutputPort());</div>
<div>  sumFilter-&gt;AddInputConnection(reader2-&gt;GetOutputPort());</div><div><br></div><div style>The sum was written to a separate file .vtk format as follows.</div><div style><div><br></div><div>vtkSmartPointer&lt;vtkImageWriter&gt; writer =</div>
<div>      vtkSmartPointer&lt;vtkImageWriter&gt;::New();</div><div><br></div><div> writer-&gt;SetInputConnection(summedCastFilter-&gt;GetOutputPort());</div><div> writer-&gt;SetFileName(&quot;D:\\weightedsum1\\livskin.vtk&quot;);</div>
<div> writer-&gt;Write();</div><div> //writer-&gt;Update();</div><div style>Program was built successfully and could be able to open the .exe file.It shows several images of skin .But can&#39;t open the output image (  liveskin.vtk).When I tried with ITK snap to open, it displayed  can&#39;t recignize .I can&#39;t understand what I have missed.I am highly appreciated if you could looking to this and make me correct.</div>
<div style><br></div><div style>Thanks in advance</div><div style> </div><div style>regards</div><div style>Shirani</div><div style><br></div><div style> </div></div><div><br></div><div><br></div><div><br></div></div>