]> Creatis software - creaImageIO.git/commitdiff
*** empty log message ***
authorguigues <guigues>
Fri, 17 Oct 2008 12:17:58 +0000 (12:17 +0000)
committerguigues <guigues>
Fri, 17 Oct 2008 12:17:58 +0000 (12:17 +0000)
src/creaImageIOImageReader.cpp

index 970178d0bc16a4fd00afd42e1d3ee07bda6f8c66..d4eed5a75c9ddbf098d6c6580ac09dedc1dd28f3 100644 (file)
@@ -151,10 +151,11 @@ namespace creaImageIO
       
       IRSplitString(ext," ",v);
     }
-    
+     
     void ReadDicomInfo(const std::string& filename, 
                       DicomNode* image) 
     {
+      //      std::cout << "SpecificVtkReader::ReadDicomInfo '"<<filename<<"'"<<std::endl;
       boost::filesystem::path full_path(filename);
       std::string f = full_path.leaf();
        //Utilities::GetFileName(filename));
@@ -162,20 +163,25 @@ namespace creaImageIO
       image->SetFieldValue("A0004_1500",irclean(f));
       // Does not work : 
       // How to get the image info without loading it in vtk ?
-      /*
+      
       mVTKReader->SetFileName(filename.c_str());
-      mVTKReader->OpenFile();
+      mVTKReader->Update(); //OpenFile();
       int ext[6];
       mVTKReader->GetDataExtent(ext);
       // Columns
       char str[128];
       sprintf(str,"%i",ext[1]-ext[0]);
+      //      std::cout << "col="<<str<<std::endl;
       image->SetFieldValue("A0028_0011",str);
       // Rows
       sprintf(str,"%i",ext[3]-ext[2]);
+      //      std::cout << "row="<<str<<std::endl;
       image->SetFieldValue("A0028_0010",str);
-      */
-      
+      // Planes == frames
+      sprintf(str,"%i",ext[5]-ext[4]);
+      //      std::cout << "frames="<<str<<std::endl;
+      image->SetFieldValue("A0028_0008",str);
+            
     }
   private:
     vtkImageReader2* mVTKReader;
@@ -279,6 +285,7 @@ namespace creaImageIO
     void ReadDicomInfo(const std::string& filename,
                       DicomNode* image)
     { 
+      //    std::cout << "DicomReader::ReadDicomInfo '"<<filename<<"'"<<std::endl;
       GDCM_NAME_SPACE::File* file = GDCM_NAME_SPACE::File::New();
       file->SetLoadMode( GDCM_NAME_SPACE::LD_ALL);
       file->SetFileName(filename.c_str());
@@ -452,6 +459,7 @@ namespace creaImageIO
    void ImageReader::ReadDicomInfo(const std::string& filename, 
                                   DicomNode* image)
    {
+     // std::cout << "ImageReader::ReadDicomInfo '"<<filename<<"'"<<std::endl;
     //    std::cout << "## ImageReader::Read("<<filename<<")"<<std::endl;
     if (mLastFilename!=filename)
       {