]> Creatis software - bbtk.git/commitdiff
BUG Files Directory
authorEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Wed, 25 Mar 2009 16:28:29 +0000 (16:28 +0000)
committerEduardo Davila <Eduardo.Davila@creatis.insa-lyon.fr>
Wed, 25 Mar 2009 16:28:29 +0000 (16:28 +0000)
packages/gdcmvtk/bbs/appli/exampleGetXCoherentInfoGdcmReader.bbs
packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.cxx
packages/gdcmvtk/src/bbgdcmvtkGetXCoherentInfoGdcmReader.h
packages/std/src/bbstdFilesFromDirectory.cxx

index 4c312bfe23dfad225416962c0bd3981d0caa3cb5..d98ba90da7e23a3ee3403046ee2f428331e01404 100644 (file)
@@ -38,7 +38,5 @@ print $reader.IPP$
 print PixelSpacing
 print $reader.PixelSpacing$
 
-print InterSlice
-print $reader.InterSlice$
 
 
index 21fcdcf1dcb17dd9e083d0a66f0d49aad2b6c370..93437d05ba9d780521c5ca3de4f26153abc7dd64 100644 (file)
@@ -40,13 +40,6 @@ void GetXCoherentInfoGdcmReader::Process()
       v_ipp.push_back(ipp[i]);
    bbSetOutputIPP(v_ipp );
 
-   std::vector<double> v_pixelspacing;
-   v_pixelspacing.push_back(f->GetXSpacing());
-   v_pixelspacing.push_back(f->GetYSpacing());
-   if (f->GetZSize() != 1) {
-      v_pixelspacing.push_back(f->GetZSpacing());
-   }
-   bbSetOutputPixelSpacing(v_pixelspacing);
 
 // Add all the files to the SerieHelper
    sh = GDCM_NAME_SPACE::SerieHelper::New();
@@ -61,27 +54,6 @@ void GetXCoherentInfoGdcmReader::Process()
    GDCM_NAME_SPACE::FileList::const_iterator it;
    GDCM_NAME_SPACE::FileList *l;
 
-   // ==================== Just to see ==============================
-
-   std::cout << std::endl << " ---------------------------------------- Recap"
-             << std::endl;
-   l = sh->GetFirstSingleSerieUIDFileSet();
-   while (l)
-   {
-      it = l->begin();
-      std::cout << "SerieUID [" <<  (*it)->GetEntryString(0x0020,0x000e) <<"]   Serie Description ["
-                << (*it)->GetEntryString(0x0008,0x103e) << "] "
-                << " : " << l->size() << " files" << std::endl;
-      l = sh->GetNextSingleSerieUIDFileSet();
-   }
-    std::cout << " ----------------------------------------End Recap"
-             << std::endl << std::endl;
-
-   if(l->size() > 1)
-     std::cout << " --------------------------- More than ONE Serie UID ?!?"
-               << std::endl << std::endl;
-   // ============================================================
-
    // Should only contain one!
    l = sh->GetFirstSingleSerieUIDFileSet();
 
@@ -91,11 +63,16 @@ void GetXCoherentInfoGdcmReader::Process()
    sh->OrderFileList(l);
    zspacing = sh->GetZSpacing();
 
-   std::cout << "GetZSpacing() of sorted SingleSerieUIDFileSet "
-             << "from GDCM_NAME_SPACE::SerieHelper: " << zspacing << std::endl;
-   std::cout << " ('-1' means all the files have the same position)" << std::endl;
-
-   bbSetOutputInterSlice(zspacing);
+       std::vector<double> v_pixelspacing;
+       v_pixelspacing.push_back( f->GetXSpacing() );
+       v_pixelspacing.push_back( f->GetYSpacing() );
+       v_pixelspacing.push_back( zspacing );
+//     if (f->GetZSize() != 1) {
+//             v_pixelspacing.push_back(f->GetZSpacing());
+//     }
+       bbSetOutputPixelSpacing(v_pixelspacing);
+       
+       
 
    
    reader = vtkGdcmReader::New();
@@ -104,8 +81,6 @@ void GetXCoherentInfoGdcmReader::Process()
    reader->Update();
    reader->GetOutput();
 
-   vtkIndent indent ;
-   reader->GetOutput()->PrintSelf(std::cout, indent);
    bbSetOutputOut( reader->GetOutput() );
 }
 
index 858a4909f7be572405674e64b1e5fca3b0c38f95..97064cd4c04d715c24d21b79cc533269f77d4fda 100644 (file)
@@ -33,7 +33,6 @@ virtual void bbUserDestructor();
   BBTK_DECLARE_OUTPUT(IPP,          std::vector<double>);
   BBTK_DECLARE_OUTPUT(IOP,          std::vector<double>);
   BBTK_DECLARE_OUTPUT(PixelSpacing, std::vector<double>);
-  BBTK_DECLARE_OUTPUT(InterSlice,   double);
        
   BBTK_PROCESS(Process);
   void Process();
@@ -58,7 +57,6 @@ BBTK_OUTPUT(GetXCoherentInfoGdcmReader,Out,         "Output image",
 BBTK_OUTPUT(GetXCoherentInfoGdcmReader,IPP,         "Image Position (Patient)",    std::vector<double>,"");
 BBTK_OUTPUT(GetXCoherentInfoGdcmReader,IOP,         "Image Orientation (Patient)", std::vector<double>,"");
 BBTK_OUTPUT(GetXCoherentInfoGdcmReader,PixelSpacing,"Pixel Spacing",               std::vector<double>,"");
-BBTK_OUTPUT(GetXCoherentInfoGdcmReader,InterSlice,  "InterSlice",                  double,"");
 BBTK_END_DESCRIBE_BLACK_BOX(GetXCoherentInfoGdcmReader);
 } // EO namespace bbgdcmvtk
 
index 60696231cf5d464266364efde142fa5d730246ad..e91ef23898cf5190eccc0aebbf930ab8c315c42a 100644 (file)
@@ -145,8 +145,11 @@ int FilesFromDirectory::Explore(std::string const &dirpath, bool recursive)
       }
       if ( S_ISREG(buf.st_mode) )    //is it a regular file?
       {
-         Filenames.push_back( fileName );
-         numberOfFiles++;
+                 if ( d->d_name[0]!='.')
+                 {     
+              Filenames.push_back( fileName );
+              numberOfFiles++;
+                 }
       }
       else if ( S_ISDIR(buf.st_mode) ) //directory?
       {