X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FclitkImageCommon.cxx;h=9193160096169859f7a670bd8363eb1e44813669;hb=73f0ab806cbb168db4d09908a714f8b7a662ee21;hp=4c66654cc11ad1e1e2ddd271c2910bc2a97ad004;hpb=765020625fbc092d283e221e36c83e60a1844cb7;p=clitk.git diff --git a/common/clitkImageCommon.cxx b/common/clitkImageCommon.cxx index 4c66654..9193160 100644 --- a/common/clitkImageCommon.cxx +++ b/common/clitkImageCommon.cxx @@ -58,30 +58,6 @@ void clitk::ReadImageDimensionAndPixelType(const std::string & filename, } //-------------------------------------------------------------------- -//-------------------------------------------------------------------- -// Read a dicom header -gdcm::File * clitk::readDicomHeader(const std::string & filename, - const bool verbose) -{ -#if GDCM_MAJOR_VERSION == 2 - gdcm::Reader hreader; - hreader.SetFileName(filename.c_str()); - hreader.Read(); - gdcm::SmartPointer p = hreader.GetFile(); - return p; -#else - if (verbose) { - std::cout << "Reading DICOM <" << filename << ">" << std::endl; - } - gdcm::File *header = new gdcm::File(); - header->SetFileName(filename); - header->SetMaxSizeLoadEntry(16384); // required ? - header->Load(); - return header; -#endif -} -///-------------------------------------------------------------------- - //-------------------------------------------------------------------- itk::ImageIOBase::Pointer clitk::readImageHeader(const std::string & filename, bool exit_on_error) { @@ -90,7 +66,7 @@ itk::ImageIOBase::Pointer clitk::readImageHeader(const std::string & filename, b if (!reader) { if (exit_on_error) { //default behavior for tools who don't handle the problem clitkExceptionMacro("Error reading file " << filename << ", exiting immediately"); - } else return NULL; + } else return (itk::ImageIOBase *) ITK_NULLPTR; } reader->SetFileName(filename); reader->ReadImageInformation(); @@ -125,11 +101,11 @@ void clitk::printImageHeader(itk::ImageIOBase::Pointer header, std::ostream & os for(unsigned int i=0; i< dim-1; i++) os << inputSize[i] << "x"; os << inputSize[dim-1] - << " "; + << " "; for(unsigned int i=0; i< dim-1; i++) os << inputSpacing[i] << "x"; os << inputSpacing[dim-1] - << " "; + << " "; for(unsigned int i=0; i< dim-1; i++) os << inputOrigin[i] << "x"; os << inputOrigin[dim-1] << " ";