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

Andras Lasso lasso at queensu.ca
Thu Dec 12 12:35:21 EST 2013


Hi,

If you need access to Matlab, ITK (SimpleITK), VTK, numpy, etc. in the same environment then you may consider using 3D Slicer with the MatlabBridge extension. All the functions are available from the Python console and also from a graphical user interface.

To access Matlab functions you only need to write a small XML file that describes the input and output data types. All the inputs and outputs (images, point sets, transformations, scalar&vector values, etc.) are then automatically transferred to/from Matlab, so you don’t have to worry about writing and reading files. Graphical user interface is generated automatically for your Matlab function, too, so you can define all the inputs on the Slicer GUI, run your Matlab function with a single click, and see the results immediately.

More info:

·         Demo video: http://screencast.com/t/TgAVE6Wa8mf

·         3D Slicer: http://ww.slicer.org

·         MatlabBridge: https://www.slicer.org/slicerWiki/index.php/Documentation/4.3/Extensions/MatlabBridge

Andras

________________________________
Andras Lasso, PhD
Senior Medical Image Computing & Applications Engineer
Associate Director
Laboratory for Percutanous Surgery
School of Computing
Queen’s University
Kingston, ON, CANADA
Web: http://perk.cs.queensu.ca<http://perk.cs.queensu.ca/>


From: community-bounces at itk.org [mailto:community-bounces at itk.org] On Behalf Of Samuel Pichardo
Sent: Thursday, December 12, 2013 10:33 AM
To: zhq; ITK论坛
Subject: Re: [ITK Community] [Insight-users] I hope ITK read data from matlab , what should I do ?

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:
              [cid:image001.png at 01CEF72D.36726A20]
     What should I do ?
     Thanks in advance !
zhq

















来自网易手机号码邮箱了解更多<http://shouji.163.com>




_____________________________________

Powered by www.kitware.com<http://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/cb5dbc42/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 15604 bytes
Desc: image001.png
URL: <http://public.kitware.com/pipermail/community/attachments/20131212/cb5dbc42/attachment-0002.png>


More information about the Community mailing list