<meta http-equiv="content-type" content="text/html; charset=utf-8"><div>Thanks I used pydicom to get the metadata and used what you suggested and it worked!</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">Thank you!<br><br>Sent from my iPhone</div><div><br>On Jul 13, 2017, at 4:23 PM, David Gobbi [via VTK] <<a href="/user/SendEmail.jtp?type=node&node=5743966&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>> wrote:<br><br></div><blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' type="cite">

        <div dir="ltr">Hi Sonam,<div><br></div><div>The filter vtkImageChangeInformation can modify the spacing of the data:</div><div><br></div><div>ici = vtk.vtkImageChangeInformation()</div><div>ici.SetInputConnection(reader.GetOutputPort())</div><div>ici.SetOutputSpacing(0.859375, 0.859375, 5.0)</div><div><br></div><div> - David</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 13, 2017 at 11:19 AM, Sonam Wangyal <span dir="ltr"><<a href="/user/SendEmail.jtp?type=node&node=5743965&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>></span> wrote:<br><blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' style="border-left:2px solid #CCCCCC;padding:0 1em" class="gmail_quote"><div style="word-wrap:break-word"><span style="font-family:HelveticaNeue;font-size:13.44px;font-variant-ligatures:normal;background-color:rgb(255,255,255)">Hello! </span><br style="font-size:13.44px;font-variant-ligatures:normal;background-color:rgb(255,255,255)"><br style="font-size:13.44px;font-variant-ligatures:normal;background-color:rgb(255,255,255)"><span style="font-family:HelveticaNeue;font-size:13.44px;font-variant-ligatures:normal;background-color:rgb(255,255,255)">This is my first post in this community and just as a heads up I am a complete newbie. I am currently working on a project to segment ventricles from MRI scans of the brain (in MATLAB). I wanted to then extract the surface using vtkDiscreteMarchingCubes() and write it into an STL file using vtkSTLWriter(). </span><br style="font-size:13.44px;font-variant-ligatures:normal;background-color:rgb(255,255,255)"><br style="font-size:13.44px;font-variant-ligatures:normal;background-color:rgb(255,255,255)"><span style="font-family:HelveticaNeue;font-size:13.44px;font-variant-ligatures:normal;background-color:rgb(255,255,255)">My problem is with the PixelSpacing, the documentation says if there are multiple DICOM images then the 'z' value is the Spacing Between the Slices. But I am receiving (0.859375, 0.859375, 0.0). I don't know why it is giving me a 0.0, it should be a 5. I have tried with an single DICOM and it works properly it gave me a Slice Thickness which coincidentally is the same value as the Spacing Between the Slices. </span><br style="font-size:13.44px;font-variant-ligatures:normal;background-color:rgb(255,255,255)"><br style="font-size:13.44px;font-variant-ligatures:normal;background-color:rgb(255,255,255)"><span style="font-family:HelveticaNeue;font-size:13.44px;font-variant-ligatures:normal;background-color:rgb(255,255,255)">SO MY QUESTION IS: is there anyway to manually change the value? My code is down below, THANKS FOR YOUR HELP! </span><br style="font-size:13.44px;font-variant-ligatures:normal;background-color:rgb(255,255,255)"><br style="font-size:13.44px;font-variant-ligatures:normal;background-color:rgb(255,255,255)"><span style="font-size:13.44px;font-variant-ligatures:normal;background-color:rgb(255,255,255)"><font face="Monaco">import vtk <br><br>PathDicom = "./DICOMs/" <br>reader = vtk.vtkDICOMImageReader() <br>reader.SetDirectoryName(<wbr>PathDicom) <br>reader.Update() <br><br>print(reader.GetPixelSpacing()<wbr>) <br><br>dmc = vtk.vtkDiscreteMarchingCubes()<wbr> <br>dmc.SetInputConnection(reader.<wbr>GetOutputPort()) <br>dmc.GenerateValues(1, 1, 1) <br>dmc.Update() <br><br>writer = vtk.vtkSTLWriter() <br>writer.SetInputConnection(dmc.<wbr>GetOutputPort()) <br>writer.SetFileTypeToBinary() <br>writer.SetFileName("ventricle.<wbr>stl") <br>writer.Write()</font></span><div><div><font size="2" face="HelveticaNeue"><span style="background-color:rgb(255,255,255)"><i><br></i></span></font></div><div><font size="2" face="HelveticaNeue"><span style="background-color:rgb(255,255,255)">Cheers,</span></font></div><div>
<div><b style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-variant-ligatures:normal;line-height:normal;background-color:rgb(255,255,255)">Sonam Wangyal</b><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-variant-ligatures:normal;line-height:normal;background-color:rgb(255,255,255)"><br></div></div></div></div></div></blockquote></div></div></div>
<br>_______________________________________________
<br>Powered by <a href="http://www.kitware.com" target="_top" rel="nofollow" link="external">www.kitware.com</a>
<br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_top" rel="nofollow" link="external">http://www.kitware.com/opensource/opensource.html</a><br><br>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_top" rel="nofollow" link="external">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" target="_top" rel="nofollow" link="external">http://markmail.org/search/?q=vtkusers</a><br><br>Follow this link to subscribe/unsubscribe:
<br><a href="http://public.kitware.com/mailman/listinfo/vtkusers" target="_top" rel="nofollow" link="external">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>

        
        
        
        <br>
        <br>
        <hr noshade="noshade" size="1" color="#cccccc">
        <div style="color:#444; font: 12px tahoma,geneva,helvetica,arial,sans-serif;">
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                <a href="http://vtk.1045678.n5.nabble.com/vtkDICOMImageReader-Anyway-to-change-the-metadata-tp5743964p5743965.html" target="_top" rel="nofollow" link="external">http://vtk.1045678.n5.nabble.com/vtkDICOMImageReader-Anyway-to-change-the-metadata-tp5743964p5743965.html</a>
        </div>
        <div style="color:#666; font: 11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                To start a new topic under VTK - Users, email <a href="/user/SendEmail.jtp?type=node&node=5743966&i=1" target="_top" rel="nofollow" link="external">[hidden email]</a> <br>
                To unsubscribe from VTK - Users, <a href="" target="_top" rel="nofollow" link="external">click here</a>.<br>
                <a href="http://vtk.1045678.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" target="_top" link="external">NAML</a>
        </div></blockquote>

        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/vtkDICOMImageReader-Anyway-to-change-the-metadata-tp5743964p5743966.html">Re: vtkDICOMImageReader(): Anyway to change the metadata?</a><br/>
Sent from the <a href="http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html">VTK - Users mailing list archive</a> at Nabble.com.<br/>