TPCCLIB
Loading...
Searching...
No Matches
dcmsop.c File Reference

DICOM Storage SOPs. More...

#include "tpcclibConfig.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <string.h>
#include "tpcextensions.h"
#include "tpcdcm.h"

Go to the source code of this file.

Functions

unsigned int dcmSOPIdentify (const char *s)
 
char * dcmSOPName (unsigned int i)
 
char * dcmSOPUID (unsigned int i)
 
char * dcmSOPUIDName (const char *s)
 

Detailed Description

DICOM Storage SOPs.

Definition in file dcmsop.c.

Function Documentation

◆ dcmSOPIdentify()

unsigned int dcmSOPIdentify ( const char * s)

Identify the DICOM SOP UID.

Returns
Returns the SOP UID list index.
See also
dcmSOPName, dcmSOPUID
Parameters
sSOP UID string.

Definition at line 62 of file dcmsop.c.

65 {
66 if(s==NULL || strnlen(s, 3)<3) return(0);
67
68 /* Identify the SOP UID */
69 unsigned int i=0;
70 while(strcmp(dcm_sop[i].uid, "unknown")!=0) {
71 if(strcmp(dcm_sop[i].uid, s)==0) return(i);
72 i++;
73 }
74 return(i);
75}
size_t strnlen(const char *s, size_t n)
Definition stringext.c:566

◆ dcmSOPName()

char * dcmSOPName ( unsigned int i)

Get the DICOM SOP UID Name.

Returns
Returns pointer to the SOP Name string.
See also
dcmSOPIdentify, dcmSOPUID
Parameters
iSOP UID list index.

Definition at line 83 of file dcmsop.c.

86 {
87 unsigned int j=0;
88 while(strcmp(dcm_sop[j].uid, "unknown")!=0) {
89 if(i==j) return(dcm_sop[j].name);
90 j++;
91 }
92 return(dcm_sop[j].name);
93}

◆ dcmSOPUID()

char * dcmSOPUID ( unsigned int i)

Get the DICOM SOP UID.

Returns
Returns pointer to the UID string.
See also
dcmSOPIdentify, dcmSOPName
Parameters
iSOP UID list index.

Definition at line 101 of file dcmsop.c.

104 {
105 unsigned int j=0;
106 while(strcmp(dcm_sop[j].uid, "unknown")!=0) {
107 if(i==j) return(dcm_sop[j].uid);
108 j++;
109 }
110 return(dcm_sop[j].uid);
111}

◆ dcmSOPUIDName()

char * dcmSOPUIDName ( const char * s)

Get the name of DICOM SOP UID.

Returns
Returns pointer to the SOP UID name string.
See also
dcmSOPName, dcmSOPUID
Parameters
sSOP UID string.

Definition at line 119 of file dcmsop.c.

122 {
123 if(s==NULL || strnlen(s, 3)<3) return(dcm_sop[0].name);
124
125 /* Identify the SOP UID */
126 unsigned int i=0;
127 while(strcmp(dcm_sop[i].uid, "unknown")!=0) {
128 if(strcmp(dcm_sop[i].uid, s)==0) return(dcm_sop[i].name);
129 i++;
130 }
131 return(dcm_sop[i].name);
132}