LDicomDir::InsertDicomDS

#include "Ltdic.h"

L_UINT16 LDicomDir::InsertDicomDS(DataSet, pszFileName)

LDicomDS & DataSet;

/* LDicomDS object */

L_CHAR * pszFileName;

/* DICOM file name */

Adds a DICOM Data Set to the Dicom Directory.

Parameter

Description

DataSet

The LDicomDS object that holds the Data Set to be added to the Dicom Directory.

pszFileName

Character string that contains the name of the DICOM file referenced by the object "DataSet".

Returns

0

The function was successful.

> 0

An error occurred. Refer to Return Codes.

Comments

If the name of a DICOM file is to be specified, then before using this function, a destination folder must have been specified, either at the construction time or by the function LDicomDir::ResetDicomDir. Otherwise, the function will fail.

The DICOM filename must refer to an existing file that resides in the destination folder or in a subfolder of the destination folder. Otherwise, the function will fail and the Data Set will not be added to the Dicom Directory. Please notice that the filename passed to the function must specify the absolute path of the file, not the relative one.

If the parameter pszFileName is set to NULL, a Data Set can still be added, even if no destination folder is specified. (That is, if pszFileName is set to NULL and the destination folder has not been set, a Data Set can still be added.) In this case, no DICOM file will be referenced for this Data Set (i.e., the corresponding Referenced File ID (0004,1500) will have an empty value).

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:

LDicomDir::InsertDicomFile, LDicomDir::LDicomDir, LDicomDir::ResetDicomDir, Class Members

Topics:

Creating DICOM Directories

 

Dicom Directories

Example

L_VOID CreateDicomDirectory()
{
LDicomDir DicomDir;

// Set the destination folder
DicomDir.
ResetDicomDir("C:\\Medical Images\\Patient 1");

// Set the File-set Identifier
DicomDir.
SetFileSetID("SOME ID");

// Don't allow invalid File IDs
DICOMDIROPTIONS Options;
DicomDir.
GetOptions(&Options, sizeof(DICOMDIROPTIONS));
Options.uFlags |= DICOMDIR_REJECT_INVALID_FILEID;
DicomDir.
SetOptions(&Options);

// Set the File-set descriptor file
DicomDir.
SetDescriptorFile("C:\\Medical Images\\Patient 1\\ReadMe", NULL);

// Load a Data Set and add it to the Directory
LDicomDS DicomDS;
DicomDS.
LoadDS("C:\\Medical Images\\Patient 1\\Image1", DS_LOAD_CLOSE);
DicomDir.
InsertDicomDS(DicomDS, "C:\\Medical Images\\Patient 1\\Image1");

// Add some DICOM files to the Directory
DicomDir.
InsertDicomFile("C:\\Medical Images\\Patient 1\\Image2");
DicomDir.InsertDicomFile("C:\\Medical Images\\Patient 1\\Image3");
DicomDir.InsertDicomFile("C:\\Medical Images\\Patient 1\\Image4");

// Save the DICOMDIR File
DicomDir.
SaveDicomDir();
}