I want to convert .mat files to .vtk format. Is it possible ? But how ?

2 Kommentare

Pritesh Shah
Pritesh Shah am 8 Apr. 2016
In file exchanger, the code is available. Please check following link http://www.mathworks.com/matlabcentral/fileexchange/23416-writetovtk
Chathu
Chathu am 8 Apr. 2016
Bearbeitet: Chathu am 9 Apr. 2016
Thank you so much for your rapid response, Pritesh. Highly appreciate it. Unfortunately, my images are 2D images (above mention code only works for 3D images) and they are saved in .mat format (after the segmmentation).
Hence, how to convert 2D .mat files to 3D .mat files. Can anyone kindly give me a clue for that so then i can use the above code.
Anyhow Pritesh, your quick response for my original question is highly admired.

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 9 Apr. 2016

0 Stimmen

3 Kommentare

Chathu
Chathu am 9 Apr. 2016
Walter, thank you so much for your response. Really appreciate it.
I came up with another question which i will ask here as it is related to the original question (sorry if i caused any inconvenience).
So far i have a 2D matrix (eg:segmented masks)but i want to add the 3rd column (which is the slice thickness) to this matrix. So these masks are saved in .mat format. Is it possible for me to add a 3rd column to this matrix?
Walter Roberson
Walter Roberson am 9 Apr. 2016
If you mean can you add it to the .mat file, then Yes: load the file, change the variable, save back to the file again.
If you mean can you add the column to what you are exporting to VTK, then I do not know.
Chathu
Chathu am 9 Apr. 2016
I meant to the .mat file. That answered my qu. Thanks Walter :)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Pritesh Shah
Pritesh Shah am 9 Apr. 2016

1 Stimme

In file exchanger, the code is available. Please check following link http://www.mathworks.com/matlabcentral/fileexchange/23416-writetovtk

1 Kommentar

Chathu
Chathu am 19 Apr. 2016
Hi, i know i am little late to write to this but unfortunately i do not get the converted vtk file using the above code (Tim's code).I know it should work, but i don't understand why i am not getting it though. Can anyone guide me to detect the problem? (ps:i am writing here coz its related to this topic).

Melden Sie sich an, um zu kommentieren.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by