]> Creatis software - clitk.git/blobdiff - common/clitkImageCommon.cxx
initial entry
[clitk.git] / common / clitkImageCommon.cxx
index 03aa9b6a5d687469e179fe5ddc37d4c86189d3ca..9386ecdda27c4998a8d631328754046054ce6e46 100644 (file)
@@ -38,7 +38,7 @@ void clitk::ReadImageDimensionAndPixelType(const std::string & filename,
   itk::ImageIOBase::Pointer genericReader =
     itk::ImageIOFactory::CreateImageIO(filename.c_str(), itk::ImageIOFactory::ReadMode);
   if (!genericReader) {
-    std::cerr << "Image file format unknown while reading " << filename << std::endl;
+    std::cerr << "Image file format unknown while reading file <" << filename << ">" << std::endl;
     exit(0);
   }
   genericReader->SetFileName(filename.c_str());
@@ -69,7 +69,7 @@ void clitk::ReadImageDimensionAndPixelType(const std::string & filename,
 //--------------------------------------------------------------------
 
 //--------------------------------------------------------------------
-// Read a dicom header
+/* Read a dicom header
 gdcm::File * clitk::readDicomHeader(const std::string & filename,
                                     const bool verbose)
 {
@@ -82,7 +82,7 @@ gdcm::File * clitk::readDicomHeader(const std::string & filename,
   header->Load();
   return header;
 }
-//--------------------------------------------------------------------
+*///--------------------------------------------------------------------
 
 //--------------------------------------------------------------------
 itk::ImageIOBase::Pointer clitk::readImageHeader(const std::string & filename, bool exit_on_error)
@@ -137,6 +137,7 @@ void clitk::printImageHeader(itk::ImageIOBase::Pointer header, std::ostream & os
     for(unsigned int i=0; i< dim-1; i++)
       os << inputOrigin[i] << "x";
     os << inputOrigin[dim-1] << " ";
+    os << header->GetImageSizeInPixels() << " ";
   } else {
     os << "Dim       = " << dim << "D" << std::endl;
     os << "PixelType = " << pixelTypeName << std::endl;