]> Creatis software - creaImageIO.git/blobdiff - src2/creaImageIOUltrasonixImageReader.cpp
Fix _T(...
[creaImageIO.git] / src2 / creaImageIOUltrasonixImageReader.cpp
index 12c74402de2266a2019fa944abb451d6e4051aa3..014e0953c7a6be97215f1ff10844922d61fd61d4 100644 (file)
@@ -1,7 +1,7 @@
 
+#include <creaImageIOSystem.h>
 #include <creaImageIOUltrasonixImageReader.h>
 #include <creaVtk.h>
-#include <creaImageIOSystem.h>
 #include "boost/filesystem/path.hpp"
 
 namespace creaImageIO
@@ -82,9 +82,6 @@ namespace creaImageIO
   //=====================================================================
   vtkImageData* UltrasonixImageReader::ReadImage(const std::string& filename)
   {
-
-         std::cout<<"UltrasonixImageReader reading "<<std::endl;
-
     FILE *Ultrasonix_file=fopen(filename.c_str(),"rb");
     if (!Ultrasonix_file) return false;
     Ultrasonix_header h;
@@ -175,9 +172,7 @@ namespace creaImageIO
   void UltrasonixImageReader::ReadAttributes(const std::string& filename, 
                                      std::map<std::string,std::string>& attr)
   {
-    //      std::cout << "UltrasonixImageReader::ReadDicomInfo '"<<filename<<"'"<<std::endl;
     GimmickMessage(2,"Reading attributes from '"<<filename<<std::endl);
 
     FILE *Ultrasonix_file=fopen(filename.c_str(),"rb");
     if (!Ultrasonix_file) return;
@@ -198,35 +193,47 @@ namespace creaImageIO
     // Planes 
     char planes[128];
     sprintf(planes,"%i",h.frame);
+        // Sampling frequency
+        char samplingFrequency[128];
+        sprintf(samplingFrequency,"%i",h.samplingRate);
+        // Transducer frequency
+        char transducerFrequency[128];
+        sprintf(transducerFrequency,"%i",h.frequency);
     
     
     // 
     std::map<std::string,std::string>::iterator i;
     if ( (i = attr.find("FullFileName")) != attr.end())
-      {
-       //        boost::filesystem::path full_path(filename);
-       // std::string f = full_path.leaf();
-       i->second = filename;
-      }
+    {
+               i->second = filename;
+    }
     if ( (i = attr.find("D0004_1500")) != attr.end())
-      {
-       boost::filesystem::path full_path(filename);
-       std::string f = full_path.leaf();
-       i->second = f;
-      }
+    {
+               boost::filesystem::path full_path(filename);
+               std::string f = full_path.leaf();
+               i->second = f;
+    }
     if ( (i = attr.find("D0028_0010")) != attr.end())
-      {
-       i->second = rows;
-      }
+    {
+               i->second = rows;
+    }
     if ( (i = attr.find("D0028_0011")) != attr.end())
-      {
-       i->second = cols;
-      }
-    
+    {
+               i->second = cols;
+    }
     if ( (i = attr.find("D0028_0012")) != attr.end())
-      {
-       i->second = planes;
-      }
+    {
+               i->second = planes;
+    }
+        if ( (i = attr.find("D003a_001a")) != attr.end())
+        {
+                i->second = samplingFrequency;
+        }
+        if ( (i = attr.find("D0018_6030")) != attr.end())
+        {
+                i->second = transducerFrequency;
+        }
+
     
    GimmickMessage(2,"Attributes map:"<<std::endl<<attr<<std::endl);
   }