]> Creatis software - clitk.git/commitdiff
Allow to convert/write uint image (dose from eclipse)
authorDavid Sarrut <david.sarrut@creatis.insa-lyon.fr>
Wed, 26 Jun 2013 14:46:51 +0000 (16:46 +0200)
committerDavid Sarrut <david.sarrut@creatis.insa-lyon.fr>
Wed, 26 Jun 2013 14:46:51 +0000 (16:46 +0200)
common/vvImageWriter.txx
tools/clitkDicom2Image.cxx

index 0705197fd49b4f4d1394eb864c2175e2681464f2..81e45ee03b91344b0f60f7829b1aa0c2ac5997bd 100644 (file)
@@ -38,6 +38,8 @@ void vvImageWriter::UpdateWithDim(std::string OutputPixelType)
     UpdateWithDimAndOutputPixelType<unsigned char,VImageDimension>();
   } else if (OutputPixelType == "int") {
     UpdateWithDimAndOutputPixelType<int,VImageDimension>();
+  } else if (OutputPixelType == "unsigned_int") {
+    UpdateWithDimAndOutputPixelType<unsigned int,VImageDimension>();
   } else if (OutputPixelType == "double") {
     UpdateWithDimAndOutputPixelType<double,VImageDimension>();
   } else if (OutputPixelType == "float") {
index c7b2e23f076420ecac828eba3bde2a5aa541dd0e..6f36bc07d2062dcb0c0cfe6db136bb97c9d8d3f8 100644 (file)
@@ -82,12 +82,13 @@ int main(int argc, char * argv[])
     
     gdcm::Attribute<0x28, 0x100> pixel_size;
     pixel_size.SetFromDataSet(ds);
-    if (pixel_size.GetValue() != 16)
-    {
-      std::cerr << "Pixel type 2 bytes ! " << std::endl;
-      std::cerr << "In file " << input_files[i] << std::endl;
-      exit(0);
-    }
+    /* if (pixel_size.GetValue() != 16)
+       {
+       std::cerr << "Pixel type not 2 bytes ! " << std::endl;
+       std::cerr << "In file " << input_files[i] << std::endl;
+       exit(0);
+       }
+    */
 #else
     if (args_info.verbose_flag)
       std::cout << "Not using GDCM-2.x" << std::endl;
@@ -107,11 +108,12 @@ int main(int argc, char * argv[])
   theorigin[series_number][2] = header->GetZOrigin();
   sliceLocations[series_number].push_back(theorigin[series_number][2]);
   seriesFiles[series_number].push_back(input_files[i]);
-  if (header->GetPixelSize() != 2) {
+  /*if (header->GetPixelSize() != 2) {
     std::cerr << "Pixel type 2 bytes ! " << std::endl;
     std::cerr << "In file " << input_files[i] << std::endl;
     exit(0);
   }
+  */
 #endif
   }
 
@@ -205,6 +207,7 @@ int main(int argc, char * argv[])
       name << *sn << "_" << args_info.output_arg;
       outfile = name.str();
     }
+    DD("before write");
     vvImageWriter::Pointer writer = vvImageWriter::New();
     writer->SetInput(image);
     writer->SetOutputFileName(outfile);