Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, January 7, 2013 5:33:47 PM(UTC)

kb7  
kb7

Groups: Registered
Posts: 71


Hello,

I would like to reterive dicom tags like patientname,patientid etc from image using CDLL and Leadtools v17.
Can you please tell me how to do this?


Thanks..
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, January 8, 2013 6:23:20 AM(UTC)

Ibrahim  
Guest

Groups: Guests
Posts: 3,040

Was thanked: 1 time(s) in 1 post(s)

If you have our Medical toolkit, you can use the L_DicomFindFirstElement() function to return a pointer to the first item in the Data Set with the specified tag.
After loading datase, You can use the L_DicomFindFirstElement() with the tags you need such as TAG_PATIENT_NAME and TAG_PATIENT_ID.

For more information about this function, refer to our help topic "L_DicomFindFirstElement" in our DICOM C DLL help topic.
 
#3 Posted : Wednesday, January 9, 2013 1:23:08 AM(UTC)

kb7  
kb7

Groups: Registered
Posts: 71


Hello,

I am trying the following code:

LDicomDS*      pDS;
   pDICOMELEMENT  pRoot;
   pDICOMELEMENT  pElement;
   pDICOMTAG      pTag;
   L_TCHAR        szUnknown[]=TEXT("Unknown");
   L_TCHAR*       p;

   pDS = new LDicomDS(szFileName); //szFileName is the Path of the file{ C:\\test.dcm}
   pDS->InitDS( CLASS_NM_IMAGE_STORAGE, 0);
   pElement = pDS->FindFirstElement(NULL, TAG_PATIENT_NAME, FALSE);
   if (pElement != NULL)
   {
      pRoot = pDS->GetRootElement(pElement);
      
      pTag = LDicomTag::Find(pRoot->nTag);
      if (pTag != NULL)
      {
         p = pTag->pszName;
      }
      else
      {
         p = szUnknown;
      }
      MessageBox(NULL, p, TEXT("Notice"), MB_OK);
   }

But using this I am only able to get string i.e. "Patient Name", not the exact value of Patient Name i.e. "Kishore".

Can you please send me the correct code to get the value "Patient Name: Kishore" from the DICOM file?


Thanks...
 
#4 Posted : Thursday, January 10, 2013 12:03:52 AM(UTC)

kb7  
kb7

Groups: Registered
Posts: 71


I also try this one:

   HDICOMDS      hDS;
pDICOMELEMENT pElement;
pDICOMTAG pTag;
L_TCHAR szUnknown[]=TEXT("Unknown");
L_TCHAR *p;

hDS = L_DicomCreateDS(Filename);//"C:\\test.dcm"

L_DicomInitDS(hDS, CLASS_XA_IMAGE_STORAGE, 0);

pElement = L_DicomFindFirstElement(hDS, NULL, TAG_PATIENT_NAME, FALSE);
if (pElement != NULL)
{
pTag = L_DicomFindTag(pElement->nTag);
if (pTag != NULL)
{
p = pTag->pszName;
}
else
{
p = szUnknown;
}

SendMessage(hDlg, LB_ADDSTRING, (WPARAM)0, (LPARAM)(LPCTSTR)p);

pElement = L_DicomFindNextElement(hDS, pElement, FALSE);
}
But still getting "Patient's Name" ,not the name of the patient exactly.

Please help me to come out of this.

Thanks
 
#5 Posted : Friday, January 11, 2013 12:52:41 PM(UTC)

Walter  
Walter

Groups: Tech Support, Administrators
Posts: 368

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)

If you have not done so already, I would recommend checking out the help file topic Working with Data Sets in our C DLL help file. This will give you helpful information on navigating through and using DICOM Datasets with LEADTOOLS.

Once you get the particular element that has the data, you must then get the data from the element. The type of data will be specific to the element you have. Since you are getting the patient name, you should use L_DicomGetStringValue() after getting the element with the data you need.
Walter Bates
Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
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.

Powered by YAF.NET | YAF.NET © 2003-2019, Yet Another Forum.NET
This page was generated in 0.155 seconds.