+2004-11-15 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
+ * src/gdcmDocument.cxx : now, when using the ReplaceOrCreateByNumber to
+ set a BinEntry, the binArea is copied (like to set a ValEntry, the string
+ is copied).
+ * Test/TestCopyDicom.cxx, Example/TestCopyDicom.cxx : the image data isn't
+ set because already copied when copying the BinEntry's of the header
+ * Test/TestAllReadCompareDicom.cxx : remove warnings
+
2004-11-15 Benoit Regrain <Benoit.Regrain@creatis.insa-lyon.fr>
* FIX : now, the DocEntries are all deleted in the gdcmElementSet.
Two problems appear when doing it :
Program: gdcm
Module: $RCSfile: TestCopyDicom.cxx,v $
Language: C++
- Date: $Date: 2004/11/16 04:26:18 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2004/11/17 10:20:06 $
+ 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
//copy->GetImageData();
- copy->SetImageData(imageData, dataSize);
+ //copy->SetImageData(imageData, dataSize);
std::cout << "--- Copy ----------------------" << std::endl;
std::cout <<std::endl << "DO NOT care about Offset" <<std::endl<<std::endl;;
Program: gdcm
Module: $RCSfile: TestAllReadCompareDicom.cxx,v $
Language: C++
- Date: $Date: 2004/11/16 14:48:19 $
- Version: $Revision: 1.15 $
+ Date: $Date: 2004/11/17 10:20:06 $
+ Version: $Revision: 1.16 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
////// Step 3a:
uint8_t* testedImageData = tested->GetImageData(); // Kludge
+ (void)testedImageData;
+
tested->WriteDcmExplVR( referenceFileName );
std::cerr << " Creating reference baseline file :" << std::endl
<< " " << referenceFileName
Program: gdcm
Module: $RCSfile: TestCopyDicom.cxx,v $
Language: C++
- Date: $Date: 2004/11/16 04:28:20 $
- Version: $Revision: 1.16 $
+ Date: $Date: 2004/11/17 10:20:06 $
+ Version: $Revision: 1.17 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
d = tag->second;
if ( gdcm::BinEntry* b = dynamic_cast<gdcm::BinEntry*>(d) )
- {
+ {
copy->GetHeader()->ReplaceOrCreateByNumber(
b->GetBinArea(),
b->GetLength(),
}
}
- copy->SetImageData(imageData, dataSize);
+ // Useless to set the image datas, because it's already made when
+ // copying the corresponding BinEntry that contains the pixel datas
+ //copy->SetImageData(imageData, dataSize);
original->GetHeader()->SetImageDataSize(dataSize);
copy->WriteDcmExplVR( output );
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2004/11/17 03:20:05 $
- Version: $Revision: 1.132 $
+ Date: $Date: 2004/11/17 10:20:07 $
+ Version: $Revision: 1.133 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/*
* \brief Modifies the value of a given Header Entry (Dicom Element)
* when it exists. Create it with the given value when unexistant.
+ * A copy of the binArea is made to be kept in the Document.
* @param binArea (binary) value to be set
* @param Group Group number of the Entry
* @param Elem Element number of the Entry
}
}
- SetEntryByNumber(binArea, lgth, group, elem);
+ uint8_t *tmpArea;
+ if (lgth>0 && binArea)
+ {
+ tmpArea = new uint8_t[lgth];
+ memcpy(tmpArea,binArea,lgth);
+ }
+ else
+ {
+ tmpArea = 0;
+ }
+ if (!SetEntryByNumber(tmpArea, lgth, group, elem))
+ {
+ if (tmpArea)
+ {
+ delete[] tmpArea;
+ }
+ }
return binEntry;
}