<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">You could use Python to make the link
      between Matlab file and VTK<br>
      <br>
      read the file with numpy with <br>
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <a
        href="http://docs.scipy.org/doc/scipy/reference/tutorial/io.html">http://docs.scipy.org/doc/scipy/reference/tutorial/io.html</a><br>
      <br>
      <br>
       and save in VTK through the VTK wrapper<br>
      <br>
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <a href="https://code.google.com/p/devide/wiki/NumPyToVTK">https://code.google.com/p/devide/wiki/NumPyToVTK</a><br>
      <br>
      be sure of saving the Matlab file with -V6 option<br>
      <br>
      On 13-12-12 08:12 AM, zhq wrote:<br>
    </div>
    <blockquote
      cite="mid:47c48c50.3bc3a.142e6efa607.Coremail.15891495523@126.com"
      type="cite">
      <div
        style="line-height:1.7;color:#000000;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 class="Apple-tab-span" style="white-space:pre"> </span>  ReaderType::Pointer
          reader = ReaderType::New();</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span> 
                  reader->SetFileName("G:\\Graduation Design\\ITK
          code\\MRI.vtk");</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span> 
                  try</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span> 
                  {</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span> 
               reader->Update();</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span> 
                  }</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span> 
                  catch( itk::ExceptionObject & excep )</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span> 
             <span class="Apple-tab-span" style="white-space:pre"> </span>  {</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span> 
               std::cerr << "Exception caught !" <<
          std::endl;</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span> 
               std::cerr << excep << std::endl;</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span> 
               system("pause");</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span> 
                  }</div>
        <div>      But a error appears:</div>
        <div>              <img
            src="cid:part3.05090109.09020501@gmail.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 id="netease_mail_footer">
          <div id="netease_mail_footer">
            <div style="border-top:#CCCCCC 1px solid;padding:10px
              5px;font-size:12px;color:#666;line-height:22px">来自网易手机号码邮箱<a
                moz-do-not-send="true" id="mobile_set" sys="1" log="1"
                logid="free_sms_20120504" href="http://shouji.163.com"
                target="_blank" style="color:#0000FF">了解更多</a></div>
          </div>
        </span></span><br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_____________________________________
Powered by <a class="moz-txt-link-abbreviated" href="http://www.kitware.com">www.kitware.com</a>

Visit other Kitware open-source projects at
<a class="moz-txt-link-freetext" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>

Kitware offers ITK Training Courses, for more information visit:
<a class="moz-txt-link-freetext" href="http://www.kitware.com/products/protraining.php">http://www.kitware.com/products/protraining.php</a>

Please keep messages on-topic and check the ITK FAQ at:
<a class="moz-txt-link-freetext" href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a>

Follow this link to subscribe/unsubscribe:
<a class="moz-txt-link-freetext" href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>