padding is made of...
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2004/07/19 05:59:12 $
- Version: $Revision: 1.54 $
+ Date: $Date: 2004/07/19 15:16:18 $
+ Version: $Revision: 1.55 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param SyntaxToCheck The transfert syntax we need to check against.
* @return True when SyntaxToCheck corresponds to the Transfer Syntax of
* the current document. False either when the document contains
- * no Transfer Syntax, or when the Tranfer Syntaxes don't match.
+ * no Transfer Syntax, or when the Tranfer Syntaxes doesn't match.
*/
bool gdcmDocument::IsGivenTransferSyntax(std::string const & syntaxToCheck)
{
}
// The entry might be present but not loaded (parsing and loading
- // happen at differente stages): try loading and proceed with check...
+ // happen at different stages): try loading and proceed with check...
LoadDocEntrySafe(entry);
if (gdcmValEntry* valEntry = dynamic_cast< gdcmValEntry* >(entry) )
{
transfer.erase(transfer.length()-1, 1);
}
if ( transfer == syntaxToCheck )
- //if( transfer.find( syntaxToCheck ) ) //should be faster
{
- int k =
- abort()
return true;
}
}
" ValEntry (try promotion first).");
return false;
}
- // Non even content must be padded with a space (020H).
+ // Non even content must be padded with a space (020H)...
if( content.length() % 2 )
{
- content += '\0';
+ content += '\0'; // ... therefore we padd with (000H) .!?!
}
valEntry->SetValue(content);
return false;
}
-/* Hope Binaray field length is *never* wrong
+/* Hope Binary field length is *never* wrong
if(lgth%2) // Non even length are padded with a space (020H).
{
lgth++;
Program: gdcm
Module: $RCSfile: gdcmHeader.cxx,v $
Language: C++
- Date: $Date: 2004/07/17 22:45:40 $
- Version: $Revision: 1.177 $
+ Date: $Date: 2004/07/19 15:16:18 $
+ Version: $Revision: 1.178 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
// use the gdcmTS (TS : Transfert Syntax)
std::string transfertSyntax = GetEntryByNumber(0x0002,0x0010);
+
if ( transfertSyntax == GDCM_UNFOUND )
{
dbg.Verbose(0, "gdcmHeader::GetTransfertSyntaxName:"
return "Uncompressed ACR-NEMA";
}
+ while ( ! isdigit(transfertSyntax[transfertSyntax.length()-1]) )
+ {
+ transfertSyntax.erase(transfertSyntax.length()-1, 1);
+ }
// we do it only when we need it
gdcmTS* ts = gdcmGlobal::GetTS();
std::string tsName = ts->GetValue( transfertSyntax );
Program: gdcm
Module: $RCSfile: gdcmTS.cxx,v $
Language: C++
- Date: $Date: 2004/07/19 11:51:26 $
- Version: $Revision: 1.22 $
+ Date: $Date: 2004/07/19 15:16:19 $
+ 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
std::ifstream from(filename.c_str());
dbg.Error(!from, "gdcmTS::gdcmTS: can't open dictionary",filename.c_str());
- //char buff[1024]; //not used
std::string key;
std::string name;
Program: gdcm
Module: $RCSfile: gdcmValEntry.cxx,v $
Language: C++
- Date: $Date: 2004/07/02 13:55:28 $
- Version: $Revision: 1.16 $
+ Date: $Date: 2004/07/19 15:16:19 $
+ Version: $Revision: 1.17 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
s << " [gdcm::too long for print (" << GetLength() << ") ]";
}
- // Display the UID value (instead of displaying only the rough code)
+ // Display the UID value (instead of displaying only the rough code)
+ // First 'clean' trailing character (space or zero)
if (g == 0x0002) { // Any more to be displayed ?
- if ( (e == 0x0010) || (e == 0x0002) )
+ if ( (e == 0x0010) || (e == 0x0002) ) {
+ if ( ! isdigit(v[v.length()-1]) )
+ v.erase(v.length()-1, 1);
s << " ==>\t[" << ts->GetValue(v) << "]";
+ }
} else {
if (g == 0x0008) {
- if ( (e == 0x0016) || (e == 0x1150) )
+ if ( (e == 0x0016) || (e == 0x1150) ) {
+ if ( ! isdigit(v[v.length()-1]) )
+ v.erase(v.length()-1, 1);
s << " ==>\t[" << ts->GetValue(v) << "]";
+ }
} else {
if (g == 0x0004) {
- if ( (e == 0x1510) || (e == 0x1512) )
+ if ( (e == 0x1510) || (e == 0x1512) ) {
+ if ( ! isdigit(v[v.length()-1]) )
+ v.erase(v.length()-1, 1);
s << " ==>\t[" << ts->GetValue(v) << "]";
+ }
}
}
}