GdPicture.NET.14
GdPicture14 Namespace / GdPictureImaging Class / DicomGetTagValue Method
GdPicture image identifier. The DICOM image.
The tag index. Must be a value in the range 0 ; DicomGetTagsCount() -1.
Example





In This Topic
DicomGetTagValue Method (GdPictureImaging)
In This Topic
Returns the value, as string, of a specific tag available in a DICOM image.
Syntax
'Declaration
 
Public Function DicomGetTagValue( _
   ByVal ImageID As Integer, _
   ByVal TagIdx As Integer _
) As String
public string DicomGetTagValue( 
   int ImageID,
   int TagIdx
)
public function DicomGetTagValue( 
    ImageID: Integer;
    TagIdx: Integer
): String; 
public function DicomGetTagValue( 
   ImageID : int,
   TagIdx : int
) : String;
public: string* DicomGetTagValue( 
   int ImageID,
   int TagIdx
) 
public:
String^ DicomGetTagValue( 
   int ImageID,
   int TagIdx
) 

Parameters

ImageID
GdPicture image identifier. The DICOM image.
TagIdx
The tag index. Must be a value in the range 0 ; DicomGetTagsCount() -1.

Return Value

The value of the specified tag.
Remarks
Use the GetStat() method to determine if the method succeeded.
Example
Reading the tags from a dicom document.
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
    int imageID = gdpictureImaging.CreateGdPictureImageFromFile("image.dcm", false);
 
    // Write in a report all the tags available within the file.
    StringBuilder report = new StringBuilder();
    int tagCount = gdpictureImaging.DicomGetTagsCount(imageID);
    for (int tagNo = 1; tagNo <= tagCount; tagNo++)
    {
        string tagDescription = gdpictureImaging.DicomGetTagDescription(imageID, tagNo);
        string tagValue = gdpictureImaging.DicomGetTagValue(imageID, tagNo);
 
        report.AppendLine(tagDescription.ToString() + " " + tagValue.ToString());
    }
    gdpictureImaging.ReleaseGdPictureImage(imageID);
 
    MessageBox.Show(report.ToString(), "Tags", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
See Also