]> Creatis software - gdcm.git/blobdiff - Example/PcpdenseToDicom.cxx
upgrades for 4DSplitter
[gdcm.git] / Example / PcpdenseToDicom.cxx
index 359ad62e1398e98a6b15571b6a591ce154165926..a31c050bc51e6a34a3b91da865010e5bf60f9832 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: PcpdenseToDicom.cxx,v $
   Language:  C++
-  Date:      $Date: 2008/09/04 14:10:44 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2011/03/29 07:35:57 $
+  Version:   $Revision: 1.7 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -37,8 +37,8 @@
   * Hope they don't change soon!
   */  
 
-void MakeDicomImage(unsigned short int *tabVal, int X, int Y, std::string dcmImageName,
-                    const char * patientname, int nbFrames, std::string studyUID, std::string serieUID, std::string studyUID, int imgNum,bool m );
+void MakeDicomImage(unsigned short int *tabVal, int X, int Y, std::string dcmImageName, const char * patientName, int nbFrames,
+                    std::string studyUID, std::string serieUID, std::string SerieDescr, int imgNum, bool m );
 
 void LoadImage(std::ifstream &from,  unsigned short int * );
 
@@ -48,10 +48,10 @@ bool verbose;
 int main(int argc, char *argv[])
 {
    START_USAGE(usage)
-   " \n pcpdenseToDicom :\n                                                  ",
+   " \n pcpdenseToDicom :\n                                                   ",
    "        Converts the '.txt' files into 16 bits Dicom Files,               ",
    " usage:                                                                   ",
-   " pcpdenseToDicom rootfilename=...                                        ",
+   " pcpdenseToDicom rootfilename=...                                         ",
    "                 (e.g.. :   meas_MID380_DENSE_stacked_slices_aif_FID81637)",
    "                 numberOfSlices =  (default : 3)                          ",
    "                 X2 : multiply x 2 image size                             ",
@@ -154,7 +154,9 @@ int main(int argc, char *argv[])
    // === Ecc ===
    
    strSerieUID =  GDCM_NAME_SPACE::Util::CreateUniqueUID();
+
+   serieDescr = "Ecc";
+
    if (!multiframe) {
              
      for (int i=0; i<numberOfSlices; i++)
@@ -218,6 +220,7 @@ int main(int argc, char *argv[])
 
    strSerieUID =  GDCM_NAME_SPACE::Util::CreateUniqueUID();
 
+   serieDescr = "perf";
    if (!multiframe) {    
      for (int i=0; i<numberOfSlices; i++)
      {      
@@ -278,6 +281,8 @@ int main(int argc, char *argv[])
 
 
    strSerieUID =  GDCM_NAME_SPACE::Util::CreateUniqueUID();
+
+   serieDescr = "WashoutTc";
    
    if (multiframe) {    
      for (int i=0; i<numberOfSlices; i++)
@@ -333,7 +338,7 @@ int main(int argc, char *argv[])
 
   }
 
-   delete []image;      
+   delete []image;
    return 1;            
 }
 
@@ -368,7 +373,7 @@ XY Dimensions           47          50
      for( i=0;i<NY;i++)
         for(j=0;j<NX;j++) {
            from >> pixelValue;
-           image[i*NX+j] = (unsigned short int)(pixelValue * 1000.)
+           image[i*NX+j] = (unsigned short int)(pixelValue * 1000.); // Why do we multiply by 1000? // JPR
         }
 }
 
@@ -404,7 +409,7 @@ XY Dimensions           47          50
      for( i=0;i<NY;i++) {
            for(j=0;j<NX;j++) {
               from >> pixelValue;
-              pixelValue*=1000.;
+              pixelValue*=1000.;  // Why do we multiply by 1000? // JPR
               image[i*4*NX + j*2] = image[i*4*NX + j*2+1] =  image[(i*4+2)*NX + j*2] =  image[(i*4+2)*NX + j*2+1] = (unsigned short int)(pixelValue);  
    }
         }