<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Hi Lifan,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">did you examine the DICOM headers? Do different timepoints have different acquisition times?</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Regards,</div><div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">Dženan</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 24, 2016 at 11:22 AM, Chen, Lifan <span dir="ltr"><<a href="mailto:LCHEN41@mgh.harvard.edu" target="_blank">LCHEN41@mgh.harvard.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt"><font size="3">Hey all,</font>
<div><font size="3"><br>
</font></div>
<div><font size="3">Any help would be appreciated. This problem really gets me in for couple of days.</font></div>
<div><font size="3"><br>
</font></div>
<div><font size="3">Thanks,</font></div>
<div><font size="3">Lifan</font><br>
<div style="font-family:Times New Roman;color:#000000;font-size:16px">
<hr>
<div style="direction:ltr"><font face="Tahoma" size="2" color="#000000"><b>发件人:</b> Chen, Lifan<br>
<b>发送时间:</b> 2016年2月23日 17:48<br>
<b>收件人:</b> <a href="mailto:community@itk.org" target="_blank">community@itk.org</a><br>
<b>主题:</b> ITK try to read 4D dicom time series(3d, t), but get 3d*t<br>
</font><br>
</div><div><div class="h5">
<div></div>
<div>
<div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt"><font size="3">Hi all,</font>
<div><font size="3"><br>
</font></div>
<div><font size="3">These days, I am trying to use ITK to handle 4D dicom series (3d+t). I use GDCMSeriesFileNames to generate seriesUIDs and ImageSeriesReader to read these images.</font></div>
<div><font size="3"><br>
</font></div>
<div><font size="3">The following is part of my code:</font></div>
<div>
<div><font size="3">typedef double    PixelType;</font></div>
<div><font size="3"><span style="white-space:pre-wrap"></span>typedef itk::Image< PixelType, 4>         Image4DType;                  //4D image type</font></div>
<div><font size="3"><span style="white-space:pre-wrap"></span>typedef itk::Image< PixelType, 3>         Image3DType;                  //3D image type</font></div>
<div><font size="3"><span style="white-space:pre-wrap"></span>typedef itk::ImageSeriesReader< Image4DType >        ReaderType;</font></div>
<div><font size="3"><span style="white-space:pre-wrap"></span>typedef itk::GDCMImageIO       ImageIOType;</font></div>
</div>
<div>
<div><font size="3"><span style="white-space:pre-wrap"></span>reader = ReaderType::New();</font></div>
<div><font size="3"><span style="white-space:pre-wrap"></span>dicomIO = ImageIOType::New();</font></div>
<div><font size="3"><span style="white-space:pre-wrap"></span>typedef itk::GDCMSeriesFileNames NamesGeneratorType;</font></div>
<div><font size="3"><span style="white-space:pre-wrap"></span>NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();</font></div>
<div><font size="3"><span style="white-space:pre-wrap"></span>nameGenerator->AddSeriesRestriction("0008|0021");</font></div>
<div><font size="3"><span style="white-space:pre-wrap"></span>nameGenerator->SetUseSeriesDetails(true);</font></div>
<div><font size="3"><span style="white-space:pre-wrap"></span>nameGenerator->SetDirectory(_filename);</font></div>
<div><font size="3"><span style="white-space:pre-wrap"></span>typedef std::vector< std::string >    SeriesIdContainer;</font></div>
<div><font size="3"><span style="white-space:pre-wrap"></span>const SeriesIdContainer & seriesUID = nameGenerator->GetSeriesUIDs();</font></div>
<div><font size="3"><span style="white-space:pre-wrap"></span>_isFileLoaded = !(seriesUID.empty());</font></div>
<div><font size="3"><span style="white-space:pre-wrap"></span>if (true == _isFileLoaded){</font></div>
<div><font size="3"><span style="white-space:pre-wrap"></span>SeriesIdContainer::const_iterator seriesItr = seriesUID.begin();</font></div>
<div><font size="3"><span style="white-space:pre-wrap"></span>SeriesIdContainer::const_iterator seriesEnd = seriesUID.end();</font></div>
<div><font size="3"><span style="white-space:pre-wrap"></span>std::string seriesIdentifier = seriesUID.begin()->c_str();</font></div>
<div><font size="3"><span style="white-space:pre-wrap"></span>typedef std::vector< std::string >   FileNamesContainer;</font></div>
<div><font size="3"><span style="white-space:pre-wrap"></span>FileNamesContainer fileNames;</font></div>
<div><font size="3"><span style="white-space:pre-wrap"></span>fileNames = nameGenerator->GetFileNames(seriesIdentifier);</font></div>
<div><font size="3"><span style="white-space:pre-wrap"></span>reader->SetFileNames(fileNames);</font></div>
<div><font size="3"><span style="white-space:pre-wrap"></span>reader->SetImageIO(dicomIO);</font></div>
<div><font size="3"><span style="white-space:pre-wrap"></span>reader->Update();</font></div>
<div><font size="3"><span style="white-space:pre-wrap"></span>}</font></div>
</div>
<div><font size="3"><br>
</font></div>
<div><font size="3">I have tried this code and the reader worked well. However I got a [x,y,z*t, 1] data, but not [x, y, z, t] data. I understand the problem may caused by nameGenerator, but I use SetUseSeriesDetails and AddSeriesRestriction("0008|0021")(aquisition
 time)which are implied by documents to handle 4d images.I have also tried several methods but all not work. I wonder whether ITK have an original method to handle 4d images.</font></div>
<div><font size="3"><br>
</font></div>
<div><font size="3">Have anyone ever met this problem before? Any help or recommendations would be appreciated. </font></div>
<div><font size="3"><br>
</font></div>
<div><font size="3">Thanks,</font></div>
<div><font size="3">Lifan</font></div>
</div>
</div>
</div></div></div>
</div>
</div><div><div class="h5">
<p></p>

<p>The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.</p></div></div></div>

<br>_______________________________________________<br>
Community mailing list<br>
<a href="mailto:Community@itk.org">Community@itk.org</a><br>
<a href="http://public.kitware.com/mailman/listinfo/community" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/community</a><br>
<br></blockquote></div><br></div>