Program: gdcm
Module: $RCSfile: gdcmBinEntry.cxx,v $
Language: C++
- Date: $Date: 2004/08/31 14:24:47 $
- Version: $Revision: 1.23 $
+ Date: $Date: 2004/09/09 17:49:24 $
+ Version: $Revision: 1.24 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
PrintLevel = e->GetPrintLevel();
SQDepthLevel = e->GetDepthLevel();
- VoidArea = NULL; // let's be carefull !
+ VoidArea = 0; // let's be carefull !
}
/**
if (VoidArea)
{
free (VoidArea);
- VoidArea = NULL; // let's be carefull !
+ VoidArea = 0; // let's be carefull !
}
}
void *voidArea = GetVoidArea();
if (voidArea)
{
- s << " [gdcm::Binary data loaded with length is "
- << GetLength() << "]";
+ //s << " [" << GDCM_BINLOADED
+ s << " [" << GetValue()
+ << "; length = " << GetLength() << "]";
}
else
{
}
else
{
- s << " [gdcm::Binary data NOT loaded]";
+ //s << " [gdcm::Binary data NOT loaded]";
+ s << " [" <<GetValue() << "]";
}
}
// there is a 'non string' LUT, overlay, etc
fwrite ( voidArea,(size_t)lgr ,(size_t)1 ,fp); // Elem value
}
+ else
+ {
+ // nothing was loaded, but we need to skip space on disc
+ fseek(fp,(size_t)lgr,SEEK_CUR);
+ }
}
//-----------------------------------------------------------------------------
// Public
Program: gdcm
Module: $RCSfile: gdcmBinEntry.h,v $
Language: C++
- Date: $Date: 2004/09/03 20:27:44 $
- Version: $Revision: 1.14 $
+ Date: $Date: 2004/09/09 17:49:24 $
+ Version: $Revision: 1.15 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
~gdcmBinEntry();
void Print(std::ostream &os = std::cout);
- virtual void Write(FILE*, FileType);
+ void Write(FILE*, FileType);
/// \brief Returns the area value of the current Dicom Header Entry
/// when it's not string-translatable (e.g : a LUT table)
Program: gdcm
Module: $RCSfile: gdcmCommon.h,v $
Language: C++
- Date: $Date: 2004/07/19 11:51:26 $
- Version: $Revision: 1.29 $
+ Date: $Date: 2004/09/09 17:49:24 $
+ Version: $Revision: 1.30 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include <string>
-const std::string GDCM_UNFOUND = "gdcm::Unfound"; /// MEMORY LEAK
+const std::string GDCM_UNFOUND = "gdcm::Unfound"; /// MEMORY LEAK
+const std::string GDCM_BINLOADED = "gdcm::Binary data loaded";
+const std::string GDCM_NOTLOADED = "gdcm::NotLoaded";
+const std::string GDCM_UNREAD = "gdcm::UnRead";
typedef std::string gdcmTagKey;
typedef std::string TagName;
Program: gdcm
Module: $RCSfile: gdcmDocEntry.cxx,v $
Language: C++
- Date: $Date: 2004/09/03 15:09:30 $
- Version: $Revision: 1.17 $
+ Date: $Date: 2004/09/09 17:49:24 $
+ Version: $Revision: 1.18 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// Unknown was 'written'
// deal with Little Endian
fwrite ( &shortLgr,(size_t)2 ,(size_t)1 ,fp);
- fwrite ( &z, (size_t)2 ,(size_t)1 ,fp);
+ fwrite ( &z, (size_t)2 ,(size_t)1 ,fp);
}
else
{
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2004/09/07 13:57:04 $
- Version: $Revision: 1.71 $
+ Date: $Date: 2004/09/09 17:49:24 $
+ Version: $Revision: 1.72 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
if (length > MaxSizeLoadEntry)
{
if (gdcmBinEntry* binEntryPtr = dynamic_cast< gdcmBinEntry* >(entry) )
- {
- s << "gdcm::NotLoaded (BinEntry)";
+ {
+ //s << "gdcm::NotLoaded (BinEntry)";
+ s << GDCM_NOTLOADED;
s << " Address:" << (long)entry->GetOffset();
s << " Length:" << entry->GetLength();
s << " x(" << std::hex << entry->GetLength() << ")";
binEntryPtr->SetValue(s.str());
}
- // to be sure we are at the end of the value ...
- fseek(Fp, (long)entry->GetOffset()+(long)entry->GetLength(), SEEK_SET);
- // Following return introduced by JPR on version 1.25. Since the
- // treatement of a ValEntry is never executed (doh!) this means
- // we were lucky up to now because we NEVER encountered a ValEntry
- // whose length was bigger thant MaxSizeLoadEntry !? I can't believe
- // this could ever work...
- return; //FIXME FIXME FIXME FIXME JPR ????
-
// Be carefull : a BinEntry IS_A ValEntry ...
- if (gdcmValEntry* valEntryPtr = dynamic_cast< gdcmValEntry* >(entry) )
+ else if (gdcmValEntry* valEntryPtr = dynamic_cast< gdcmValEntry* >(entry) )
{
- s << "gdcm::NotLoaded. (ValEntry)";
+ // s << "gdcm::NotLoaded. (ValEntry)";
+ s << GDCM_NOTLOADED;
s << " Address:" << (long)entry->GetOffset();
s << " Length:" << entry->GetLength();
s << " x(" << std::hex << entry->GetLength() << ")";
valEntryPtr->SetValue(s.str());
}
+ else
+ {
+ // fusible
+ std::cout<< "MaxSizeLoadEntry exceeded, neither a BinEntry "
+ << "nor a ValEntry ?! Should never print that !" << std::endl;
+ }
+
// to be sure we are at the end of the value ...
fseek(Fp,(long)entry->GetOffset()+(long)entry->GetLength(),SEEK_SET);
-
return;
}
{
dbg.Verbose(1, "gdcmDocument::LoadDocEntry",
"unread element value");
- valEntry->SetValue("gdcm::UnRead");
+ valEntry->SetValue(GDCM_UNREAD);
return;
}
Program: gdcm
Module: $RCSfile: gdcmFile.cxx,v $
Language: C++
- Date: $Date: 2004/09/01 16:23:59 $
- Version: $Revision: 1.122 $
+ Date: $Date: 2004/09/09 17:49:25 $
+ Version: $Revision: 1.123 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
GetImageDataIntoVector(PixelData, ImageDataSize);
// Will be 7fe0, 0010 in standard case
GetHeader()->SetEntryVoidAreaByNumber( PixelData,
- GetHeader()->GetGrPixel(), GetHeader()->GetNumPixel());
+ GetHeader()->GetGrPixel(), GetHeader()->GetNumPixel());
+ // Now, the value is loaded.
+ GetHeader()->SetEntryByNumber( GDCM_BINLOADED,
+ GetHeader()->GetGrPixel(), GetHeader()->GetNumPixel());
}
PixelRead = 0; // no PixelRaw
// will be 7fe0, 0010 in standard cases
GetHeader()->SetEntryVoidAreaByNumber(PixelData,
GetHeader()->GetGrPixel(), GetHeader()->GetNumPixel());
+ // Now, the value is loaded.
+ GetHeader()->SetEntryByNumber( GDCM_BINLOADED,
+ GetHeader()->GetGrPixel(), GetHeader()->GetNumPixel());
}
PixelRead = 1; // PixelRaw
Program: gdcm
Module: $RCSfile: gdcmHeader.cxx,v $
Language: C++
- Date: $Date: 2004/09/01 16:23:59 $
- Version: $Revision: 1.183 $
+ Date: $Date: 2004/09/09 17:49:25 $
+ Version: $Revision: 1.184 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
*a = 1; // Alpha component
a += 4;
}
-
return LUTRGBA;
}
// use the gdcmTS (TS : Transfert Syntax)
std::string transfertSyntax = GetEntryByNumber(0x0002,0x0010);
+ if ( transfertSyntax == GDCM_NOTLOADED ) { // fusible
+ std::cout << "Transfert Syntax not loaded. " << std::endl
+ << "Better you increase MAX_SIZE_LOAD_ELEMENT_VALUE"
+ << std::endl;
+ return "Uncompressed ACR-NEMA";
+ }
if ( transfertSyntax == GDCM_UNFOUND )
{
dbg.Verbose(0, "gdcmHeader::GetTransfertSyntaxName:"
Program: gdcm
Module: $RCSfile: gdcmValEntry.cxx,v $
Language: C++
- Date: $Date: 2004/08/27 15:48:44 $
- Version: $Revision: 1.22 $
+ Date: $Date: 2004/09/09 17:49:25 $
+ Version: $Revision: 1.23 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
v = GetValue(); // not applicable for SQ ...
d2 = CreateCleanString(v); // replace non printable characters by '.'
if( (GetLength()<=MAX_SIZE_PRINT_ELEMENT_VALUE) ||
- (PrintLevel>=3) || (d2.find("gdcm::NotLoaded.") < d2.length()) )
+ //(PrintLevel>=3) || (d2.find("gdcm::NotLoaded.") < d2.length()) )
+ (PrintLevel>=3) || (d2.find(GDCM_NOTLOADED) < d2.length()) )
{
s << " [" << d2 << "]";
}