[ITK Community] [Insight-users] I hope ITK read data from matlab , what should I do ?

Samuel Pichardo sammeuly at gmail.com
Thu Dec 12 10:33:07 EST 2013


You could use Python to make the link between Matlab file and VTK

read the file with numpy with
http://docs.scipy.org/doc/scipy/reference/tutorial/io.html


  and save in VTK through the VTK wrapper

https://code.google.com/p/devide/wiki/NumPyToVTK

be sure of saving the Matlab file with -V6 option

On 13-12-12 08:12 AM, zhq wrote:
> Dear all :
>        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 .
>        Can I save the data as vtk format file and then to read it with 
> ITK ?
>        The follow is what I has done :
>        ( In matlab :)
>                   save('MRI.vtk','MRAImgs')    % the MRAImgs is the 
> mat format data , I want to save the data as vtk format
>        ( In ITK :)
> typedef itk::ImageFileReader<InternalImageType> ReaderType ;
>   ReaderType::Pointer reader = ReaderType::New();
>         reader->SetFileName("G:\\Graduation Design\\ITK code\\MRI.vtk");
>         try
>         {
>      reader->Update();
>         }
>         catch( itk::ExceptionObject & excep )
>   {
>      std::cerr << "Exception caught !" << std::endl;
>      std::cerr << excep << std::endl;
>      system("pause");
>         }
>       But a error appears:
>      What should I do ?
>      Thanks in advance !
> zhq
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> 来自网易手机号码邮箱了解更多 <http://shouji.163.com>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20131212/6fd86aa6/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 15604 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/community/attachments/20131212/6fd86aa6/attachment-0002.png>
-------------- next part --------------
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users


More information about the Community mailing list