X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=common%2FclitkImageCommon.cxx;h=9193160096169859f7a670bd8363eb1e44813669;hb=d55f025b18f68066a52b8f33c2dc6481e82c2580;hp=9367257f9c7a03e38a7174314a8c76e834fd41cc;hpb=c7f6f682ddc01d2a41740bbdb806f9ef967b57d5;p=clitk.git diff --git a/common/clitkImageCommon.cxx b/common/clitkImageCommon.cxx index 9367257..9193160 100644 --- a/common/clitkImageCommon.cxx +++ b/common/clitkImageCommon.cxx @@ -3,7 +3,7 @@ Authors belong to: - University of LYON http://www.universite-lyon.fr/ - - Léon Bérard cancer center http://oncora1.lyon.fnclcc.fr + - Léon Bérard cancer center http://www.centreleonberard.fr - CREATIS CNRS laboratory http://www.creatis.insa-lyon.fr This software is distributed WITHOUT ANY WARRANTY; without even @@ -14,12 +14,13 @@ - BSD See included LICENSE.txt file - CeCILL-B http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html - ======================================================================-====*/ + ===========================================================================**/ #ifndef CLITKIMAGECOMMON_CXX #define CLITKIMAGECOMMON_CXX #include "clitkImageCommon.h" +#include "clitkCommon.h" //-------------------------------------------------------------------- void clitk::ReadImageDimensionAndPixelType(const std::string & filename, @@ -57,22 +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 (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; -} -///-------------------------------------------------------------------- - //-------------------------------------------------------------------- itk::ImageIOBase::Pointer clitk::readImageHeader(const std::string & filename, bool exit_on_error) { @@ -81,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(); @@ -116,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] << " ";