ptrMeta= GetDicomDirMeta();
for(i=ptrMeta->debut();i!=ptrMeta->fin();++i) {
- WriteEntry(*i,_fp, ExplicitVR);
+ WriteEntry(*i,_fp, gdcmExplicitVR);
}
itPatient = GetDicomDirPatients().begin();
while ( itPatient != GetDicomDirPatients().end() ) {
for(i=(*itPatient)->debut();i!=(*itPatient)->fin();++i) {
- WriteEntry(*i,_fp, ExplicitVR);
+ WriteEntry(*i,_fp, gdcmExplicitVR);
}
itStudy = ((*itPatient)->GetDicomDirStudies()).begin();
while (itStudy != (*itPatient)->GetDicomDirStudies().end() ) {
for(i=(*itStudy)->debut();i!=(*itStudy)->fin();++i) {
- WriteEntry(*i,_fp, ExplicitVR);
+ WriteEntry(*i,_fp, gdcmExplicitVR);
}
itSerie = ((*itStudy)->GetDicomDirSeries()).begin();
while (itSerie != (*itStudy)->GetDicomDirSeries().end() ) {
for(i=(*itSerie)->debut();i!=(*itSerie)->fin();++i) {
- WriteEntry(*i,_fp, ExplicitVR);
+ WriteEntry(*i,_fp, gdcmExplicitVR);
}
itImage = ((*itSerie)->GetDicomDirImages()).begin();
while (itImage != (*itSerie)->GetDicomDirImages().end() ) {
for(i=(*itImage)->debut();i!=(*itImage)->fin();++i) {
- WriteEntry(*i,_fp, ExplicitVR);
+ WriteEntry(*i,_fp, gdcmExplicitVR);
}
++itImage;
}
*/
bool gdcmFile::WriteDcmImplVR (std::string fileName) {
- return WriteBase(fileName, ImplicitVR);
+ return WriteBase(fileName, gdcmImplicitVR);
}
/**
*/
bool gdcmFile::WriteDcmExplVR (std::string fileName) {
- return WriteBase(fileName, ExplicitVR);
+ return WriteBase(fileName, gdcmExplicitVR);
}
/**
*/
bool gdcmFile::WriteAcr (std::string fileName) {
- return WriteBase(fileName, ACR);
+ return WriteBase(fileName, gdcmACR);
}
//-----------------------------------------------------------------------------
FILE *fp1;
- if (PixelRead==-1 && type != ExplicitVR) {
+ if (PixelRead==-1 && type != gdcmExplicitVR) {
return false;
}
return (false);
}
- if ( (type == ImplicitVR) || (type == ExplicitVR) ) {
+ if ( (type == gdcmImplicitVR) || (type == gdcmExplicitVR) ) {
char *filePreamble;
// writing Dicom File Preamble
filePreamble=new char[128];
/// but pb expected if user deals with, e.g. COMPLEX images
std::string rows, columns;
- if ( Header->GetFileType() == ACR_LIBIDO){
+ if ( Header->GetFileType() == gdcmACR_LIBIDO){
rows = Header->GetEntryByNumber(0x0028, 0x0010);
columns = Header->GetEntryByNumber(0x0028, 0x0011);
Header->SetEntryByNumber(columns, 0x0028, 0x0010);
// ...and we restore the Header to be Dicom Compliant again
// just after writting
- if (Header->GetFileType() == ACR_LIBIDO){
+ if (Header->GetFileType() == gdcmACR_LIBIDO){
Header->SetEntryByNumber(rows , 0x0028, 0x0010);
Header->SetEntryByNumber(columns, 0x0028, 0x0011);
}
* false otherwise.
*/
bool gdcmParser::IsReadable(void) {
- if(filetype==Unknown) {
+ if(filetype==gdcmUnknown) {
return(false);
}
if(listEntries.size()<=0) {
/**
* \brief returns the File Type
- * (ACR, ACR_LIBIDO, ExplicitVR, ImplicitVR, Unknown)
+ * (ACR, ACR_LIBIDO, ExplicitVR, ImplicitVR, Unfound)
* @return the FileType code
*/
FileType gdcmParser::GetFileType(void) {
/// a moins de se livrer a un tres complique ajout des champs manquants.
/// faire un CheckAndCorrectHeader (?)
- if (type == ImplicitVR)
+ if (type == gdcmImplicitVR)
{
std::string implicitVRTransfertSyntax = UI1_2_840_10008_1_2;
ReplaceOrCreateByNumber(implicitVRTransfertSyntax,0x0002, 0x0010);
SetEntryLengthByNumber(18, 0x0002, 0x0010);
}
- if (type == ExplicitVR)
+ if (type == gdcmExplicitVR)
{
std::string explicitVRTransfertSyntax = UI1_2_840_10008_1_2_1;
ReplaceOrCreateByNumber(explicitVRTransfertSyntax,0x0002, 0x0010);
}
else // any elem but the first
{
- if (type == ExplicitVR)
+ if (type == gdcmExplicitVR)
{
if ( (vr == "OB") || (vr == "OW") || (vr == "SQ") )
{
fwrite ( &group,(size_t)2 ,(size_t)1 ,_fp); //group
fwrite ( &el,(size_t)2 ,(size_t)1 ,_fp); //element
- if ( type == ExplicitVR ) {
+ if ( type == gdcmExplicitVR ) {
// Special case of delimiters:
if (group == 0xfffe) {
guint16 z=0;
guint16 shortLgr = lgr;
- if (vr == "unkn") { // Unknown was 'written'
+ if (vr == "unkn") { // Unfound was 'written'
// deal with Little Endian
fwrite ( &shortLgr,(size_t)2 ,(size_t)1 ,_fp);
fwrite ( &z, (size_t)2 ,(size_t)1 ,_fp);
tag2 != listEntries.end();
++tag2)
{
- if ( type == ACR ){
+ if ( type == gdcmACR ){
if ((*tag2)->GetGroup() < 0x0008)
// Ignore pure DICOM V3 groups
continue;
for (TagHeaderEntryHT::iterator tag2=tagHT.begin();
tag2 != tagHT.end();
++tag2){
- if ( type == ACR ){
+ if ( type == gdcmACR ){
if ((*tag2->second).GetGroup() < 0x0008) continue; // ignore pure DICOM V3 groups
if ((*tag2->second).GetElement() %2) continue; // ignore shadow groups
if ((*tag2->second).GetVR() == "SQ" ) continue; // ignore Sequences
RecCode == "CANRME_AILIBOD1_1." ) // for brain-damaged softwares
// with "little-endian strings"
{
- filetype = ACR_LIBIDO;
+ filetype = gdcmACR_LIBIDO;
std::string rows = GetEntryByNumber(0x0028, 0x0010);
std::string columns = GetEntryByNumber(0x0028, 0x0011);
SetEntryByNumber(columns, 0x0028, 0x0010);
guint16 length16;
- if ( (filetype == ExplicitVR) && (! Entry->IsImplicitVR()) )
+ if ( (filetype == gdcmExplicitVR) && (! Entry->IsImplicitVR()) )
{
if ( (vr=="OB") || (vr=="OW") || (vr=="SQ") || (vr=="UN") )
{
//dbg.Verbose(0, "gdcmParser::FindLength",
// "Erroneous element length fixed.");
// Actually, length= 0xffff means that we deal with
- // Unknown Sequence Length
+ // Unfound Sequence Length
}
FixHeaderEntryFoundLength(Entry, (guint32)length16);
return;
*/
void gdcmParser::FindHeaderEntryVR( gdcmHeaderEntry *Entry)
{
- if (filetype != ExplicitVR)
+ if (filetype != gdcmExplicitVR)
return;
char VR[3];
// Use gdcmParser::dicom_vr to test all the possibilities
// instead of just checking for UL, OB and UI !? group 0000
{
- filetype = ExplicitVR;
+ filetype = gdcmExplicitVR;
dbg.Verbose(1, "gdcmParser::CheckSwap:",
"explicit Value Representation");
}
else
{
- filetype = ImplicitVR;
+ filetype = gdcmImplicitVR;
dbg.Verbose(1, "gdcmParser::CheckSwap:",
"not an explicit Value Representation");
}
switch (s32) {
case 0x00040000 :
sw = 3412;
- filetype = ACR;
+ filetype = gdcmACR;
return true;
case 0x04000000 :
sw = 4321;
- filetype = ACR;
+ filetype = gdcmACR;
return true;
case 0x00000400 :
sw = 2143;
- filetype = ACR;
+ filetype = gdcmACR;
return true;
case 0x00000004 :
sw = 0;
- filetype = ACR;
+ filetype = gdcmACR;
return true;
default :
// the file IS NOT ACR-NEMA nor DICOM V3
// Find a trick to tell it the caller...
- s16 = *((guint16 *)(deb));
-
- switch (s16) {
- case 0x0002 :
- case 0x0004 :
- case 0x0008 :
- sw = 0;
- filetype = ACR;
- return true;
- case 0x0200 :
- case 0x0400 :
- case 0x0800 :
- sw = 4321;
- filetype = ACR;
- return true;
- default :
- dbg.Verbose(0, "gdcmParser::CheckSwap:",
- "ACR/NEMA unfound swap info (Really hopeless !)");
- filetype = Unknown;
- return false;
- }
+ s16 = *((guint16 *)(deb));
+
+ switch (s16) {
+ case 0x0002 :
+ case 0x0004 :
+ case 0x0008 :
+ sw = 0;
+ filetype = gdcmACR;
+ return true;
+ case 0x0200 :
+ case 0x0400 :
+ case 0x0800 :
+ sw = 4321;
+ filetype = gdcmACR;
+ return true;
+ default :
+ dbg.Verbose(0, "gdcmParser::CheckSwap:",
+ "ACR/NEMA unfound swap info (Really hopeless !)");
+ filetype = gdcmUnknown;
+ return false;
+ }
// Then the only info we have is the net2host one.
//if (! net2host )