LDicomDir::LoadDS
#include "Ltdic.h"
L_UINT16 LDicomDir::LoadDS(pszName, nFlags)
L_CHAR * pszName; |
/* DICOMDIR filename */ |
L_UINT16 nFlags; |
/* flags that indicate the file characteristics */ |
Loads the DICOM Directory Data Set from the specified file.
Parameter |
Description |
|
pszName |
Character string that contains the name of the DICOMDIR File. |
|
nFlags |
Meta-header flags and Transfer Syntax flags that indicate the file characteristics to use when loading the file. Possible values for the Meta-header flags are: |
|
|
Value |
Meaning |
|
0 |
[0x0000] LEADTOOLS will automatically determine the presence or absence of the Meta-header. |
|
DS_METAHEADER_PRESENT |
[0x0001] The header is present. |
|
DS_METAHEADER_ABSENT |
[0x0002] The header is absent. |
|
Possible values and combinations for the Transfer Syntax flags are: |
|
|
0 |
[0x0000] LEADTOOLS will automatically determine the Transfer Syntax. |
|
DS_LITTLE_ENDIAN |
[0x0004] Byte order is Little Endian. |
|
DS_BIG_ENDIAN |
[0x0008] Byte order is Big Endian. |
|
DS_IMPLICIT_VR |
[0x0010] The Value Representation is implicit. |
|
DS_EXPLICIT_VR |
[0x0020] The Value Representation is explicit. |
|
DS_LITTLE_ENDIAN | DS_IMPLICIT_VR |
|
|
DS_LITTLE_ENDIAN | DS_EXPLICIT_VR |
|
|
DS_BIG_ENDIAN | DS_EXPLICIT_VR |
|
|
DS_LOAD_CLOSE |
[0x0200] The file will be loaded and closed. |
|
Any of the available Meta-header flags given above may be combined with any of the available values or combinations of values for the Transfer Syntax flags given above. For example, you may combine DS_METAHEADER_ABSENT with DS_EXPLICIT_VR, or you may combine DS_METAHEADER_PRESENT with DS_LITTLE_ENDIAN | DS_EXPLICIT_VR, etc. |
Returns
0 |
The function was successful. |
> 0 |
An error occurred. Refer to Return Codes. |
Comments
In addition to loading the DICOM Directory Data Set, the function also sets the destination folder to the folder in which the specified DICOMDIR File resides. Additional DICOM files in this folder (and subfolders) can be added to the loaded Directory.
If DS_LOAD_CLOSE is not specified, the file will remain open until one of the following functions is called: LDicomDir::ResetDicomDir, LDicomDir::LoadDS (again), LDicomDS::ResetDS, LDicomDS::InitDS, or LDicomDS::LoadDS.
For more information, refer to the overridden function LDicomDS::LoadDS.
Required DLLs and Libraries
LTDIC For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application |
See Also
Functions: |
|
Topics: |
Example
L_VOID TestLoadingDicomDir()
{
LDicomDir DicomDir;
// Load a DICOMDIR File. Note: It is necessary to specify
// DS_LOAD_CLOSE so that we can save the Directory later.
DicomDir.LoadDS("C:\\Medical Images\\DICOMDIR", DS_LOAD_CLOSE);
// Add some additional DICOM files to the loaded Directory
DicomDir.InsertDicomFile("C:\\Medical Images\\Image");
DicomDir.InsertDicomFile("C:\\Medical Images\\Patient 2\\Image1");
// Save the DICOMDIR File
DicomDir.SaveDicomDir();
}