lgr = 2;
else if( (vr == "UL") || (vr == "SL") )
lgr = 4;
- else
- lgr = content.length();
-
+ else
+ lgr = content.length();
tagHt[key]->SetLength(lgr);
return 1;
}
if( (vr == "US") || (vr == "SS") )
lgr = 2;
else if( (vr == "UL") || (vr == "SL") )
- lgr = 4;
+ lgr = 4;
else
lgr = content.length();
+// TODO : WARNING: le cas de l'element des pixels (7fe0,0010) n'est pas traite
+// par SetElValueByName
+// il faudra utiliser SetElValueByNumber
+
NameHt[TagName]->SetLength(lgr);
return 1;
}
IsExplicitVRLittleEndianTransferSyntax() ||
IsExplicitVRBigEndianTransferSyntax() ||
IsDeflatedExplicitVRLittleEndianTransferSyntax() ) {
-
- size_t ItemRead = fread(destination, lgrTotale, 1, fp);
- if ( ItemRead != 1 ) {
- CloseFile();
- return false;
- } else {
- CloseFile();
- return true;
- }
+
+ size_t ItemRead = fread(destination, lgrTotale, 1, fp);
+ if ( ItemRead != 1 ) {
+ CloseFile();
+ return false;
+ } else {
+ CloseFile();
+ return true;
+ }
}
if (IsJPEGLossless()) {
_IdDcmJpegFree (jpg);
CloseFile();
return true;
- }
-
+ }
+
printf ("Sorry, TransfertSyntax not yet taken into account ...\n");
CloseFile();
return false;
* \ingroup gdcmFile
* \brief TODO JPR
* \warning doit-etre etre publique ? FIXME JPR
+ * TODO : y a-t-il un inconvenient à fusioner ces 2 fonctions
*
* @param inData TODO JPR
* @param ExpectedSize TODO JPR
SetImageDataSize(ExpectedSize);
PixelData = inData;
lgrTotale = ExpectedSize;
+
+
return(1);
}
* \brief TODO JPR
* \
* \warning WARNING doit-etre etre publique ? FIXME JPR
+ * TODO : y aurait il un inconvenient à fusionner ces 2 fonctions
*
* @param ImageDataSize TODO JPR
*
void gdcmFile::SetImageDataSize(size_t ImageDataSize) {
string content1;
- string content2;
char car[20];
// suppose que le ElValue (0x7fe0, 0x0010) existe ...
sprintf(car,"%d",ImageDataSize);
- content2=car;
- SetPubElValByNumber(content2, 0x7fe0, 0x0010);
-
+
+ gdcmElValue*a = GetElValueByNumber(0x7fe0, 0x0010);
+ a->SetLength(ImageDataSize);
+
ImageDataSize+=8;
sprintf(car,"%d",ImageDataSize);
content1=car;
-// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.cxx,v 1.61 2003/05/05 14:13:59 frog Exp $
+// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.cxx,v 1.62 2003/05/06 15:52:13 jpr Exp $
#include <stdio.h>
#include <cerrno>
return g;
}
+
+gdcmElValue* gdcmHeader::GetElValueByNumber(guint16 Group, guint16 Elem) {
+
+ gdcmElValue* elValue = PubElValSet.GetElementByNumber(Group, Elem);
+ if (!elValue) {
+ dbg.Verbose(1, "gdcmHeader::GetElValueByNumber",
+ "failed to Locate gdcmElValue");
+ return (gdcmElValue*)0;
+ }
+ return elValue;
+}
+
/**
* \ingroup gdcmHeader
* \brief Build a new Element Value from all the low level arguments.
*/
int gdcmHeader::SetPubElValByNumber(string content, guint16 group,
guint16 element)
+
+//TODO : homogeneiser les noms : SetPubElValByNumber qui appelle PubElValSet.SetElValueByNumber
+// pourquoi pas SetPubElValueByNumber ??
{
+
return ( PubElValSet.SetElValueByNumber (content, group, element) );
}
-// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.h,v 1.21 2003/05/05 14:13:59 frog Exp $
+// $Header: /cvs/public/gdcm/src/Attic/gdcmHeader.h,v 1.22 2003/05/06 15:52:13 jpr Exp $
#ifndef GDCMHEADER_H
#define GDCMHEADER_H
gdcmElValue * ReadNextElement(void);
gdcmElValue * NewElValueByNumber(guint16 group, guint16 element);
gdcmElValue * NewElValueByName(string name);
+
void FindLength(gdcmElValue *);
void FindVR(gdcmElValue *);
void LoadElementValue(gdcmElValue *);
protected:
FILE * fp;
FileType filetype;
+
+ gdcmElValue * GetElValueByNumber(guint16 group, guint16 element);
guint16 SwapShort(guint16); // needed by gdcmFile
guint32 SwapLong(guint32); // for JPEG Files :-(