<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Lazzarato Dr. Gianni wrote:
<blockquote cite="midFBCMFE02B1022ZhCl8a0005e7b4@fbcmfe02b10.fbc.local"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta name="Generator" content="Microsoft Word 11 (filtered medium)">
  <style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.StileMessaggioDiPostaElettronica17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 2.0cm 2.0cm 2.0cm;}
div.Section1
        {page:Section1;}
-->
  </style>
  <div class="Section1">
  <p class="MsoNormal"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB">Hi Users,<o:p></o:p></span></p>
  <p class="MsoNormal"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB">           
 i have a problem with some datasets.<o:p></o:p></span></p>
  <p class="MsoNormal"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB">I cannot
proper load the main dataset when one or
more Latero-Lateral scout views are included in the dataset : only the
scout
view Is/are loaded.<o:p></o:p></span></p>
  <p class="MsoNormal"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB">The problem
disappear if I manually erase the scout
views from the dataset.<o:p></o:p></span></p>
  <p class="MsoNormal"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB">Is there an
easy way to bypass gdcm from loading it
and only load main axial dataset? <o:p></o:p></span></p>
  <p class="MsoNormal"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB">Thank you
for the help.<o:p></o:p></span></p>
  <p class="MsoNormal"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB"><o:p> </o:p></span></p>
  <p class="MsoNormal"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB">Gianni<o:p></o:p></span></p>
  <p class="MsoNormal"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB"><o:p> </o:p></span></p>
  <p class="MsoNormal"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB"><o:p> </o:p></span></p>
  </div>
</blockquote>
It's not so easy :<br>
Splitting the file set you find in the directory according to Serie UID
is very often enough, but in some cases, there are images with
different orientations, with the same Serie UID.<br>
You have to split again the 'Single Serie UID' file set according to
the orientation.<br>
<br>
   <br>
   gdcm::SerieHelper *s = gdcm::SerieHelper::New();<br>
   s->SetDirectory(dirName, true); // true : recursive exploration<br>
<br>
   // The Dicom file set is splitted into several 'Single SerieUID
FileSets'<br>
   // (a 'Single SerieUID Files Set' per SerieUID)<br>
   // In some cases, it's not enough, since, in some cases<br>
   // we can find scout view with the same SerieUID<br>
<br>
   int nbFiles;<br>
   std::string fileName;<br>
   // For all the Single SerieUID Files Sets of the gdcm::Serie<br>
   <br>
   gdcm::FileList *l = s->GetFirstSingleSerieUIDFileSet();<br>
   <br>
   gdcm::XCoherentFileSetmap xcm;<br>
   while (l) // for each 'Single SerieUID FileSet'<br>
   { <br>
      nbFiles = l->size() ;<br>
      if ( l->size() > 3 ) // Why not ? Just an example, for
testing<br>
                           // A "Single SerieUID FileSet' with too few
images has no interest (?)<br>
      {<br>
         std::cout << "Split the 'Single SerieUID' FileSet :[" <br>
                   << s->GetCurrentSerieUIDFileSetUID()<br>
                   << "]  " << nbFiles << " long"
<< std::endl;<br>
         std::cout << "-----------------------------------"
<< std::endl;     <br>
  <br>
         // Here, we consider that, within a "Single SerieUID FileSet',
we can find varios orientations<br>
         xcm = s->SplitOnOrientation(l); // hopefully, Scout views
have not the same 'orientation'<br>
                                     //  than other images<br>
    <br>
      // within a XCoherentFileSet (Extra Coherent -sorry for the name-
)<br>
     // all the files have same orientation<br>
     <br>
         for (gdcm::XCoherentFileSetmap::iterator i = xcm.begin();<br>
                                                  i != xcm.end();<br>
                                                ++i)<br>
         {<br>
            // Just to see what the current XCoherentFileSet contains<br>
            std::cout << "-------------------- [" <<
(*i).first << "]" << std::endl;   <br>
            for (gdcm::FileList::iterator it = 
((*i).second)->begin();<br>
                                          it != ((*i).second)->end();<br>
                                        ++it)<br>
            {<br>
               fileName = (*it)->GetFileName();<br>
               std::cout << "    " << fileName <<
std::endl;<br>
            } <br>
            std::cout << std::endl;   <br>
         }<br>
<br>
       // Manage to guess which one you want to work with.<br>
       // (check number of files, for instance)<br>
       // and break when you find it.<br>
<br>
      }<br>
      l = s->GetNextSingleSerieUIDFileSet();<br>
   } <br>
<br>
<br>
// ...<br>
      <br>
   s->OrderFileList((*i).second);  // sort the XCoherent Fileset you
decided to work with<br>
     <br>
  vtkGdcmReader *reader = vtkGdcmReader::New();<br>
// ... <br>
  SetCoherentFileList(l); <br>
  reader->Update(); <br>
<br>
HTH<br>
<br>
Jean-Pierre Roux<br>
   <br>
     <br>
<br>
<br>
<br>
</body>
</html>