Program: gdcm
Module: $RCSfile: gdcmDataEntry.cxx,v $
Language: C++
- Date: $Date: 2005/11/21 09:46:24 $
- Version: $Revision: 1.22 $
+ Date: $Date: 2005/11/21 12:15:06 $
+ 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
return GetLength()/sizeof(uint16_t);
else if( vr == "UL" || vr == "SL" )
return GetLength()/sizeof(uint32_t);
- else if( vr == "FL" )
- return GetLength()/sizeof(float);
+ else if( vr == "FL" || vr == "OF" )
+ return GetLength()/4 ; // FL has a *4* length! sizeof(float);
else if( vr == "FD" )
- return GetLength()/sizeof(double);
+ return GetLength()/8; // FD has a *8* length! sizeof(double);
else if( Global::GetVR()->IsVROfStringRepresentable(vr) )
{
// Some element in DICOM are allowed to be empty
- if( !GetLength() ) return 0;
+ if( !GetLength() )
+ return 0;
// Don't use std::string to accelerate processing
uint32_t count = 1;
for(uint32_t i=0;i<GetLength();i++)
}
return count;
}
-
return GetLength();
}
/**
Program: gdcm
Module: $RCSfile: gdcmDocEntry.cxx,v $
Language: C++
- Date: $Date: 2005/11/03 08:47:51 $
- Version: $Revision: 1.77 $
+ Date: $Date: 2005/11/21 12:15:06 $
+ Version: $Revision: 1.78 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
else
{
binary_write(*fp, vr.str());
-
- if ( (vr == "OB") || (vr == "OW") || (vr == "SQ") /*|| (vr == "UN")*/ )
-// FIXME : what is the status of VR = "UN"
-// --> uncomment or remove comment !
+
+ // See PS 3.5-2004 page 33, 36
+ if ( (vr == "SQ") || (vr == "OB") || (vr == "OW") || (vr == "OF")
+ || (vr == "UN") || (vr == "UT") )
{
binary_write(*fp, zero);
if (vr == "SQ")
Program: gdcm
Module: $RCSfile: gdcmVR.cxx,v $
Language: C++
- Date: $Date: 2005/10/26 08:04:16 $
- Version: $Revision: 1.47 $
+ Date: $Date: 2005/11/21 12:15:06 $
+ Version: $Revision: 1.48 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
*/
bool VR::IsVROfStringRepresentable(VRKey const &tested)
{
- //FIXME : either you consider than US, UL, SS, SL *are* string representable
- // and you have to add FD and FL
- // or you consider they are not, and you have to remove them
- // (I cannot guess your point, reading gdcmDataEntry code :-( ) JPR
-
+/*
return tested == "AE" ||
tested == "AS" ||
tested == "CS" ||
tested == "DA" ||
tested == "DS" ||
+ tested == "FL" ||
+ tested == "FD" ||
tested == "IS" ||
tested == "LO" ||
tested == "LT" ||
tested == "UL" ||
tested == "US" ||
tested == "UT";
+*/
+ // Should be quicker
- // Should be quicker --> But it doesn't work : revert to old code
-/*
- return tested != "FL" &&
- tested != "FD" &&
- tested != "OB" &&
+ return tested != "OB" &&
tested != "OW" &&
- tested != "AT" && // Attribute Tag ?!?
+ tested != "OF" &&
+ tested != "AT" && // Attribute Tag ?!? contain no printable character
tested != "UN" && // UN is an actual VR !
tested != "SQ" ;
-*/
}
/// \brief returns the length of a elementary elem whose VR is passed
unsigned short VR::GetAtomicElementLength(VRKey const &tested)
// Word string
if( tested == "OW" )
return 2;
+ // Float string
+ if( tested == "OF" )
+ return 4;
return 1;
}