<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<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 class="Apple-tab-span" style="white-space:pre"></span>typedef itk::Image< PixelType, 4> Image4DType; //4D image type</font></div>
<div><font size="3"><span class="Apple-tab-span" style="white-space:pre"></span>typedef itk::Image< PixelType, 3> Image3DType; //3D image type</font></div>
<div><font size="3"><span class="Apple-tab-span" style="white-space:pre"></span>typedef itk::ImageSeriesReader< Image4DType > ReaderType;</font></div>
<div><font size="3"><span class="Apple-tab-span" style="white-space:pre"></span>typedef itk::GDCMImageIO ImageIOType;</font></div>
</div>
<div>
<div><font size="3"><span class="Apple-tab-span" style="white-space:pre"></span>reader = ReaderType::New();</font></div>
<div><font size="3"><span class="Apple-tab-span" style="white-space:pre"></span>dicomIO = ImageIOType::New();</font></div>
<div><font size="3"><span class="Apple-tab-span" style="white-space:pre"></span>typedef itk::GDCMSeriesFileNames NamesGeneratorType;</font></div>
<div><font size="3"><span class="Apple-tab-span" style="white-space:pre"></span>NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();</font></div>
<div><font size="3"><span class="Apple-tab-span" style="white-space:pre"></span>nameGenerator->AddSeriesRestriction("0008|0021");</font></div>
<div><font size="3"><span class="Apple-tab-span" style="white-space:pre"></span>nameGenerator->SetUseSeriesDetails(true);</font></div>
<div><font size="3"><span class="Apple-tab-span" style="white-space:pre"></span>nameGenerator->SetDirectory(_filename);</font></div>
<div><font size="3"><span class="Apple-tab-span" style="white-space:pre"></span>typedef std::vector< std::string > SeriesIdContainer;</font></div>
<div><font size="3"><span class="Apple-tab-span" style="white-space:pre"></span>const SeriesIdContainer & seriesUID = nameGenerator->GetSeriesUIDs();</font></div>
<div><font size="3"><span class="Apple-tab-span" style="white-space:pre"></span>_isFileLoaded = !(seriesUID.empty());</font></div>
<div><font size="3"><span class="Apple-tab-span" style="white-space:pre"></span>if (true == _isFileLoaded){</font></div>
<div><font size="3"><span class="Apple-tab-span" style="white-space:pre"></span>SeriesIdContainer::const_iterator seriesItr = seriesUID.begin();</font></div>
<div><font size="3"><span class="Apple-tab-span" style="white-space:pre"></span>SeriesIdContainer::const_iterator seriesEnd = seriesUID.end();</font></div>
<div><font size="3"><span class="Apple-tab-span" style="white-space:pre"></span>std::string seriesIdentifier = seriesUID.begin()->c_str();</font></div>
<div><font size="3"><span class="Apple-tab-span" style="white-space:pre"></span>typedef std::vector< std::string > FileNamesContainer;</font></div>
<div><font size="3"><span class="Apple-tab-span" style="white-space:pre"></span>FileNamesContainer fileNames;</font></div>
<div><font size="3"><span class="Apple-tab-span" style="white-space:pre"></span>fileNames = nameGenerator->GetFileNames(seriesIdentifier);</font></div>
<div><font size="3"><span class="Apple-tab-span" style="white-space:pre"></span>reader->SetFileNames(fileNames);</font></div>
<div><font size="3"><span class="Apple-tab-span" style="white-space:pre"></span>reader->SetImageIO(dicomIO);</font></div>
<div><font size="3"><span class="Apple-tab-span" style="white-space:pre"></span>reader->Update();</font></div>
<div><font size="3"><span class="Apple-tab-span" style="white-space:pre"></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>
<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>
http://www.partners.org/complianceline . 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></body>
</html>