Program: gdcm
Module: $RCSfile: gdcmDocEntry.cxx,v $
Language: C++
- Date: $Date: 2004/11/09 22:15:36 $
- Version: $Revision: 1.30 $
+ Date: $Date: 2004/11/10 18:27:23 $
+ Version: $Revision: 1.31 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
DicomDict = in;
SetKey( in->GetKey( ) );
Offset = 0 ; // To avoid further missprinting
+
+ // init some variables
+ ReadLength = 0;
+ UsableLength = 0;
+ PrintLevel = 0;
}
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2004/11/10 16:13:18 $
- Version: $Revision: 1.120 $
+ Date: $Date: 2004/11/10 18:27:23 $
+ Version: $Revision: 1.121 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
SetMaxSizeLoadEntry(MAX_SIZE_LOAD_ELEMENT_VALUE);
Initialise();
+ SwapCode = 0;
+ Filetype = ExplicitVR;
PrintLevel = 1; // 'Medium' print level by default
}
*/
std::ifstream* Document::OpenFile()
{
+ if (Filename.length() == 0) return 0;
if(Fp)
{
dbg.Verbose( 0,
Program: gdcm
Module: $RCSfile: gdcmFile.cxx,v $
Language: C++
- Date: $Date: 2004/11/05 21:23:46 $
- Version: $Revision: 1.152 $
+ Date: $Date: 2004/11/10 18:27:23 $
+ Version: $Revision: 1.153 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// The decompressed image migth not be loaded yet:
std::ifstream* fp = HeaderInternal->OpenFile();
PixelConverter->ReadAndDecompressPixelData( fp );
- HeaderInternal->CloseFile();
+ if(fp) HeaderInternal->CloseFile();
decompressed = PixelConverter->GetDecompressed();
if ( ! decompressed )
{
Program: gdcm
Module: $RCSfile: gdcmHeader.cxx,v $
Language: C++
- Date: $Date: 2004/11/09 21:55:55 $
- Version: $Revision: 1.199 $
+ Date: $Date: 2004/11/10 18:27:23 $
+ Version: $Revision: 1.200 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// we assume slices join together
// (no overlapping, no interslice gap)
// if they don't, we're fucked up
- return atof( strSliceThickness.c_str() );
+ return (float)atof( strSliceThickness.c_str() );
}
}
else
{
- return atof( strSpacingBSlices.c_str() );
+ return (float)atof( strSpacingBSlices.c_str() );
}
}
Program: gdcm
Module: $RCSfile: gdcmPixelConvert.cxx,v $
Language: C++
- Date: $Date: 2004/11/10 16:22:02 $
- Version: $Revision: 1.28 $
+ Date: $Date: 2004/11/10 18:27:23 $
+ Version: $Revision: 1.29 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
}
}
- header->CloseFile();
+ if(fp) header->CloseFile();
}
/**
Program: gdcm
Module: $RCSfile: gdcmSQItem.cxx,v $
Language: C++
- Date: $Date: 2004/11/04 15:08:50 $
- Version: $Revision: 1.35 $
+ Date: $Date: 2004/11/10 18:27:23 $
+ Version: $Revision: 1.36 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
binary_write( *fp, item[j]); // fffe e000 ffff ffff
}
- for (ListDocEntry::iterator i = DocEntries.begin();
- i != DocEntries.end();
- ++i)
+ for (ListDocEntry::iterator it = DocEntries.begin();
+ it != DocEntries.end();
+ ++it)
{
// we skip delimitors (start and end one) because
// we force them as 'no length'
- if ( (*i)->GetGroup() == 0xfffe )
+ if ( (*it)->GetGroup() == 0xfffe )
{
continue;
}
// Fix in order to make some MR PHILIPS images e-film readable
// see gdcmData/gdcm-MR-PHILIPS-16-Multi-Seq.dcm:
// we just *always* ignore spurious fffe|0000 tag !
- if ( (*i)->GetGroup() == 0xfffe && (*i)->GetElement() == 0x0000 )
+ if ( (*it)->GetGroup() == 0xfffe && (*it)->GetElement() == 0x0000 )
{
break; // FIXME : continue; ?!?
}
- (*i)->Write(fp, filetype);
+ (*it)->Write(fp, filetype);
}
//we force the writting of an 'Item Delimitation' item
Program: gdcm
Module: $RCSfile: gdcmUtil.cxx,v $
Language: C++
- Date: $Date: 2004/11/05 20:23:14 $
- Version: $Revision: 1.60 $
+ Date: $Date: 2004/11/10 18:27:24 $
+ Version: $Revision: 1.61 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmUtil.h"
#include "gdcmDebug.h"
+// For GetCurrentDate, GetCurrentTime
+#include <time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
#include <stdarg.h> //only included in implementation file
#include <stdio.h> //only included in implementation file
return r;
}
+/**
+ * \ingroup Util
+ * \brief Get the current date of the system in a dicom string
+ */
+std::string Util::GetCurrentDate()
+{
+ char tmp[512];
+ time_t tloc;
+ time (&tloc);
+ strftime(tmp,512,"%Y%m%d", localtime(&tloc) );
+ return tmp;
+}
+
+/**
+ * \ingroup Util
+ * \brief Get the current time of the system in a dicom string
+ */
+std::string Util::GetCurrentTime()
+{
+ char tmp[512];
+ time_t tloc;
+ time (&tloc);
+ strftime(tmp,512,"%H%M%S", localtime(&tloc) );
+ return tmp;
+}
+
+
+
/**
* \ingroup Util
* \brief Create a /DICOM/ string:
Program: gdcm
Module: $RCSfile: gdcmUtil.h,v $
Language: C++
- Date: $Date: 2004/11/09 11:21:32 $
- Version: $Revision: 1.41 $
+ Date: $Date: 2004/11/10 18:27:24 $
+ Version: $Revision: 1.42 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
static std::string NormalizePath(std::string const & name);
static std::string GetPath(std::string const &fullName);
static std::string GetName(std::string const &fullName);
+ static std::string GetCurrentDate();
+ static std::string GetCurrentTime();
static std::string DicomString(const char* s, size_t l);
static std::string DicomString(const char* s);