#include "Ltdic.h"
L_LTDIC_APIL_INT64L_DicomGetElementOffset(hDS, pElement)
Returns the offset of the DICOM element pElement in the DICOM file.
A DICOM handle.
Pointer to aDICOMELEMENTstructure within the Data Set.
Value | Meaning |
---|---|
DICOM_SUCCESS | The offset of the element is unknown. |
>0 | The offset of the element in the DICOM file. |
You must load a DICOM file using the flag DS_LOAD_STORE_OFFSETS to use this function. Otherwise, L_DicomGetElementOffset will always return 0.
This method is used to return the offset (or physical location) in a DICOM file of any DICOM element.
Required DLLs and Libraries
Win32, x64, Linux.
This example loads a DICOM file, and finds the physical offset of the TAG_PATIENT_ID in the file.
L_VOID DicomGetElementOffsetExample()
{
HDICOMDS hDS = L_DicomCreateDS(NULL);
if(hDS == NULL)
return;
L_TCHAR *pszFile = MAKE_IMAGE_PATH(TEXT("image2.dcm"));
L_DicomLoadDS(hDS, pszFile, DS_LOAD_STORE_OFFSETS);
pDICOMELEMENT pElement = L_DicomFindFirstElement(hDS, NULL, TAG_PATIENT_ID, TRUE);
if(pElement == NULL)
return;
// uOffset will contain the file offset of the TAG_PATIENT_ID element
L_INT64 uOffset = L_DicomGetElementOffset(hDS, pElement);
L_TCHAR szMsg[200]={0};
wsprintf(szMsg, TEXT("The offset of the TAG_PATIENT_ID in file '%s' is: 0x%x"), pszFile, uOffset);
OutputDebugString(szMsg);
// Clean up
L_DicomFreeDS(hDS);
}
This example loads a DICOM file, and finds the physical offset of the TAG_PATIENT_ID in the file.
#define MAKE_IMAGE_PATH(pFileName) TEXT("C:\\LEADTOOLS21\\Resources\\Images\\")pFileName
L_VOID DicomGetElementOffsetExample()
{
HDICOMDS hDS = L_DicomCreateDS(NULL);
if(hDS == NULL)
return;
L_TCHAR *pszFile = MAKE_IMAGE_PATH(TEXT("image2.dcm"));
L_DicomLoadDS(hDS, pszFile, DS_LOAD_STORE_OFFSETS);
pDICOMELEMENT pElement = L_DicomFindFirstElement(hDS, NULL, TAG_PATIENT_ID, TRUE);
if(pElement == NULL)
return;
// uOffset will contain the file offset of the TAG_PATIENT_ID element
L_INT64 uOffset = L_DicomGetElementOffset(hDS, pElement);
L_TCHAR szMsg[200]={0};
wsprintf(szMsg, TEXT("The offset of the TAG_PATIENT_ID in file '%s' is: 0x%x"), pszFile, uOffset);
OutputDebugString(szMsg);
// Clean up
L_DicomFreeDS(hDS);
}
Help Collections
Raster.NET|C API|C++ Class Library|HTML5 JavaScript
Document.NET|C API|C++ Class Library|HTML5 JavaScript
Medical.NET|C API|C++ Class Library|HTML5 JavaScript
Medical Web Viewer.NET
188宝金博怎么下载
Media Foundation.NET|C API|Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
周一——周五,上午6点等
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
联系我们请填写这张表格,我们很快就会回来的l contact you via email.