<div dir="ltr"><font face="arial, helvetica, sans-serif">Hello,</font><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif" color="#000000">I have used <a href="https://www.mathworks.com/matlabcentral/fileexchange/50974-3d-shepp-logan-phantom">MATLAB</a> to create a stack of images using Shepp-Logan Phantom and saved all these images in dicom format using <font class="gmail-"><i>dicomwrite</i></font> function:</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div>
<p class="MsoNormal"><font face="arial, helvetica, sans-serif" color="#0000ff">sizeP = [128 128 128]<span></span></font></p>
<p class="MsoNormal"><font face="arial, helvetica, sans-serif" color="#0000ff">[p,ellipse]=phantom3dAniso(sizeP);<span></span></font></p>
<p class="MsoNormal"><font face="arial, helvetica, sans-serif" color="#0000ff">outDir = './SLPData/';<span></span></font></p>
<p class="MsoNormal"><font face="arial, helvetica, sans-serif" color="#0000ff">for i=1:sizeP(3)<span></span></font></p>
<p class="MsoNormal"><font face="arial, helvetica, sans-serif" color="#0000ff"> fname = [outDir sprintf('SLP%06d.dcm', i)];<span></span></font></p>
<p class="MsoNormal"><font face="arial, helvetica, sans-serif" color="#0000ff"> dicomwrite(p(:,:,i), fname)<span></span></font></p>
<font face="arial, helvetica, sans-serif"><font color="#0000ff">end </font> <br></font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">So, I have 128 dicom files ('</font>SLP000001.dcm', <font face="arial, helvetica, sans-serif">'</font>SLP000002.dcm', ... , 'SLP000128.dcm' <span style="font-family:arial,helvetica,sans-serif">) in th<font color="#000000">e </font></span><span style="font-family:arial,helvetica,sans-serif"><font color="#000000">'SLPData' folder. </font></span><span style="font-family:arial,helvetica,sans-serif">Now, I am trying to read these dicom images in Python using SimpleITK:</span></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><div><font face="arial, helvetica, sans-serif" color="#0000ff">pathDicomA = '/SLPData'</font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff">reader = sitk.ImageSeriesReader()</font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff">dicom_namesA = reader.GetGDCMSeriesFileNames(pathDicomA)</font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff">reader.SetFileNames(dicom_namesA)</font></div><div><font face="arial, helvetica, sans-serif" color="#0000ff">imageA = reader.Execute()</font></div></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><div><font face="arial, helvetica, sans-serif">However, when I run the code, it only reads in one of the images instead of the whole series:</font></div></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div>dicom_namesA => ('.../SLPData/SLP000108.dcm',)</div><div>imageA.GetSize() => (128, 128, 1)</div><div><br></div><div><div><font face="arial, helvetica, sans-serif">I am wondering how I should resolve this issue?</font></div></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Thanks in advance!</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Best regards,</font></div><div><font face="arial, helvetica, sans-serif">Sara </font></div></div>