Hi everybody,<br><br>In fact, I need to save a thresholded data in PNG files. For example, the threshold data is given below, and I need to store this data into PNG files and to be able to reconstruct the Vol data only thanks to these PNG files. I have noticed that vtkPNGWriter is able to write 3D images but I don't have a set of PNG files when I tried it. Moreover, the image I get is a black PNG file.<br>
Do you have an idea ?<br>The other goal is to use PNG files from another application and to be able to reconstruct the overall data and to render it. I suppose that the use of vtkPNGreader allows this ?<br><br>Thanks<br>
<br>Matthieu<br><br>(avec vtkImageVOLReader* Vol = vtkImageVOLReader::New();)<br><br>vtkImageThreshold *mon_tre = vtkImageThreshold::New();<br> mon_tre->SetInput(Vol->GetOutput());<br> mon_tre->ThresholdByUpper(1300);<br>
mon_tre->SetInValue(0);<br> mon_tre->SetOutValue(255);<br> //mon_tre->ReplaceOutOff();<br> //mon_tre->ReplaceInOn();<br> mon_tre->Update();<br><br>vtkPNGWriter *writer=vtkPNGWriter::New();<br>
//w2i->SetInput(renWin);<br> writer->SetInput(mon_tre->GetOutput());<br> char *wfname=(char *)malloc(sizeof(char)*25);<br> sprintf(wfname,"koursky2.png");<br><br> writer->SetFileName(wfname);<br>
//renWin->Render();<br> //w2i->Update();<br> writer->Write();<br>