* false otherwise.
*/
bool gdcmParser::IsReadable(void) {
- if(filetype==Unknown)
+ if(filetype==Unknown) {
return(false);
- if(listEntries.size()<=0)
+ }
+ if(listEntries.size()<=0) {
return(false);
+ }
return(true);
}
return(fp);
fclose(fp);
- dbg.Verbose(0, "gdcmParser::gdcmParser not DICOM/ACR", filename.c_str());
+ dbg.Verbose(0, "gdcmParser::OpenFile not DICOM/ACR", filename.c_str());
}
else {
- dbg.Verbose(0, "gdcmParser::gdcmParser cannot open file", filename.c_str());
+ dbg.Verbose(0, "gdcmParser::OpenFile cannot open file", filename.c_str());
}
return(NULL);
}
free(a);
return NULL;
}
+
return a;
}
guint32 val_uint32;
guint16 val_uint16;
guint16 valZero =0;
+ void *voidArea;
std::vector<std::string> tokens;
// TODO : function CheckHeaderCoherence to be written
lgr = (*tag2)->GetReadLength();
val = (*tag2)->GetValue().c_str();
vr = (*tag2)->GetVR();
+ voidArea = (*tag2)->GetVoidArea();
+
if ( type == ACR )
{
if (gr < 0x0008) continue; // ignore pure DICOM V3 groups
if (vr == "SQ") continue; // no "value" to write for the SEQuences
if (gr == 0xfffe)continue;
+ 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
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
- }
+ }
+ //FIXME : how to use it?
+ LoadEntryVoidArea(0x0028,0x3006); //LUT Data (CTX dependent)
// --------------------------------------------------------------
// Special Patch to allow gdcm to read ACR-LibIDO formated images
if (FoundLength%2) {
std::cout << "Warning : Tag with uneven length " << FoundLength
- << "in x(" << hex << gr << "," << el <<")" << std::endl;
+ << "in x(" << std::hex << gr << "," << el <<")" << std::endl;
}
// Sorry for the patch!
// For *regular* headers, the test is useless..
// lets's print a warning message and go on,
// instead of giving up with an error message
- std::cout << s.str().c_str() << std::endl;
+
+ //std::cout << s.str().c_str() << std::endl;
+
// dbg.Error("gdcmParser::IsHeaderEntryAnInteger",
// s.str().c_str());
}
// * the 4 bytes of the first tag (0002, 0000),or (0002, 0001)
// i.e. a total of 136 bytes.
entCur = deb + 136;
- // FIXME
- // Use gdcmParser::dicom_vr to test all the possibilities
- // instead of just checking for UL, OB and UI !?
-
+
// 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 !-
- // The following test is *absolutely useless*, since everything *goes right*
- // with a *100 % wrong* assumption !!!
-
if( (memcmp(entCur, "UL", (size_t)2) == 0) ||
(memcmp(entCur, "OB", (size_t)2) == 0) ||
- (memcmp(entCur, "UI", (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*
+ // FIXME
+ // Use gdcmParser::dicom_vr to test all the possibilities
+ // instead of just checking for UL, OB and UI !? // group 0000
+
{
filetype = ExplicitVR;
dbg.Verbose(1, "gdcmParser::CheckSwap:",
dbg.Verbose(1, "gdcmParser::CheckSwap:",
"not an explicit Value Representation");
}
+
if (net2host)
{
sw = 4321;