<div dir="ltr"><div>Thank you for your reply! Yes I have tried using the vtkProbeFilter, this is the code:</div>
<div> </div><font face="courier new,monospace"></font><font face="courier new,monospace">
<div><font face="courier new,monospace"> //Read volume<br> std::string inputFilename = "volume.mhd";</font></div>
<div><font face="courier new,monospace"> vtkSmartPointer<vtkMetaImageReader> reader = vtkSmartPointer<vtkMetaImageReader>::New();<br> reader->SetFileName(inputFilename.c_str());<br> reader->Update();</font></div>
<div> </div>
<div> // Read points<br> std::string filename = argv[1];<br> std::ifstream fin(filename.c_str());<br> <br> std::string line;<br> vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();<br>
while(std::getline(fin, line))<br> {<br> double x,y,z;<br> std::stringstream linestream;<br> linestream << line;<br> linestream >> x >> y >> z;<br> <br> points->InsertNextPoint(x, y, z);<br>
}<br> <br> fin.close();<br> <br> // Polydata</div>
<div> vtkSmartPointer<vtkPolyData> polydata = vtkSmartPointer<vtkPolyData>::New();<br> polydata->SetPoints(points);</div>
<div> </div>
<div></div></font><font face="courier new,monospace"> // Probe Filter<br> vtkSmartPointer<vtkProbeFilter> probe = vtkSmartPointer<vtkProbeFilter>::New();<br> probe->SetSource(reader->GetOutput());<br>
probe->SetInput(polydata);<br> probe->Update();</font></div>
<div> </div>
<div><font face="arial,helvetica,sans-serif"></font>Regarding this code, I have 3 questions (other than "is it correct?" of course):</div>
<ol>
<li>'points' are the points to sample the volume at. There are 10,000 sampling points that should output a 100x100 2D image. However, I didn't use this information anywhere which is probably incorrect since 10,000 points can also produce 50x200 2D image. How should it be done?</li>
<li>How can I render the resulted 2D image?</li>
<li>The probing ('<font face="Courier New">probe->Update()</font><font face="arial,helvetica,sans-serif">') takes quite a lot of time (~400ms), while I need this action to be much faster since it's intended to be interactive. How can I speed things up? Maybe using <font size="2">vtkStructuredGrid will be faster?</font></font></li>
</ol>
<div>Thank you so much,</div>
<div>Eyal.</div>
<div> </div>
<div> </div>
<div class="gmail_quote">On Wed, Sep 14, 2011 at 2:25 PM, peterm <span dir="ltr"><<a href="mailto:madapeti@gmail.com" target="_blank">madapeti@gmail.com</a>></span> wrote:<br></div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Hello<br><br>Did you try using the vtkProbeFilter for sampling from the grayscale volume?<br>You can find some examples about probing along lines and planes in the VTK<br>
example code.<br><br>--<br>View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Creating-Curved-MPR-Image-tp4802388p4802571.html" target="_blank">http://vtk.1045678.n5.nabble.com/Creating-Curved-MPR-Image-tp4802388p4802571.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<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>
</blockquote><br>