]> Creatis software - creaBruker.git/commitdiff
Add Bruker 'Perfusion' info to dicom header
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Tue, 18 May 2010 12:28:37 +0000 (12:28 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Tue, 18 May 2010 12:28:37 +0000 (12:28 +0000)
lib/src1/bruker2dicom.cxx
lib/src1/bruker2dicom.h

index e241166e05359b664b760a5c7a0d6b6ddb05c6a7..0c8dbe526c1a7107e77be1f9026dabbb3d92e58b 100644 (file)
@@ -1554,6 +1554,93 @@ std::cout << "charImageOrientation  " <<
                              imageSet[imgNum].getTranslationVectorRPS2XYZ()[2]);
   
    file->InsertEntryString(charImagePosition,0x0020,0x0032, "DS");  //0020 0032 DS 3 Image Position (Patient) 
+   
+   
+   // Private creator
+   /*
+   
+0029|0010 [LO]   [Private Creator] [CREATIS HEADER ]
+0029|0011 [LO]   [Private Creator] [CREATIS for BRUKER to DICOM]
+0029|1031 [LO]   [] [4.0.7571167 ]
+0029|1032 [UL]   [] [1440000] =0x(15f900)
+
+> $$ Thu Jul 30 17:29:46 2009 CEST (UT+2h)  mwiart
+> $$ /opt/PV4.0/data/mwiart/nmr/dha80.Uw1/4/method
+> ##$Method=DtiEpi
+> ##$PVM_DwNDiffDir=3             % 3 directions
+> ##$PVM_DwNDiffExpEach=2         % 2 valeurs de b par direction
+> ##$PVM_DwAoImages=1             % 1 image pour b=0
+> ##$PVM_DwBvalEach=( 2 )         % Valeurs de b
+> 1500.000000 3000.000000
+>
+> $$ Wed Dec  2 09:56:01 2009 UTC (UT+0h)  mwiart
+> $$ /opt/Pv5.0/data/mwiart/nmr/ECI7.Wx1/4/method
+> ##$Method=DtiEpi
+> ##$PVM_DwNDiffDir=3             % 3 directions
+> ##$PVM_DwNDiffExpEach=2         % 2 valeurs de b par direction
+> ##$PVM_DwAoImages=1             % 1 image pour b=0
+> ##$PVM_DwBvalEach=( 2 )         % Valeurs de b
+> 1500 3000
+>
+> $$ Wed Dec  2 10:14:27 2009 UTC (UT+0h)  mwiart
+> $$ /opt/Pv5.0/data/mwiart/nmr/ECI7.Wx1/5/method
+> ##$Method=DtiStandard
+> ##$PVM_DwNDiffDir=1             % 1 direction
+> ##$PVM_DwNDiffExpEach=2         % 2 valeurs de b
+> ##$PVM_DwAoImages=0             % 0 image pour b=0
+> ##$PVM_DwBvalEach=( 2 )         % Valeurs de b
+> 138 1600
+>
+   */
+   
+   file->InsertEntryString("CREATIS HEADER", 0x0029,0x0010, "LO");
+   file->InsertEntryString("CREATIS FOR BRUKER-TO-DICOM", 0x0029,0x0011, "LO");
+   
+   BrukerFieldData brf_method = br_method.GetFieldData("Method");
+   const std::vector<std::string> method = brf_method.GetStringValue();
+
+  // std::string method = br_method.GetFieldData("Method").GetStringValue();    
+   file->InsertEntryString(method[0], 0x0029,0x0100, "LO");
+   
+   std::cout << " method[" << method[0]  << "]" << std::endl;
+   if (method[0] == "DtiEpi" || method[0] == "DtiStandard")
+   {
+     // const std::vector<int> NDiffDir       = br_method.GetFieldData("PVM_DwNDiffDir").GetIntValue();
+      BrukerFieldData brf_NDiffDir = br_method.GetFieldData("PVM_DwNDiffDir");
+      const std::vector<int> NDiffDir = brf_NDiffDir.GetIntValue();
+      
+      //const std::vector<int> NDiffExpEach   = br_method.GetFieldData("PVM_DwNDiffExpEach").GetIntValue();
+      BrukerFieldData brf_NDiffExpEach   = br_method.GetFieldData("PVM_DwNDiffExpEach");
+      const std::vector<int> NDiffExpEach   =brf_NDiffExpEach.GetIntValue();
+      
+//      const std::vector<int> AoImages     = br_method.GetFieldData("PVM_DwAoImages").GetIntValue();
+      BrukerFieldData brf_AoImages     = br_method.GetFieldData("PVM_DwAoImages");
+      const std::vector<int> AoImages     = brf_AoImages.GetIntValue();
+      
+      BrukerFieldData brf_DwBvalEach    = br_method.GetFieldData("PVM_DwBvalEach");
+      const std::vector<double> DwBvalEach = brf_DwBvalEach.GetDoubleValue();
+      
+ std::cout << "nb directions : " <<  NDiffDir[0] << " nb valeurs de b par direction : " << NDiffExpEach[0] 
+           << " nb images for b=0 : " << AoImages[0] << std::endl;
+          
+       str.str(""); 
+       str << NDiffDir[0];
+       file->InsertEntryString(str.str(),0x0029,0x0101,"US"); // directions
+       str.str(""); 
+       str << NDiffExpEach[0];
+       file->InsertEntryString(str.str(),0x0029,0x0102,"US"); // valeurs de b par direction       
+       str.str(""); 
+       str << AoImages[0];
+       file->InsertEntryString(str.str(),0x0029,0x0103,"US"); // image pour b=0
+
+       str.str("");
+       for (unsigned int i=0; i<NDiffExpEach[0]; i++) {
+          str << DwBvalEach[i];
+          if (i!=AoImages[0])
+             str << "\\";
+      }
+      file->InsertEntryString(str.str(),0x0029,0x0104,"DS"); // Valeurs de b          
+   }   
 
 // 0020 0x1041 DS 1 Slice Location 
 //        sprintf(charImagePosition,"%f",float(imgNum));
index 31460269e3a3c471d49e93eef4abca7a8cd693ce..6d6b9d4da889dc5f05a6db5a87550352c57ad1d6 100644 (file)
@@ -86,7 +86,6 @@ void dealWithCarto(GDCM_NAME_SPACE::DirListType &fileNames, int NX, int NY, int
                    double fovX, double fovY, double sliceDistance,
                    char *copyFile, std::string &currentOutputDirName, 
                   char *outputMhdFileName, char *output2dseqCartoName);
-
 public:
 
 // these ones are for debugging only