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

Jon Haitz Legarreta jhlegarreta at vicomtech.org
Thu Dec 12 10:19:45 EST 2013


Dear Zhq,
you should consider using the itk::VTKImagIO to read VTK files in ITK [1].

The error was a consequence of not using the appropriate filter to read the
VTK format file.

HTH,
JON HAITZ

[1] http://www.itk.org/Insight/Doxygen/html/classitk_1_1VTKImageIO.html



On 12 December 2013 14:12, zhq <15891495523 at 126.com> 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/d479a33a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: QQ??20131212210256.png
Type: image/png
Size: 15604 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/community/attachments/20131212/d479a33a/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