* (ACR-NEMA, ExplicitVR, ImplicitVR)
* @param _fp already open file pointer
*/
* (ACR-NEMA, ExplicitVR, ImplicitVR)
* @param _fp already open file pointer
*/
shortLgr=lgr;
fwrite ( &shortLgr,(size_t)2 ,(size_t)1 ,_fp);
fwrite ( &z, (size_t)2 ,(size_t)1 ,_fp);
} else {
if (gr != 0xfffe) { // NO value for 'delimiters'
shortLgr=lgr;
fwrite ( &shortLgr,(size_t)2 ,(size_t)1 ,_fp);
fwrite ( &z, (size_t)2 ,(size_t)1 ,_fp);
} else {
if (gr != 0xfffe) { // NO value for 'delimiters'
fwrite(&z,(size_t)2 ,(size_t)1 ,_fp);
else
fwrite (vr.c_str(),(size_t)2 ,(size_t)1 ,_fp);
}
fwrite(&z,(size_t)2 ,(size_t)1 ,_fp);
else
fwrite (vr.c_str(),(size_t)2 ,(size_t)1 ,_fp);
}
{
if (gr != 0xfffe)
fwrite ( &z, (size_t)2 ,(size_t)1 ,_fp);
{
if (gr != 0xfffe)
fwrite ( &z, (size_t)2 ,(size_t)1 ,_fp);
+ if (voidArea != NULL) { // there is a 'non string' LUT, overlay, etc
+ fwrite ( voidArea,(size_t)lgr ,(size_t)1 ,_fp); // Elem value
+ continue;
+ }
+
if (vr == "US" || vr == "SS")
{
tokens.erase(tokens.begin(),tokens.end()); // clean any previous value
if (vr == "US" || vr == "SS")
{
tokens.erase(tokens.begin(),tokens.end()); // clean any previous value
LoadEntryVoidArea(0x0028,0x1221); // Segmented Red Palette Color LUT Data
LoadEntryVoidArea(0x0028,0x1222); // Segmented Green Palette Color LUT Data
LoadEntryVoidArea(0x0028,0x1223); // Segmented Blue Palette Color LUT Data
LoadEntryVoidArea(0x0028,0x1221); // Segmented Red Palette Color LUT Data
LoadEntryVoidArea(0x0028,0x1222); // Segmented Green Palette Color LUT Data
LoadEntryVoidArea(0x0028,0x1223); // Segmented Blue Palette Color LUT Data
// --------------------------------------------------------------
// Special Patch to allow gdcm to read ACR-LibIDO formated images
// --------------------------------------------------------------
// Special Patch to allow gdcm to read ACR-LibIDO formated images
long PositionOnEntry = ftell(fp);
// Warning: we believe this is explicit VR (Value Representation) because
long PositionOnEntry = ftell(fp);
// Warning: we believe this is explicit VR (Value Representation) because
- lgrLue=fread (&VR, (size_t)2,(size_t)1, fp);
+ int lgrLue=fread (&VR, (size_t)2,(size_t)1, fp); // lgrLue not used
sprintf(msg,"Falsely explicit vr file (%04x,%04x)\n",
Entry->GetGroup(),Entry->GetElement());
dbg.Verbose(1, "gdcmParser::FindVR: ",msg);
sprintf(msg,"Falsely explicit vr file (%04x,%04x)\n",
Entry->GetGroup(),Entry->GetElement());
dbg.Verbose(1, "gdcmParser::FindVR: ",msg);
+ if (Entry->GetGroup()%2 && Entry->GetElement() == 0x0000) { // Group length is UL !
+ gdcmDictEntry* NewEntry = NewVirtualDictEntry(
+ Entry->GetGroup(),Entry->GetElement(),
+ "UL","FIXME","Group Length");
+ Entry->SetDictEntry(NewEntry);
+ }
return(false);
}
if ( Entry->IsVRUnknown() )
{
// When not a dictionary entry, we can safely overwrite the VR.
return(false);
}
if ( Entry->IsVRUnknown() )
{
// When not a dictionary entry, we can safely overwrite the VR.
#ifdef GDCM_NO_ANSI_STRING_STREAM
s << std::ends; // to avoid oddities on Solaris
#endif //GDCM_NO_ANSI_STRING_STREAM
#ifdef GDCM_NO_ANSI_STRING_STREAM
s << std::ends; // to avoid oddities on Solaris
#endif //GDCM_NO_ANSI_STRING_STREAM
// * the 4 bytes of the first tag (0002, 0000),or (0002, 0001)
// i.e. a total of 136 bytes.
entCur = deb + 136;
// * the 4 bytes of the first tag (0002, 0000),or (0002, 0001)
// i.e. a total of 136 bytes.
entCur = deb + 136;
// FIXME : FIXME:
// Sometimes (see : gdcmData/icone.dcm) group 0x0002 *is* Explicit VR,
// but elem 0002,0010 (Transfert Syntax) tells us the file is *Implicit* VR.
// -and it is !-
// FIXME : FIXME:
// Sometimes (see : gdcmData/icone.dcm) group 0x0002 *is* Explicit VR,
// but elem 0002,0010 (Transfert Syntax) tells us the file is *Implicit* VR.
// -and it is !-
if( (memcmp(entCur, "UL", (size_t)2) == 0) ||
(memcmp(entCur, "OB", (size_t)2) == 0) ||
(memcmp(entCur, "UI", (size_t)2) == 0) ||
(memcmp(entCur, "CS", (size_t)2) == 0) ) // CS, to remove later
// when Write DCM *adds*
if( (memcmp(entCur, "UL", (size_t)2) == 0) ||
(memcmp(entCur, "OB", (size_t)2) == 0) ||
(memcmp(entCur, "UI", (size_t)2) == 0) ||
(memcmp(entCur, "CS", (size_t)2) == 0) ) // CS, to remove later
// when Write DCM *adds*
- NewTag = NewVirtualDictEntry(0xffff, 0xffff, "LO", "Unknown", Name);
+ NewTag = NewVirtualDictEntry(0xffff, 0xffff, "LO", "unkn", Name);