This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Tuesday, December 21, 2010 11:04:36 PM(UTC)
Groups: Registered
Posts: 33
sir i want to change tag value
for example
if i want to change paitient name i am writing code as below
pTag = LDicomTag::Find(TAG_PATIENT_NAME);
if (pTag != NULL)
{
LDicomTag::SetName(pTag, TEXT("New name"));
}
nRet = pDS->SaveDS (TEXT"S:\\test\\work.dcm"), 0);
code execute without error but
when i open it with dicom deta set demo the value is not change it will still show the same old name
thanks samit
#2
Posted
:
Wednesday, December 22, 2010 6:00:52 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
To change a DICOM tag in a Dataset file, you can use this code:
L_INT nRet;
LDicomDS *pDS;
pDICOMELEMENT pElement;
pDS = new LDicomDS(NULL);
/* Load the data set from a DICOM file */
pDS->LoadDS(TEXT("D:\\LT\\images\\test2.dcm"), 0);
pElement = pDS->FindFirstElement(NULL, TAG_PATIENT_NAME, TRUE);
pDS->SetStringValue(pElement, TEXT("New^name"), 1, DICOM_CHARACTER_SET_DEFAULT);
// pDS->SetConvertValue(pElement, TEXT("New^name"), 1);
pElement = pDS->FindFirstElement(NULL, TAG_IMAGE_TYPE, FALSE);
pDS->SetConvertValue(pElement, TEXT("DERIVED\\PRIMARY"), 2);
nRet = pDS->SaveDS (TEXT("S:\\test\\work.dcm"), 0);
pDS->ResetDS();
delete pDS;
The LDicomTag class contains functionality for working with the table, or list (but not DICOM DataSet) of available Data Element Tags that LEADTOOLS maintains internally.
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.