File: dcmpstat.dox

package info (click to toggle)
dcmtk 3.6.9-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 95,524 kB
  • sloc: ansic: 426,874; cpp: 318,164; makefile: 6,399; sh: 4,341; yacc: 1,026; xml: 482; lex: 321; perl: 277
file content (80 lines) | stat: -rw-r--r-- 2,258 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*!

\page mod_dcmpstat dcmpstat: a presentation state library and utility apps

This module contains classes that implement a high-level API for the DICOM
Softcopy Grayscale Presentation State Storage SOP Class.  It also contains
various support classes that are used by DICOMscope, a free DICOM viewer that
has been developed as a demonstrator for presentation states.
See https://dicom.offis.de/en/dicomscope/

The main interface classes are:
\li \b DVPresentationState
\li \b DVInterface
\li \b DVPSStoredPrint

\section Tools

This module contains the following command line tools:
\li \ref dcmmkcrv
\li \ref dcmmklut
\li \ref dcmp2pgm
\li \ref dcmprscp
\li \ref dcmprscu
\li \ref dcmpschk
\li \ref dcmpsmk
\li \ref dcmpsprt
\li \ref dcmpsrcv
\li \ref dcmpssnd

\section Examples

The following example shows how to create a default presentation state for a DICOM image:

\code
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);
    }
  }
}
\endcode

The following example shows how to apply the grayscale transformation pipeline
from a presentation state to a DICOM image:

\code
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
    }
  }
}
\endcode

*/