[ITK Community] [Insight-users] Insight-users Digest, Vol 116, Issue 15

Andrew Pound Andrew.Pound at aggiemail.usu.edu
Thu Dec 12 09:45:31 EST 2013


zhq,

In order for the data to be read by File Readers in ITK, it must be
formatted in the manner that conforms with the reader format.
In order to use the .vtk format, you would need to find or write your own
save code in matlab.
Like you said, the command "save('MRI.vtk', ...)" saves data in the .mat
format.  I would suggest a google search for "matlab write vtk", which will
bring up a number of options from the matlab community(Matlab Central File
Exchange) which could help with formatting and writing your data to the
.vtk format.

Good luck,
Andrew


On Thu, Dec 12, 2013 at 6:43 AM, <insight-users-request at itk.org> wrote:

>
> Date: Thu, 12 Dec 2013 21:12:14 +0800 (CST)
> From: zhq <15891495523 at 126.com>
> Subject: [Insight-users] I hope ITK read data from matlab ,     what
>         should I do ?
> To: ITK?? <insight-users at itk.org>
> Message-ID: <47c48c50.3bc3a.142e6efa607.Coremail.15891495523 at 126.com>
> Content-Type: text/plain; charset="gbk"
>
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20131212/45587c14/attachment.html>
-------------- 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