}
//--------------------------------------------------------------------
-//--------------------------------------------------------------------
-// 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<gdcm::File> 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)
{
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] << " ";