Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals

dcmutil.c File Reference

#include "idio.h"
#include "iddicom.h"
#include "iddcm-restricted.h"
#include "iderr.h"
#include <string.h>
#include <stdlib.h>
#include <netinet/in.h>
#include "idliste.h"

Go to the source code of this file.

Defines

#define LGR_ENTETE_A_LIRE   256
#define DEBUG   0
#define DEBUG   0
#define DEBUG   0
#define CHAR_BIT   8

Functions

char * _IdStrShowTransfertSyntax (char *codeTransfSynt)
 Retourne le libelle en clair d'une TRANSFERT SYNTAX.

char ** _IdDcmInquireImageInfoXXX (ID_DCM_HDR *, char **)
ID_DCM_HDRIdDcmHdrAlloc ()
 Alloue un ID_DCM_HDR.

void IdDcmHdrFree (ID_DCM_HDR *e)
 Libere un ID_DCM_HDR.

short int _IdDcmSWAP_SHORT (short int a, int sw)
uint32_t _IdDcmSWAP_LONG (uint32_t a, int sw)
ID_DCM_HDRIdDcmGetHeader (char *filename)
 renvoie un pointeur sur le ID_DCM_HDR correspondant au fichier

_ID_DCM_ELEM_IdDcmReadNextElement (ID_DCM_HDR *e, int sw)
 lit le dicom_element suivant. (le fichier doit deja avoir ete ouvert, _IdAcrCheckSwap(ID_DCM_HDR *e) avoir ete appele)

_ID_DCM_ELEM_IdDcmReadNextElementLeonardo (ID_DCM_HDR *e, int sw)
 lit le dicom_element suivant. (le fichier doit deja avoir ete ouvert, _IdAcrCheckSwap(ID_DCM_HDR *e) avoir ete appele)

ID_DCM_HDRIdDcmGetHeaderLeonardo (char *filename)
 renvoie un pointeur sur le ID_DCM_HDR correspondant au fichier

char ** IdDcmInquireImageInfoFromFile (char *filename)
 renvoie dans un tableau de chaines de caracteres la description des info pertinentes d'une image ACR /DCM (la soixantaine de champs utiles) a partir du nom du fichier

char ** IdDcmInquireImageInfoFromDcmHdr (ID_DCM_HDR *e)
 renvoie dans un tableau de chaines de caracteres la description des info pertinentes d'une image ACR /DCM a partir d'un ID_DCM_HDR deja fabrique

char * _IdDcmReadElementFromLabel (char *libelle, ID_DCM_HDR *e, char *vr, void *buff)
 Tente de lire un dicom_element a partir de son libelle. Le resultat est range dans buff.

int IdDcmPrintImageInfo (char **TableauImageInfo)
 imprime la description des info 'pertinentes' d'une image DICOM obtenue par IdDcmInquireImageInfoFromXXX (File/DcmHdr)

void IdDcmAffDcmHdr (ID_DCM_HDR *e, int npriv, int noffset)
ID_DCM_HDRIdDcmIsDcmReadable (char *filename)
 Verifie le caractère Acr/Dcm/LibIdo d'un fichier.

int IdDcmIsJpegLossless (ID_DCM_HDR *e)
 Verifie le caractère Jpeg Lossless d'un fichier, a partir du DCM_HDR.

int IdDcmIsUncompressed (ID_DCM_HDR *e)
 Verifie le caractère non compresse d'un fichier, a partir du DCM_HDR.


Define Documentation

#define CHAR_BIT   8
 

#define DEBUG   0
 

Definition at line 728 of file dcmutil.c.

#define DEBUG   0
 

Definition at line 728 of file dcmutil.c.

#define DEBUG   0
 

Definition at line 728 of file dcmutil.c.

#define LGR_ENTETE_A_LIRE   256
 

Definition at line 53 of file dcmutil.c.

Referenced by IdDcmHdrAlloc().


Function Documentation

char ** _IdDcmInquireImageInfoXXX ID_DCM_HDR ,
char ** 
 

Definition at line 1275 of file dcmutil.c.

References _ID_dicom_info, _ID_Number_of_Items, and DICOM_INFO.

Referenced by IdDcmInquireImageInfoFromDcmHdr(), and IdDcmInquireImageInfoFromFile().

char* _IdDcmReadElementFromLabel char *  libelle,
ID_DCM_HDR e,
char *  vr,
void *  buff
 

Tente de lire un dicom_element a partir de son libelle. Le resultat est range dans buff.

Parameters:
libelle Libelle de l'acr_element a lire. Il s'agit du dernier champ de la variable globale _ID_dicom_elements, tel que "Group Length", "Priority" ou encore "AE Title".
e ID_DCM_HDR dans lequel effectuer la recherche.
vr DICOM_VR (cf la variable globale _ID_dicom_vr) retourne', pour permettre a l'appelant d'interpreter le contenu de buff.
buff Ou placer l'acr_element en cas de succes. Si NULL, l'allocation est faite localement.
Returns:
En cas de succes, le contenu de l'acr_element lu. Null en cas d'echec.

Definition at line 1432 of file dcmutil.c.

References _IdDcmReadElement(), and DEBUG.

_ID_DCM_ELEM* _IdDcmReadNextElement ID_DCM_HDR e,
int  sw
 

lit le dicom_element suivant. (le fichier doit deja avoir ete ouvert, _IdAcrCheckSwap(ID_DCM_HDR *e) avoir ete appele)

Parameters:
e ID_DCM_HDR dans lequel effectuer la recherche.
sw code swap.
Returns:
En cas de succes, 1 0 en cas d'echec.

Definition at line 525 of file dcmutil.c.

References ID_DCM_HDR::__NumeroGroupePrecedent, _IdDcmSWAP_LONG(), _IdDcmSWAP_SHORT(), DEBUG, ID_DCM_HDR::fp, _ID_DCM_ELEM::Gr, ID_DCM_HDR::grPixel, ID_DCM_HDR::grPixelTrouve, _ID_DCM_ELEM::LgrElem, _ID_DCM_ELEM::LgrLueElem, ID_DCM_HDR::nbElem, _ID_DCM_ELEM::Num, ID_DCM_HDR::numPixel, _ID_DCM_ELEM::Offset, ID_DCM_HDR::offsetCourant, ID_DCM_HDR::PixelPosition, ID_DCM_HDR::PixelsTrouves, ID_DCM_HDR::pleCourant, str2num, _ID_DCM_ELEM::Swap, ID_DCM_HDR::taille_fich, _ID_DCM_ELEM::valeurElem, _ID_DCM_ELEM::valInt, _ID_DCM_ELEM::valShort, and _ID_DCM_ELEM::VR.

Referenced by IdDcmGetHeader().

_ID_DCM_ELEM* _IdDcmReadNextElementLeonardo ID_DCM_HDR e,
int  sw
 

lit le dicom_element suivant. (le fichier doit deja avoir ete ouvert, _IdAcrCheckSwap(ID_DCM_HDR *e) avoir ete appele)

Parameters:
e ID_DCM_HDR dans lequel effectuer la recherche.
sw code swap.
Returns:
En cas de succes, 1 0 en cas d'echec.

Definition at line 765 of file dcmutil.c.

References ID_DCM_HDR::__NumeroGroupePrecedent, _IdDcmSWAP_LONG(), _IdDcmSWAP_SHORT(), DEBUG, ID_DCM_HDR::fp, _ID_DCM_ELEM::Gr, ID_DCM_HDR::grPixel, ID_DCM_HDR::grPixelTrouve, _ID_DCM_ELEM::LgrElem, _ID_DCM_ELEM::LgrLueElem, ID_DCM_HDR::nbElem, _ID_DCM_ELEM::Num, ID_DCM_HDR::numPixel, _ID_DCM_ELEM::Offset, ID_DCM_HDR::offsetCourant, ID_DCM_HDR::PixelPosition, ID_DCM_HDR::PixelsTrouves, ID_DCM_HDR::pleCourant, _ID_DCM_ELEM::Swap, ID_DCM_HDR::taille_fich, _ID_DCM_ELEM::valeurElem, _ID_DCM_ELEM::valInt, _ID_DCM_ELEM::valShort, and _ID_DCM_ELEM::VR.

Referenced by IdDcmGetHeaderLeonardo().

uint32_t _IdDcmSWAP_LONG uint32_t  a,
int  sw
 

Definition at line 133 of file dcmutil.c.

Referenced by _IdDcmReadNextElement(), _IdDcmReadNextElementLeonardo(), and IdDcmReadFileIntoVectorFromDcmHdr().

short int _IdDcmSWAP_SHORT short int  a,
int  sw
 

Definition at line 122 of file dcmutil.c.

Referenced by _IdDcmReadNextElement(), and _IdDcmReadNextElementLeonardo().

char* _IdStrShowTransfertSyntax char *  codeTransfSynt  ) 
 

Retourne le libelle en clair d'une TRANSFERT SYNTAX.

Parameters:
nom Pointeur vers la chaine Transf Synt
Returns:
libelle en clair

Definition at line 1070 of file str.c.

void IdDcmAffDcmHdr ID_DCM_HDR e,
int  npriv,
int  noffset
 

Definition at line 1560 of file dcmutil.c.

References _ID_dicom_elements, _IdStrShowTransfertSyntax(), __Dicom__el__::dicom_elem, __Dicom__el__::dicom_group, __Dicom__el__::dicom_libelle, __Dicom__el__::dicom_type, _ID_DCM_ELEM::Gr, IdLstFirst, IdLstNext, IdLstPtrObj, _ID_DCM_ELEM::LgrElem, _ID_DCM_ELEM::LgrLueElem, _ID_DCM_ELEM::Num, _ID_DCM_ELEM::Offset, ID_DCM_HDR::plist, str2num, _ID_DCM_ELEM::valeurElem, and _ID_DCM_ELEM::VR.

ID_DCM_HDR* IdDcmGetHeader char *  filename  ) 
 

renvoie un pointeur sur le ID_DCM_HDR correspondant au fichier

Parameters:
filename Nom du fichier ACR / LibIDO / DICOM
Returns:
le ID_DCM_HDR

Definition at line 168 of file dcmutil.c.

References ID_DCM_HDR::__NumeroGroupePrecedent, _IdDcmReadNextElement(), DEBUG, ID_DCM_HDR::filename, ID_DCM_HDR::fp, _ID_DCM_ELEM::Gr, ID_DCM_HDR::grPixelTrouve, ID_RFILE_BIN, IdDcmHdrAlloc(), IdDcmHdrFree(), IdLstAddLast, IdLstFirst, IdLstNext, IdLstPtrObj, _ID_DCM_ELEM::Num, ID_DCM_HDR::PixelPosition, ID_DCM_HDR::PixelsTrouves, ID_DCM_HDR::plist, str2num, ID_DCM_HDR::sw, ID_DCM_HDR::taille_fich, and _ID_DCM_ELEM::valeurElem.

Referenced by IdDcmInquireImageInfoFromFile(), IdDcmInquireInfoFromFile(), IdDcmIsDcmReadable(), and IdDcmReadFileIntoVector().

ID_DCM_HDR* IdDcmGetHeaderLeonardo char *  filename  ) 
 

renvoie un pointeur sur le ID_DCM_HDR correspondant au fichier

Parameters:
filename Nom du fichier ACR / LibIDO / DICOM
Returns:
le ID_DCM_HDR

Definition at line 982 of file dcmutil.c.

References ID_DCM_HDR::__NumeroGroupePrecedent, _IdDcmReadNextElementLeonardo(), DEBUG, ID_DCM_HDR::filename, ID_DCM_HDR::fp, ID_DCM_HDR::grPixelTrouve, ID_RFILE_BIN, IdDcmHdrAlloc(), IdLstAddLast, ID_DCM_HDR::PixelsTrouves, ID_DCM_HDR::plist, ID_DCM_HDR::sw, and ID_DCM_HDR::taille_fich.

ID_DCM_HDR* IdDcmHdrAlloc void   ) 
 

Alloue un ID_DCM_HDR.

Returns:
Pointeur sur structure Allouée, NULL si échec

Definition at line 79 of file dcmutil.c.

References ID_DCM_HDR::deb, IdLstAlloc(), LGR_ENTETE_A_LIRE, and ID_DCM_HDR::plist.

Referenced by IdDcmGetHeader(), and IdDcmGetHeaderLeonardo().

void IdDcmHdrFree ID_DCM_HDR e  ) 
 

Libere un ID_DCM_HDR.

Parameters:
e pointeur sur le ID_DCM_HDR a liberer.
Returns:
void

Definition at line 108 of file dcmutil.c.

References ID_DCM_HDR::deb, IdLstFree, and ID_DCM_HDR::plist.

Referenced by IdDcmGetHeader(), IdDcmInquireInfoFromFile(), and IdDcmReadFileIntoVector().

char** IdDcmInquireImageInfoFromDcmHdr ID_DCM_HDR e  ) 
 

renvoie dans un tableau de chaines de caracteres la description des info pertinentes d'une image ACR /DCM a partir d'un ID_DCM_HDR deja fabrique

Parameters:
e ID_DCM_HDR de l'image
Returns:
Tableau :
Pour avoir la liste a jour des elements renvoyes dans ce tableau, Consulter src/idacr.h et src/dicom.c

Definition at line 1257 of file dcmutil.c.

References _IdDcmInquireImageInfoXXX(), IDERR_NON_ACR_FILE, and IdErrno.

char** IdDcmInquireImageInfoFromFile char *  filename  ) 
 

renvoie dans un tableau de chaines de caracteres la description des info pertinentes d'une image ACR /DCM (la soixantaine de champs utiles) a partir du nom du fichier

Parameters:
filename Nom du fichier.
Returns:
ID_DCM_HDR
Pour avoir la liste a jour des elements renvoyes dans ce tableau, Consulter src/idacr.h et src/dicom.c

Definition at line 1209 of file dcmutil.c.

References _IdDcmInquireImageInfoXXX(), IdDcmGetHeader(), IDERR_NON_ACR_FILE, and IdErrno.

ID_DCM_HDR* IdDcmIsDcmReadable char *  filename  ) 
 

Verifie le caractère Acr/Dcm/LibIdo d'un fichier.

Parameters:
filename Nom du Fichier
Returns:
ID_DCM_HDR (ca sera fait pour plus tard) si lisible O sinon.

Definition at line 1708 of file dcmutil.c.

References IdDcmGetHeader().

int IdDcmIsJpegLossless ID_DCM_HDR e  ) 
 

Verifie le caractère Jpeg Lossless d'un fichier, a partir du DCM_HDR.

Parameters:
e ID_DCM_HDR deja cree
Returns:
1 si Jpeg Losless O sinon.

Definition at line 1733 of file dcmutil.c.

References _IdDcmReadElement().

Referenced by IdDcmReadFileIntoVectorFromDcmHdr().

int IdDcmIsUncompressed ID_DCM_HDR e  ) 
 

Verifie le caractère non compresse d'un fichier, a partir du DCM_HDR.

Parameters:
e ID_DCM_HDR deja cree
Returns:
1 si non compresse O sinon.

Definition at line 1773 of file dcmutil.c.

References ID_DCM_HDR::__TrueDicom, and _IdDcmReadElement().

Referenced by IdDcmReadFileIntoVectorFromDcmHdr().

int IdDcmPrintImageInfo char **  TableauImageInfo  ) 
 

imprime la description des info 'pertinentes' d'une image DICOM obtenue par IdDcmInquireImageInfoFromXXX (File/DcmHdr)

Parameters:
TableauImageInfo Tableau des info.
Pour avoir la liste a jour des DICOM Elements renvoyes par IdDcmInquireImageInfo Consultez le fichier src/dicom.c

Returns:
1 : OK 0 : pointeur sur Tableau NULL

Definition at line 1522 of file dcmutil.c.

References _ID_dicom_info, and _ID_Number_of_Items.


Generated on Wed Oct 19 09:28:35 2005 for SIMRI3D by doxygen 1.3.7