<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<ImageType > WriterType; <br>
</div><div style>codes are as follows.My program was properly built and could be able to open the image(livertriangulated1.vtk").tThe same is done to the skin and visualized well.</div><div> imageWriter->SetInput(imageFilter->GetOutput() );</div>
<div> imageWriter->SetFileName("D:\\binary1\\livertriangulated1.vtk");</div><div> imageWriter->UseCompressionOn();</div><div> imageWriter->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<vtkImageWeightedSum> sumFilter =<br>
</div><div> vtkSmartPointer<vtkImageWeightedSum>::New();</div><div> sumFilter->SetWeight(0,.8);</div><div> sumFilter->SetWeight(1,.2);</div><div> sumFilter->AddInputConnection(reader1->GetOutputPort());</div>
<div> sumFilter->AddInputConnection(reader2->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<vtkImageWriter> writer =</div>
<div> vtkSmartPointer<vtkImageWriter>::New();</div><div><br></div><div> writer->SetInputConnection(summedCastFilter->GetOutputPort());</div><div> writer->SetFileName("D:\\weightedsum1\\livskin.vtk");</div>
<div> writer->Write();</div><div> //writer->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't open the output image ( liveskin.vtk).When I tried with ITK snap to open, it displayed can't recignize .I can'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>