<div dir="ltr"><div><div>Dear Zhq,<br></div>you should consider using the itk::VTKImagIO to read VTK files in ITK [1].<br><br></div><div>The error was a consequence of not using the appropriate filter to read the VTK format file.<br>
<br></div><div>HTH,<br>JON HAITZ<br><br></div><div>[1] <a href="http://www.itk.org/Insight/Doxygen/html/classitk_1_1VTKImageIO.html">http://www.itk.org/Insight/Doxygen/html/classitk_1_1VTKImageIO.html</a><br><br><br><div class="gmail_extra">
<br><div class="gmail_quote">On 12 December 2013 14:12, zhq <span dir="ltr"><<a href="mailto:15891495523@126.com" target="_blank">15891495523@126.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div style="line-height:1.7;font-size:14px;font-family:arial">Dear all :<div> I run matlab code , and get a data which is save as mat format file . Then , I wish segment the data with ITK . How can I read the data with ITK .</div>
<div> Can I save the data as vtk format file and then to read it with ITK ?</div><div> The follow is what I has done :</div><div> ( In matlab :)</div><div> save('MRI.vtk','MRAImgs') % the MRAImgs is the mat format data , I want to save the data as vtk format</div>
<div> ( In ITK :)</div><div> <span style="line-height:1.7">typedef itk::ImageFileReader<InternalImageType> ReaderType ; </span></div><div><span style="white-space:pre-wrap">                </span> ReaderType::Pointer reader = ReaderType::New();</div>
<div><span style="white-space:pre-wrap">        </span> reader->SetFileName("G:\\Graduation Design\\ITK code\\MRI.vtk");</div><div><span style="white-space:pre-wrap">        </span> try</div><div><span style="white-space:pre-wrap">        </span> {</div>
<div><span style="white-space:pre-wrap">                </span> reader->Update();</div><div><span style="white-space:pre-wrap">        </span> }</div><div><span style="white-space:pre-wrap">        </span> catch( itk::ExceptionObject & excep )</div>
<div><span style="white-space:pre-wrap">        </span> <span style="white-space:pre-wrap">        </span> {</div><div><span style="white-space:pre-wrap">                </span> std::cerr << "Exception caught !" << std::endl;</div>
<div><span style="white-space:pre-wrap">                </span> std::cerr << excep << std::endl;</div><div><span style="white-space:pre-wrap">                </span> system("pause");</div><div><span style="white-space:pre-wrap">        </span> }</div>
<div> But a error appears:</div><div> <img src="cid:6b554e55$1$142e6efa604$Coremail$15891495523$126.com" style="line-height: 1.7;"></div><div> What should I do ?</div><div> Thanks in advance !</div>
<div>zhq</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div>
</div><br><br><span title="neteasefooter"><span><div><div style="border-top:1px solid rgb(204,204,204);padding:10px 5px;font-size:12px;color:rgb(102,102,102);line-height:22px">来自网易手机号码邮箱<a href="http://shouji.163.com" style="color:rgb(0,0,255)" target="_blank">了解更多</a></div>
</div>
</span></span><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<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br></div></div></div>