<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span style="font-family: HelveticaNeue; font-size: 13.44px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class="">Hello! </span><br style="font-size: 13.44px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class=""><br style="font-size: 13.44px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class=""><span style="font-family: HelveticaNeue; font-size: 13.44px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class="">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; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class=""><br style="font-size: 13.44px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class=""><span style="font-family: HelveticaNeue; font-size: 13.44px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class="">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; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class=""><br style="font-size: 13.44px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class=""><span style="font-family: HelveticaNeue; font-size: 13.44px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class="">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; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class=""><br style="font-size: 13.44px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class=""><span style="font-size: 13.44px; font-variant-ligatures: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class=""><font face="Monaco" class="">import vtk <br class=""><br class="">PathDicom = "./DICOMs/" <br class="">reader = vtk.vtkDICOMImageReader() <br class="">reader.SetDirectoryName(PathDicom) <br class="">reader.Update() <br class=""><br class="">print(reader.GetPixelSpacing()) <br class=""><br class="">dmc = vtk.vtkDiscreteMarchingCubes() <br class="">dmc.SetInputConnection(reader.GetOutputPort()) <br class="">dmc.GenerateValues(1, 1, 1) <br class="">dmc.Update() <br class=""><br class="">writer = vtk.vtkSTLWriter() <br class="">writer.SetInputConnection(dmc.GetOutputPort()) <br class="">writer.SetFileTypeToBinary() <br class="">writer.SetFileName("ventricle.stl") <br class="">writer.Write()</font></span><div class=""><div style="orphans: 2; widows: 2;" class=""><font size="2" face="HelveticaNeue" class=""><span style="background-color: rgb(255, 255, 255);" class=""><i class=""><br class=""></i></span></font></div><div style="orphans: 2; widows: 2;" class=""><font size="2" face="HelveticaNeue" class=""><span style="background-color: rgb(255, 255, 255);" class="">Cheers,</span></font></div><div class="">
<div class=""><b style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; font-variant-ligatures: normal; line-height: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class="">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; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class=""><font size="1" color="#666666" class="">Electrical Engineering | BEng Candidate </font></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; font-variant-ligatures: normal; line-height: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(102, 102, 102); font-family: Arial, sans-serif; font-size: x-small;" class="">The Faculty of Engineering and Architectural Science</span></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; font-variant-ligatures: normal; line-height: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class=""><font size="1" color="#666666" class=""><span style="font-family: Arial, sans-serif;" class="">E: <a href="mailto:sonam.wangyal@ryerson.ca" target="_blank" style="color: rgb(17, 85, 204);" class="">sonam.wangyal@ryerson.ca</a></span></font></div><div style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: small; font-variant-ligatures: normal; line-height: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(102, 102, 102); font-family: Arial, sans-serif; font-size: x-small;" class="">C: 647.779.2560</span></div></div>
</div>
<br class=""></div></body></html>