⚠️ Ceci est un site de traduction non officiel, sans lien avec DCMTK / OFFIS. Pour des informations faisant autorité, consultez la page originale (https://support.dcmtk.org/docs/mod_dcmpstat.html).

dcmpstat: bibliothèque de presentation state et applications utilitaires

Ce module contient des classes qui implémentent une API de haut niveau pour la DICOM Softcopy Grayscale Presentation State Storage SOP Class. Il contient également diverses classes de support utilisées par DICOMscope, un visualiseur DICOM gratuit développé comme démonstrateur pour les presentation states. Consultez https://dicom.offis.de/en/dicomscope/

Les principales classes d'interface sont :

Outils

Ce module contient les outils en ligne de commande suivants :

Exemples

L'exemple suivant montre comment créer une presentation state par défaut pour une image DICOM :

DcmFileFormat infile;
DcmFileFormat outfile;
if (infile.loadFile("image.dcm").good())
{
 DVPresentationState pstate; // presentation state handler
 if (pstate.createFromImage(*infile.getDataset()).good())
  {
 // serialize presentation state into DICOM data set structure
 if (pstate.write(*outfile.getDataset(), OFFalse).good())
    {
 // and write to file
      outfile.saveFile("gsps.dcm", EXS_LittleEndianExplicit);
    }
  }
}

L'exemple suivant montre comment appliquer le pipeline de transformation en niveaux de gris d'une presentation state à une image DICOM :

DcmFileFormat imagefile;
DcmFileFormat gspsfile;
if (imagefile.loadFile("image.dcm").good() &&
    gspsfile.loadFile("gsps.dcm").good())
{
 DVPresentationState pstate; // presentation state handler
 if (pstate.read(*gspsfile.getDataset()).good()) // parse gsps object
  {
 // attach presentation state to image data
 if (pstate.attachImage(&imagefile, OFFalse).good())
    {
 const void *pixel; // pointer to pixel data, one byte per pixel
 unsigned long width;   // width of image bitmap
 unsigned long height;  // height of image bitmap
 if (pstate.getPixelData(pixel, width, height).good())
      {
 /* do something useful with the pixel data */
      }
      pstate.detachImage(); // release connection between GSPS and image
    }
  }
}