#include "Ltdic.h"
L_DICOM_OFFSET LDicomDS::GetElementOffset(pElement)
Returns the offset of the DICOM element pElement in the DICOM file.
Pointer to a DICOMELEMENT structure within the Data Set.
Value | Meaning |
---|---|
0 | 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, LDicomDS::GetElementOffset will always return 0.
This function is used to return the offset (or physical location) in a DICOM file of any DICOM element.
Required DLLs and Libraries
Win32, x64
This example loads a DICOM file, and finds the physical offset of the TAG_PATIENT_ID in the file.
L_INT LDicomDS_GetElementOffsetExample()
{
L_INT nRet = -1;
LDicomDS *ds = new LDicomDS();
if (ds == NULL)
return nRet;
L_TCHAR *pszFile = MAKE_IMAGE_PATH(TEXT("image2.dcm"));
nRet = ds->LoadDS(pszFile, DS_LOAD_STORE_OFFSETS);
if(nRet != DICOM_SUCCESS)
return nRet;
pDICOMELEMENT pElement = ds->FindFirstElement(NULL, TAG_PATIENT_ID, TRUE);
if (pElement == NULL)
return -1;
// uOffset will contain the file offset of the TAG_PATIENT_ID element
L_UINT64 uOffset = ds->GetElementOffset(pElement);
CString csMsg;
csMsg.Format(TEXT("The offset of the TAG_PATIENT_ID in file '%s' is: 0x%x"), pszFile, uOffset);
OutputDebugString(csMsg);
// Clean up
delete ds;
return nRet;
}
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
Multimedia
Direct Show .NET | C API | Filters
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
Imaging, Medical, and Document
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
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
To contact us please fill out this form and we will contact you via email.