Program: gdcm
Module: $RCSfile: TestChangeHeader.cxx,v $
Language: C++
- Date: $Date: 2005/01/24 16:10:49 $
- Version: $Revision: 1.10 $
+ Date: $Date: 2005/01/24 16:44:53 $
+ Version: $Revision: 1.11 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
if(matrix != "gdcm::Unfound")
{
std::cerr << "Aquisition Matrix:" << matrix << std::endl;
- f1->GetFile()->ReplaceOrCreate( matrix, 0x0018, 0x1310);
+ f1->GetFile()->Insert( matrix, 0x0018, 0x1310);
}
f1->GetImageData();
Program: gdcm
Module: $RCSfile: TestCopyDicom.cxx,v $
Language: C++
- Date: $Date: 2005/01/21 11:40:52 $
- Version: $Revision: 1.20 $
+ Date: $Date: 2005/01/24 16:44:53 $
+ Version: $Revision: 1.21 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
if ( gdcm::BinEntry* b = dynamic_cast<gdcm::BinEntry*>(d) )
{
- copy->GetFile()->ReplaceOrCreate(
+ copy->GetFile()->Insert(
b->GetBinArea(),
b->GetLength(),
b->GetGroup(),
}
else if ( gdcm::ValEntry* v = dynamic_cast<gdcm::ValEntry*>(d) )
{
- copy->GetFile()->ReplaceOrCreate(
+ copy->GetFile()->Insert(
v->GetValue(),
v->GetGroup(),
v->GetElement(),
Program: gdcm
Module: $RCSfile: TestFromScratch.cxx,v $
Language: C++
- Date: $Date: 2005/01/21 11:40:52 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2005/01/24 16:44:53 $
+ Version: $Revision: 1.13 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// Do not bother with field from private dict
if( v->GetName() != "gdcm::Unknown" )
{
- h2->ReplaceOrCreate(
- v->GetValue(),
- v->GetGroup(),
- v->GetElement(),
- v->GetVR() );
+ h2->Insert( v->GetValue(),
+ v->GetGroup(),
+ v->GetElement(),
+ v->GetVR() );
}
}
//else
Program: gdcm
Module: $RCSfile: TestPapyrus.cxx,v $
Language: C++
- Date: $Date: 2005/01/24 16:10:49 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2005/01/24 16:44:53 $
+ Version: $Revision: 1.8 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
gdcm::File *n = new gdcm::File();
n->InitializeDefaultFile();
- n->ReplaceOrCreate(MediaStSOPinstUID, 0x0002,0x0002);
+ n->Insert(MediaStSOPinstUID, 0x0002,0x0002);
// Whe keep default gdcm Transfer Syntax (Explicit VR Little Endian)
// since using Papyrus one (Implicit VR Little Endian) is a mess
- //n->ReplaceOrCreate(TransferSyntax, 0x0002,0x0010);
- n->ReplaceOrCreate(StudyDate, 0x0008,0x0020);
- n->ReplaceOrCreate(StudyTime, 0x0008,0x0030);
- n->ReplaceOrCreate(Modality, 0x0008,0x0060);
- n->ReplaceOrCreate(PatientName, 0x0010,0x0010);
-
- n->ReplaceOrCreate(SamplesPerPixel, 0x0028,0x0002);
- n->ReplaceOrCreate(NumberOfFrames, 0x0028,0x0008);
- n->ReplaceOrCreate(Rows, 0x0028,0x0010);
- n->ReplaceOrCreate(Columns, 0x0028,0x0011);
- n->ReplaceOrCreate(BitsAllocated, 0x0028,0x0100);
- n->ReplaceOrCreate(BitsStored, 0x0028,0x0101);
- n->ReplaceOrCreate(HighBit, 0x0028,0x0102);
- n->ReplaceOrCreate(PixelRepresentation,0x0028,0x0102);
+ //n->Insert(TransferSyntax, 0x0002,0x0010);
+ n->Insert(StudyDate, 0x0008,0x0020);
+ n->Insert(StudyTime, 0x0008,0x0030);
+ n->Insert(Modality, 0x0008,0x0060);
+ n->Insert(PatientName, 0x0010,0x0010);
+
+ n->Insert(SamplesPerPixel, 0x0028,0x0002);
+ n->Insert(NumberOfFrames, 0x0028,0x0008);
+ n->Insert(Rows, 0x0028,0x0010);
+ n->Insert(Columns, 0x0028,0x0011);
+ n->Insert(BitsAllocated, 0x0028,0x0100);
+ n->Insert(BitsStored, 0x0028,0x0101);
+ n->Insert(HighBit, 0x0028,0x0102);
+ n->Insert(PixelRepresentation,0x0028,0x0102);
// create the file
gdcm::FileHelper *file = new gdcm::FileHelper(n);
Program: gdcm
Module: $RCSfile: WriteDicom.cxx,v $
Language: C++
- Date: $Date: 2005/01/24 16:10:49 $
- Version: $Revision: 1.13 $
+ Date: $Date: 2005/01/24 16:44:53 $
+ Version: $Revision: 1.14 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
std::string nbFrames = f2->GetFile()->GetEntryValue(0x0028, 0x0008);
if(nbFrames != "gdcm::Unfound") {
- f1->GetFile()->ReplaceOrCreate( nbFrames, 0x0028, 0x0008);
+ f1->GetFile()->Insert( nbFrames, 0x0028, 0x0008);
}
- f1->GetFile()->ReplaceOrCreate(
+ f1->GetFile()->Insert(
f2->GetFile()->GetEntryValue(0x0028, 0x0010), 0x0028, 0x0010); // nbLig
- f1->GetFile()->ReplaceOrCreate(
+ f1->GetFile()->Insert(
f2->GetFile()->GetEntryValue(0x0028, 0x0011), 0x0028, 0x0011); // nbCol
// Some other tags should be updated:
Program: gdcm
Module: $RCSfile: WriteDicomSimple.cxx,v $
Language: C++
- Date: $Date: 2005/01/21 11:40:53 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2005/01/24 16:44:53 $
+ Version: $Revision: 1.9 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// Set the image size
str.str("");
str << SIZE_X;
- header->ReplaceOrCreate(str.str(),0x0028,0x0011); // Columns
+ header->Insert(str.str(),0x0028,0x0011); // Columns
str.str("");
str << SIZE_Y;
- header->ReplaceOrCreate(str.str(),0x0028,0x0010); // Rows
+ header->Insert(str.str(),0x0028,0x0010); // Rows
// Set the pixel type
str.str("");
str << COMPONENT_SIZE * 8;
- header->ReplaceOrCreate(str.str(),0x0028,0x0100); // Bits Allocated
- header->ReplaceOrCreate(str.str(),0x0028,0x0101); // Bits Stored
+ header->Insert(str.str(),0x0028,0x0100); // Bits Allocated
+ header->Insert(str.str(),0x0028,0x0101); // Bits Stored
str.str("");
str << COMPONENT_SIZE * 8 - 1;
- header->ReplaceOrCreate(str.str(),0x0028,0x0102); // High Bit
+ header->Insert(str.str(),0x0028,0x0102); // High Bit
// Set the pixel representation
str.str("");
str << "0"; // Unsigned
- header->ReplaceOrCreate(str.str(),0x0028,0x0103); // Pixel Representation
+ header->Insert(str.str(),0x0028,0x0103); // Pixel Representation
// Set the samples per pixel
str.str("");
str << COMPONENT;
- header->ReplaceOrCreate(str.str(),0x0028,0x0002); // Samples per Pixel
+ header->Insert(str.str(),0x0028,0x0002); // Samples per Pixel
// Set the Window / Level
str.str("");
str << COLOR_WINDOW;
- header->ReplaceOrCreate(str.str(),0x0028,0x1051); // Window Width
+ header->Insert(str.str(),0x0028,0x1051); // Window Width
str.str("");
str << COLOR_LEVEL;
- header->ReplaceOrCreate(str.str(),0x0028,0x1050); // Window Center
+ header->Insert(str.str(),0x0028,0x1050); // Window Center
if( !header->IsReadable() )
{
Program: gdcm
Module: $RCSfile: TestChangeHeader.cxx,v $
Language: C++
- Date: $Date: 2005/01/24 16:10:50 $
- Version: $Revision: 1.30 $
+ Date: $Date: 2005/01/24 16:44:53 $
+ Version: $Revision: 1.31 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
std::string nbFrames = f2->GetHeader()->GetEntryValue(0x0028, 0x0008);
if(nbFrames != "gdcm::Unfound")
{
- f1->GetHeader()->ReplaceOrCreate( nbFrames, 0x0028, 0x0008);
+ f1->GetHeader()->Insert( nbFrames, 0x0028, 0x0008);
}
// It was not designed as a 'Test' program, but as a utility
// provided to 'transform' an image 'Siemens MRI New version' into an image 'Siemens MRI old version'
- f1->GetHeader()->ReplaceOrCreate(
+ f1->GetHeader()->Insert(
f2->GetHeader()->GetEntryValue(0x0028, 0x0010), 0x0028, 0x0010);// nbLig
- f1->GetHeader()->ReplaceOrCreate(
+ f1->GetHeader()->Insert(
f2->GetHeader()->GetEntryValue(0x0028, 0x0011), 0x0028, 0x0011);// nbCol
- f1->GetHeader()->ReplaceOrCreate(
+ f1->GetHeader()->Insert(
f2->GetHeader()->GetEntryValue(0x0028, 0x0100), 0x0028, 0x0100);// BitsAllocated
- f1->GetHeader()->ReplaceOrCreate(
+ f1->GetHeader()->Insert(
f2->GetHeader()->GetEntryValue(0x0028, 0x0101), 0x0028, 0x0101);// BitsStored
- f1->GetHeader()->ReplaceOrCreate(
+ f1->GetHeader()->Insert(
f2->GetHeader()->GetEntryValue(0x0028, 0x0102), 0x0028, 0x0102);// HighBit
- f1->GetHeader()->ReplaceOrCreate(
+ f1->GetHeader()->Insert(
f2->GetHeader()->GetEntryValue(0x0028, 0x0103), 0x0028, 0x0103);// Pixel Representation
// Probabely some more to update (?)
Program: gdcm
Module: $RCSfile: TestCopyDicom.cxx,v $
Language: C++
- Date: $Date: 2005/01/24 16:10:50 $
- Version: $Revision: 1.34 $
+ Date: $Date: 2005/01/24 16:44:54 $
+ Version: $Revision: 1.35 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
if ( gdcm::BinEntry* b = dynamic_cast<gdcm::BinEntry*>(d) )
{
- copyH->ReplaceOrCreate(
- b->GetBinArea(),
- b->GetLength(),
- b->GetGroup(),
- b->GetElement(),
- b->GetVR() );
+ copyH->Insert( b->GetBinArea(),
+ b->GetLength(),
+ b->GetGroup(),
+ b->GetElement(),
+ b->GetVR() );
}
else if ( gdcm::ValEntry* v = dynamic_cast<gdcm::ValEntry*>(d) )
{
- copyH->ReplaceOrCreate(
- v->GetValue(),
- v->GetGroup(),
- v->GetElement(),
- v->GetVR() );
+ copyH->Insert( v->GetValue(),
+ v->GetGroup(),
+ v->GetElement(),
+ v->GetVR() );
}
else
{
Program: gdcm
Module: $RCSfile: TestCopyRescaleDicom.cxx,v $
Language: C++
- Date: $Date: 2005/01/24 16:10:50 $
- Version: $Revision: 1.9 $
+ Date: $Date: 2005/01/24 16:44:54 $
+ Version: $Revision: 1.10 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
if ( gdcm::BinEntry* b = dynamic_cast<gdcm::BinEntry*>(d) )
{
- copyH->ReplaceOrCreate(
+ copyH->Insert(
b->GetBinArea(),
b->GetLength(),
b->GetGroup(),
}
else if ( gdcm::ValEntry* v = dynamic_cast<gdcm::ValEntry*>(d) )
{
- copyH->ReplaceOrCreate(
+ copyH->Insert(
v->GetValue(),
v->GetGroup(),
v->GetElement(),
if( bitsStored == "16" )
{
std::cout << "Rescale...";
- copyH->ReplaceOrCreate( "8", 0x0028, 0x0100); // BitsAllocated
- copyH->ReplaceOrCreate( "8", 0x0028, 0x0101); // BitsStored
- copyH->ReplaceOrCreate( "7", 0x0028, 0x0102); // HighBit
- copyH->ReplaceOrCreate( "0", 0x0028, 0x0103); //Pixel Representation
+ copyH->Insert( "8", 0x0028, 0x0100); // BitsAllocated
+ copyH->Insert( "8", 0x0028, 0x0101); // BitsStored
+ copyH->Insert( "7", 0x0028, 0x0102); // HighBit
+ copyH->Insert( "0", 0x0028, 0x0103); //Pixel Representation
// We assume the value were from 0 to uint16_t max
rescaleSize = dataSize / 2;
Program: gdcm
Module: $RCSfile: TestWriteSimple.cxx,v $
Language: C++
- Date: $Date: 2005/01/21 11:40:54 $
- Version: $Revision: 1.13 $
+ Date: $Date: 2005/01/24 16:44:54 $
+ Version: $Revision: 1.14 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// Set the image size
str.str("");
str << img.sizeX;
- header->ReplaceOrCreate(str.str(),0x0028,0x0011); // Columns
+ header->Insert(str.str(),0x0028,0x0011); // Columns
str.str("");
str << img.sizeY;
- header->ReplaceOrCreate(str.str(),0x0028,0x0010); // Rows
+ header->Insert(str.str(),0x0028,0x0010); // Rows
if(img.sizeZ>1)
{
str.str("");
str << img.sizeZ;
- header->ReplaceOrCreate(str.str(),0x0028,0x0008); // Number of Frames
+ header->Insert(str.str(),0x0028,0x0008); // Number of Frames
}
// Set the pixel type
str.str("");
str << img.componentSize;
- header->ReplaceOrCreate(str.str(),0x0028,0x0100); // Bits Allocated
+ header->Insert(str.str(),0x0028,0x0100); // Bits Allocated
str.str("");
str << img.componentUse;
- header->ReplaceOrCreate(str.str(),0x0028,0x0101); // Bits Stored
+ header->Insert(str.str(),0x0028,0x0101); // Bits Stored
str.str("");
str << img.componentSize - 1;
- header->ReplaceOrCreate(str.str(),0x0028,0x0102); // High Bit
+ header->Insert(str.str(),0x0028,0x0102); // High Bit
// Set the pixel representation
str.str("");
str << img.sign;
- header->ReplaceOrCreate(str.str(),0x0028,0x0103); // Pixel Representation
+ header->Insert(str.str(),0x0028,0x0103); // Pixel Representation
// Set the samples per pixel
str.str("");
str << img.components;
- header->ReplaceOrCreate(str.str(),0x0028,0x0002); // Samples per Pixel
+ header->Insert(str.str(),0x0028,0x0002); // Samples per Pixel
if( !header->IsReadable() )
{
Program: gdcm
Module: $RCSfile: gdcmDocument.h,v $
Language: C++
- Date: $Date: 2005/01/24 16:10:52 $
- Version: $Revision: 1.99 $
+ Date: $Date: 2005/01/24 16:44:54 $
+ Version: $Revision: 1.100 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
virtual std::string GetEntryVR(uint16_t group, uint16_t elem);
virtual int GetEntryLength(uint16_t group, uint16_t elem);
- ValEntry *ReplaceOrCreate(std::string const &value,
- uint16_t group, uint16_t elem,
- TagName const &vr = GDCM_UNKNOWN);
- BinEntry *ReplaceOrCreate(uint8_t *binArea, int lgth,
- uint16_t group, uint16_t elem,
- TagName const &vr = GDCM_UNKNOWN);
- SeqEntry *ReplaceOrCreate(uint16_t group, uint16_t elem);
+ ValEntry *Insert(std::string const &value,
+ uint16_t group, uint16_t elem,
+ TagName const &vr = GDCM_UNKNOWN);
+ BinEntry *Insert(uint8_t *binArea, int lgth,
+ uint16_t group, uint16_t elem,
+ TagName const &vr = GDCM_UNKNOWN);
+ SeqEntry *Insert(uint16_t group, uint16_t elem);
bool ReplaceIfExist(std::string const &value,
uint16_t group, uint16_t elem );
Program: gdcm
Module: $RCSfile: gdcmFile.cxx,v $
Language: C++
- Date: $Date: 2005/01/24 16:10:52 $
- Version: $Revision: 1.198 $
+ Date: $Date: 2005/01/24 16:44:54 $
+ Version: $Revision: 1.199 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// no (GrPixel, NumPixel) element
std::string s_lgPix = Util::Format("%d", i_lgPix+12);
s_lgPix = Util::DicomString( s_lgPix.c_str() );
- ReplaceOrCreate(s_lgPix,GrPixel, 0x0000);
+ Insert(s_lgPix,GrPixel, 0x0000);
}
// FIXME : should be nice if we could move it to File
std::string studyInstanceUID = GetEntryValue (0x0020, 0x000d);
if ( studyInstanceUID != GDCM_UNFOUND )
{
- ReplaceOrCreate(studyInstanceUID, 0x0010, 0x0010);
+ Insert(studyInstanceUID, 0x0010, 0x0010);
}
else
{
- ReplaceOrCreate("anonymised", 0x0010, 0x0010);
+ Insert("anonymised", 0x0010, 0x0010);
}
}
// Special case this is the image (not a string)
GrPixel = 0x7fe0;
NumPixel = 0x0010;
- ReplaceOrCreate(0, 0, GrPixel, NumPixel);
+ Insert(0, 0, GrPixel, NumPixel);
// All remaining strings:
unsigned int i = 0;
DICOM_DEFAULT_VALUE current = defaultvalue[i];
while( current.value )
{
- ReplaceOrCreate(current.value, current.group, current.elem);
+ Insert(current.value, current.group, current.elem);
current = defaultvalue[++i];
}
}
Program: gdcm
Module: $RCSfile: gdcmFileHelper.cxx,v $
Language: C++
- Date: $Date: 2005/01/24 16:10:52 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2005/01/24 16:44:54 $
+ Version: $Revision: 1.5 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* through it's (group, element) and modifies it's content with
* the given value.
* @param content new value (string) to substitute with
- * @param group group number of the Dicom Element to modify
+ * @param group group number of the Dicom Element to modify
* @param elem element number of the Dicom Element to modify
*/
bool FileHelper::SetEntryValue(std::string const &content,
* @param elem element number of the Dicom Element to modify
*/
bool FileHelper::SetEntryBinArea(uint8_t *content, int lgth,
- uint16_t group, uint16_t elem)
+ uint16_t group, uint16_t elem)
{
return FileInternal->SetEntryBinArea(content,lgth,group,elem);
}
* \return pointer to the modified/created Dicom entry (NULL when creation
* failed).
*/
-bool FileHelper::ReplaceOrCreate(std::string const &content,
- uint16_t group, uint16_t elem)
+bool FileHelper::Insert(std::string const &content,
+ uint16_t group, uint16_t elem)
{
- return FileInternal->ReplaceOrCreate(content,group,elem) != NULL;
+ return FileInternal->Insert(content,group,elem) != NULL;
}
/*
* \return pointer to the modified/created Dicom entry (NULL when creation
* failed).
*/
-bool FileHelper::ReplaceOrCreate(uint8_t *binArea, int lgth,
- uint16_t group, uint16_t elem)
+bool FileHelper::Insert(uint8_t *binArea, int lgth,
+ uint16_t group, uint16_t elem)
{
- return FileInternal->ReplaceOrCreate(binArea,lgth,group,elem) != NULL;
+ return FileInternal->Insert(binArea,lgth,group,elem) != NULL;
}
/**
Program: gdcm
Module: $RCSfile: gdcmFileHelper.h,v $
Language: C++
- Date: $Date: 2005/01/24 16:10:52 $
- Version: $Revision: 1.5 $
+ Date: $Date: 2005/01/24 16:44:54 $
+ Version: $Revision: 1.6 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
bool Write (std::string const &fileName);
bool SetEntryValue(std::string const &content,
- uint16_t group, uint16_t elem);
+ uint16_t group, uint16_t elem);
bool SetEntryBinArea(uint8_t *content, int lgth,
- uint16_t group, uint16_t elem);
- bool ReplaceOrCreate(std::string const &content,
- uint16_t group, uint16_t elem);
- bool ReplaceOrCreate(uint8_t *binArea, int lgth,
uint16_t group, uint16_t elem);
+ bool Insert(std::string const &content,
+ uint16_t group, uint16_t elem);
+ bool Insert(uint8_t *binArea, int lgth,
+ uint16_t group, uint16_t elem);
uint8_t* GetLutRGBA();
Program: gdcm
Module: $RCSfile: gdcmSQItem.cxx,v $
Language: C++
- Date: $Date: 2005/01/24 16:10:53 $
- Version: $Revision: 1.57 $
+ Date: $Date: 2005/01/24 16:44:54 $
+ Version: $Revision: 1.58 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
if ( ( group < (*i)->GetGroup() )
||( group == (*i)->GetGroup() && elem < (*i)->GetElement()) )
{
- // instead of ReplaceOrCreate
- // that is a method of Document :-(
+ // instead of Insert, that is a method of Document :-(
ValEntry* entry = 0;
TagKey key = DictEntry::TranslateToKey(group, elem);