and all the methods called ...VoidArea... are now ... BinArea...
2004-09-23 Jean-Pierre Roux
* FIX In order not to be poluted any longer by casting problems,
the member VoidArea of gdcmBinEntry is now uint8_t* (instead of void *)
- we can now delete[] it safely
+ we can now delete[] it safely
+ * VoidArea is now called BinArea (less confusing name),
+ and all the methods called ...VoidArea... are now ... BinArea...
2004-09-22 Eric Boix <Eric.Boix@creatis.insa-lyon.fr>
* src/gdcmDocument.cxx: gdcmDocument::~gdcmDocument() doesn't clear (nor
if ( gdcmBinEntry* b = dynamic_cast<gdcmBinEntry*>(d) )
{
copy->GetHeader()->ReplaceOrCreateByNumber(
- b->GetVoidArea(),
+ b->GetBinArea(),
b->GetLength(),
b->GetGroup(),
b->GetElement(),
if ( gdcmBinEntry* b = dynamic_cast<gdcmBinEntry*>(d) )
{
copy->GetHeader()->ReplaceOrCreateByNumber(
- b->GetVoidArea(),
+ b->GetBinArea(),
b->GetLength(),
b->GetGroup(),
b->GetElement(),
Program: gdcm
Module: $RCSfile: gdcmBinEntry.cxx,v $
Language: C++
- Date: $Date: 2004/09/23 09:40:30 $
- Version: $Revision: 1.29 $
+ Date: $Date: 2004/09/23 10:17:26 $
+ Version: $Revision: 1.30 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
*/
gdcmBinEntry::gdcmBinEntry(gdcmDictEntry* e) : gdcmValEntry(e)
{
- VoidArea = 0;
+ BinArea = 0;
}
/**
//FIXME
//SQDepthLevel = e->GetDepthLevel();
- VoidArea = 0; // let's be carefull !
+ BinArea = 0; // let's be carefull !
}
/**
*/
gdcmBinEntry::~gdcmBinEntry()
{
- if (VoidArea)
+ if (BinArea)
{
- delete[] VoidArea;
- VoidArea = 0; // let's be carefull !
+ delete[] BinArea;
+ BinArea = 0; // let's be carefull !
}
}
{
gdcmDocEntry::Print(os);
std::ostringstream s;
- void *voidArea = GetVoidArea();
- if (voidArea)
+ void *binArea = GetBinArea();
+ if (binArea)
{
//s << " [" << GDCM_BINLOADED
s << " [" << GetValue()
void gdcmBinEntry::Write(FILE *fp, FileType filetype)
{
gdcmDocEntry::Write(fp, filetype);
- void *voidArea = GetVoidArea();
+ void *binArea = GetBinArea();
int lgr = GetLength();
- if (voidArea)
+ if (binArea)
{
// there is a 'non string' LUT, overlay, etc
- fwrite ( voidArea,(size_t)lgr ,(size_t)1 ,fp); // Elem value
+ fwrite ( binArea,(size_t)lgr ,(size_t)1 ,fp); // Elem value
}
else
{
/// \brief Sets the value (non string) of the current Dicom Header Entry
-void gdcmBinEntry::SetVoidArea( uint8_t* area )
+void gdcmBinEntry::SetBinArea( uint8_t* area )
{
- if (VoidArea)
- delete[] VoidArea;
- VoidArea = area;
+ if (BinArea)
+ delete[] BinArea;
+ BinArea = area;
}
//-----------------------------------------------------------------------------
Program: gdcm
Module: $RCSfile: gdcmBinEntry.h,v $
Language: C++
- Date: $Date: 2004/09/23 09:40:30 $
- Version: $Revision: 1.18 $
+ Date: $Date: 2004/09/23 10:17:26 $
+ Version: $Revision: 1.19 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/// \brief Returns the area value of the current Dicom Header Entry
/// when it's not string-translatable (e.g : a LUT table)
- uint8_t* GetVoidArea() { return VoidArea; }
- void SetVoidArea( uint8_t* area );
+ uint8_t* GetBinArea() { return BinArea; }
+ void SetBinArea( uint8_t* area );
protected:
/// \brief unsecure memory area to hold 'non string' values
/// (ie : Lookup Tables, overlays, icons)
- uint8_t*VoidArea;
+ uint8_t* BinArea;
};
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2004/09/23 09:40:30 $
- Version: $Revision: 1.89 $
+ Date: $Date: 2004/09/23 10:17:26 $
+ Version: $Revision: 1.90 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
std::string PhotometricInterpretation = GetEntryByNumber(0x0028,0x0004);
if( PhotometricInterpretation == "PALETTE COLOR " )
{
- LoadEntryVoidArea(0x0028,0x1200); // gray LUT
+ LoadEntryBinArea(0x0028,0x1200); // gray LUT
/// FIXME FIXME FIXME
/// The tags refered by the three following lines used to be CORRECTLY
/// defined as having an US Value Representation in the public
/// also used as gdcmBinEntry, which requires the proper conversion,
/// - OW, and hence loaded as gdcmBinEntry, but afterwards also used
/// as gdcmValEntry, which requires the proper conversion.
- LoadEntryVoidArea(0x0028,0x1201); // R LUT
- LoadEntryVoidArea(0x0028,0x1202); // G LUT
- LoadEntryVoidArea(0x0028,0x1203); // B LUT
+ LoadEntryBinArea(0x0028,0x1201); // R LUT
+ LoadEntryBinArea(0x0028,0x1202); // G LUT
+ LoadEntryBinArea(0x0028,0x1203); // B LUT
// Segmented Red Palette Color LUT Data
- LoadEntryVoidArea(0x0028,0x1221);
+ LoadEntryBinArea(0x0028,0x1221);
// Segmented Green Palette Color LUT Data
- LoadEntryVoidArea(0x0028,0x1222);
+ LoadEntryBinArea(0x0028,0x1222);
// Segmented Blue Palette Color LUT Data
- LoadEntryVoidArea(0x0028,0x1223);
+ LoadEntryBinArea(0x0028,0x1223);
}
//FIXME later : how to use it?
- LoadEntryVoidArea(0x0028,0x3006); //LUT Data (CTX dependent)
+ LoadEntryBinArea(0x0028,0x3006); //LUT Data (CTX dependent)
CloseFile();
/*
* \brief Modifies the value of a given Header Entry (Dicom Element)
* when it exists. Create it with the given value when unexistant.
- * @param voidArea (binary) value to be set
+ * @param binArea (binary) value to be set
* @param Group Group number of the Entry
* @param Elem Element number of the Entry
* \return pointer to the modified/created Header Entry (NULL when creation
* failed).
*/
gdcmBinEntry * gdcmDocument::ReplaceOrCreateByNumber(
- uint8_t* voidArea,
+ uint8_t* binArea,
int lgth,
uint16_t group,
uint16_t elem,
}
}
- SetEntryByNumber(voidArea, lgth, group, elem);
+ SetEntryByNumber(binArea, lgth, group, elem);
return binEntry;
}
}
*/
gdcmBinEntry* a = (gdcmBinEntry *)TagHT[key];
- a->SetVoidArea(content);
+ a->SetBinArea(content);
a->SetLength(lgth);
a->SetValue(GDCM_BINLOADED);
* @param elem element number of the Entry
* @return Pointer to the 'non string' area
*/
-void * gdcmDocument::GetEntryVoidAreaByNumber(uint16_t group, uint16_t elem)
+void * gdcmDocument::GetEntryBinAreaByNumber(uint16_t group, uint16_t elem)
{
gdcmDocEntry* entry = GetDocEntryByNumber(group, elem);
if (!entry)
dbg.Verbose(1, "gdcmDocument::GetDocEntryByNumber: no entry");
return 0;
}
- return ((gdcmBinEntry *)entry)->GetVoidArea();
+ return ((gdcmBinEntry *)entry)->GetBinArea();
}
/**
* @param group group number of the Entry
* @param elem element number of the Entry
*/
-void* gdcmDocument::LoadEntryVoidArea(uint16_t group, uint16_t elem)
+void* gdcmDocument::LoadEntryBinArea(uint16_t group, uint16_t elem)
{
gdcmDocEntry *docElement = GetDocEntryByNumber(group, elem);
if ( !docElement )
uint8_t* a = new uint8_t[l];
if(!a)
{
- dbg.Verbose(0, "gdcmDocument::LoadEntryVoidArea cannot allocate a");
+ dbg.Verbose(0, "gdcmDocument::LoadEntryBinArea cannot allocate a");
return NULL;
}
size_t l2 = fread(a, 1, l , Fp);
return NULL;
}
/// \todo Drop any already existing void area! JPR
- if( !SetEntryVoidAreaByNumber( a, group, elem ) );
+ if( !SetEntryBinAreaByNumber( a, group, elem ) );
{
- dbg.Verbose(0, "gdcmDocument::LoadEntryVoidArea setting failed.");
+ dbg.Verbose(0, "gdcmDocument::LoadEntryBinArea setting failed.");
}
return a;
}
/**
* \brief Loads (from disk) the element content
* when a string is not suitable
- * @param element Entry whose voidArea is going to be loaded
+ * @param element Entry whose binArea is going to be loaded
*/
-void *gdcmDocument::LoadEntryVoidArea(gdcmBinEntry *element)
+void *gdcmDocument::LoadEntryBinArea(gdcmBinEntry *element)
{
size_t o =(size_t)element->GetOffset();
fseek(Fp, o, SEEK_SET);
uint8_t* a = new uint8_t[l];
if( !a )
{
- dbg.Verbose(0, "gdcmDocument::LoadEntryVoidArea cannot allocate a");
+ dbg.Verbose(0, "gdcmDocument::LoadEntryBinArea cannot allocate a");
return NULL;
}
- element->SetVoidArea((uint8_t*)a);
+ element->SetBinArea((uint8_t*)a);
/// \todo check the result
size_t l2 = fread(a, 1, l , Fp);
if( l != l2 )
* @param element Element number of the searched Dicom Element
* @return
*/
-bool gdcmDocument::SetEntryVoidAreaByNumber(uint8_t* area,
+bool gdcmDocument::SetEntryBinAreaByNumber(uint8_t* area,
uint16_t group,
uint16_t element)
{
}
if ( gdcmBinEntry* binEntry = dynamic_cast<gdcmBinEntry*>(currentEntry) )
{
- binEntry->SetVoidArea( area );
+ binEntry->SetBinArea( area );
return true;
}
return true;
{
s << GDCM_BINLOADED;
binEntryPtr->SetValue(s.str());
- LoadEntryVoidArea(binEntryPtr); // last one, not to erase length !
+ LoadEntryBinArea(binEntryPtr); // last one, not to erase length !
return;
}
Program: gdcm
Module: $RCSfile: gdcmDocument.h,v $
Language: C++
- Date: $Date: 2004/09/23 09:40:30 $
- Version: $Revision: 1.40 $
+ Date: $Date: 2004/09/23 10:17:26 $
+ Version: $Revision: 1.41 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
uint16_t group, uint16_t elem,
std::string const & VR ="unkn");
- gdcmBinEntry* ReplaceOrCreateByNumber(uint8_t* voidArea, int lgth,
+ gdcmBinEntry* ReplaceOrCreateByNumber(uint8_t* binArea, int lgth,
uint16_t group, uint16_t elem,
std::string const & VR="unkn");
uint16_t group,
uint16_t elem );
- virtual void* LoadEntryVoidArea(uint16_t group, uint16_t elem);
- virtual void* LoadEntryVoidArea(gdcmBinEntry* entry);
+ virtual void* LoadEntryBinArea(uint16_t group, uint16_t elem);
+ virtual void* LoadEntryBinArea(gdcmBinEntry* entry);
// System access (meaning endian related !?)
uint16_t SwapShort(uint16_t); // needed by gdcmFile
uint16_t group, uint16_t element);
virtual size_t GetEntryOffsetByNumber (uint16_t group, uint16_t elem);
- virtual void* GetEntryVoidAreaByNumber(uint16_t group, uint16_t elem);
- virtual bool SetEntryVoidAreaByNumber(uint8_t* a, uint16_t group,
+ virtual void* GetEntryBinAreaByNumber(uint16_t group, uint16_t elem);
+ virtual bool SetEntryBinAreaByNumber(uint8_t* a, uint16_t group,
uint16_t elem);
virtual void UpdateShaEntries();
Program: gdcm
Module: $RCSfile: gdcmFile.cxx,v $
Language: C++
- Date: $Date: 2004/09/23 09:40:30 $
- Version: $Revision: 1.127 $
+ Date: $Date: 2004/09/23 10:17:26 $
+ Version: $Revision: 1.128 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
GetHeader()->GetGrPixel(), GetHeader()->GetNumPixel());
// Will be 7fe0, 0010 in standard case
- GetHeader()->SetEntryVoidAreaByNumber( Pixel_Data,
+ GetHeader()->SetEntryBinAreaByNumber( Pixel_Data,
GetHeader()->GetGrPixel(), GetHeader()->GetNumPixel());
}
PixelRead = 0; // no PixelRaw
GetHeader()->GetGrPixel(), GetHeader()->GetNumPixel());
// will be 7fe0, 0010 in standard cases
- GetHeader()->SetEntryVoidAreaByNumber(Pixel_Data,
+ GetHeader()->SetEntryBinAreaByNumber(Pixel_Data,
GetHeader()->GetGrPixel(), GetHeader()->GetNumPixel());
}
PixelRead = 1; // PixelRaw
Program: gdcm
Module: $RCSfile: gdcmHeader.cxx,v $
Language: C++
- Date: $Date: 2004/09/20 18:14:23 $
- Version: $Revision: 1.187 $
+ Date: $Date: 2004/09/23 10:17:26 $
+ Version: $Revision: 1.188 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
}
// Load LUTs into memory, (as they were stored on disk)
- uint8_t* lutR = (uint8_t*) GetEntryVoidAreaByNumber(0x0028,0x1201);
- uint8_t* lutG = (uint8_t*) GetEntryVoidAreaByNumber(0x0028,0x1202);
- uint8_t* lutB = (uint8_t*) GetEntryVoidAreaByNumber(0x0028,0x1203);
+ uint8_t* lutR = (uint8_t*) GetEntryBinAreaByNumber(0x0028,0x1201);
+ uint8_t* lutG = (uint8_t*) GetEntryBinAreaByNumber(0x0028,0x1202);
+ uint8_t* lutB = (uint8_t*) GetEntryBinAreaByNumber(0x0028,0x1203);
if ( !lutR || !lutG || !lutB )
{