<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:151217919;
        mso-list-type:hybrid;
        mso-list-template-ids:108792912 -2067240922 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Calibri",sans-serif;
        mso-fareast-font-family:Calibri;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">You can also insert your meshes into a vtkMultiBlockDataSet and use vtkXMLMultiBlockDataWriter/vtkXMLMultiBlockDataReader. The advantage compared to 3DS/OBJ/VRML
 exporters that all polydata point/cell arrays are preserved and you can optionally also store metadata for the whole dataset or for each block. Actor properties (such as color, opacity) are not written to the file, unless you store them in the polydata object.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">See example of how this is used in 3D Slicer for storing segmentation consisting of potentially overlapping segments.<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">         
</span></span></span><![endif]><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Reading:
</span><span style="font-size:9.0pt;font-family:Consolas;color:#24292E"><a href="https://github.com/Slicer/Slicer/blob/f5128eae6aebfbce9bc4fb1a3a5804e545452d57/Libs/MRML/Core/vtkMRMLSegmentationStorageNode.cxx#L756-L930">https://github.com/Slicer/Slicer/blob/f5128eae6aebfbce9bc4fb1a3a5804e545452d57/Libs/MRML/Core/vtkMRMLSegmentationStorageNode.cxx#L756-L930</a></span><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-.25in;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="font-size:9.0pt;font-family:"Calibri",sans-serif;color:#24292E"><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">         
</span></span></span><![endif]><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Writing:
</span><span style="font-size:9.0pt;font-family:Consolas;color:#24292E"><a href="https://github.com/Slicer/Slicer/blob/f5128eae6aebfbce9bc4fb1a3a5804e545452d57/Libs/MRML/Core/vtkMRMLSegmentationStorageNode.cxx#L1140-L1282">https://github.com/Slicer/Slicer/blob/f5128eae6aebfbce9bc4fb1a3a5804e545452d57/Libs/MRML/Core/vtkMRMLSegmentationStorageNode.cxx#L1140-L1282</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Andras<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> vtkusers [mailto:vtkusers-bounces@vtk.org]
<b>On Behalf Of </b>David Gobbi<br>
<b>Sent:</b> Monday, February 26, 2018 12:07 PM<br>
<b>To:</b> normanius <juch@zhaw.ch><br>
<b>Cc:</b> VTK Users <vtkusers@vtk.org><br>
<b>Subject:</b> Re: [vtkusers] How to save multiple (polydata) objects together with their props into one single file?<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Arial",sans-serif;color:#222222;background:white">On Mon, Feb 26, 2018 at 9:57 AM, normanius <<a href="mailto:juch@zhaw.ch" target="_blank"><span style="color:#1155CC">juch@zhaw.ch</span></a>> wrote:</span><span style="font-family:"Arial",sans-serif;color:#222222"><br style="font-variant-ligatures:normal;font-variant-caps:normal;text-align:start;text-decoration-style:initial;text-decoration-color:initial;word-spacing:0px">
<br>
</span><o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal" style="background:white"><span style="font-family:"Arial",sans-serif;color:#222222"><br>
Do I have to define my own "file format", or does something like this<br>
already exist in vtk?<o:p></o:p></span></p>
</blockquote>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">VTK can use a few different file formats for scenes.  I doubt that all features of each file format are supported, but if your basic requirement is just to save multiple polydata in a file, these should work for you:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.vtk.org%2Fdoc%2Fnightly%2Fhtml%2FclassvtkImporter.html&data=02%7C01%7Classo%40queensu.ca%7Ca885defcd1df443e6d3a08d57d3b5f87%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636552616310776728&sdata=0tyeRnSEIsbm5%2FtSleCeFjgkN6vnYpfodXLP5lptLEc%3D&reserved=0">https://www.vtk.org/doc/nightly/html/classvtkImporter.html</a><o:p></o:p></p>
</div>
<p class="MsoNormal"><a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.vtk.org%2Fdoc%2Fnightly%2Fhtml%2FclassvtkExporter.html&data=02%7C01%7Classo%40queensu.ca%7Ca885defcd1df443e6d3a08d57d3b5f87%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636552616310776728&sdata=XNS8SmNQncJyJJMoWlAOAprx%2FxEeRxCtNfwLFqCSJZU%3D&reserved=0">https://www.vtk.org/doc/nightly/html/classvtkExporter.html</a><o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I don't think VTK has a native file format for this, but I could be wrong.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Cheers,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> - David<o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>