vil_dicom.h
Go to the documentation of this file.
1 // This is core/vil/file_formats/vil_dicom.h
2 #ifndef vil_dicom_file_format_h_
3 #define vil_dicom_file_format_h_
4 //:
5 // \file
6 // \brief Reader/Writer for DICOM format 2D images.
7 // \author Amitha Perera
8 //
9 // This dicom parser is a wrapper around DCMTK.
10 
11 #include <vil/vil_image_resource.h>
12 #include <vil/vil_file_format.h>
14 
15 class DicomImage;
17 class DcmFileFormat;
18 
20 
21 
22 //: Loader for DICOM files
24 {
25  public:
26  virtual char const* tag() const;
29  unsigned ni,
30  unsigned nj,
31  unsigned nplanes,
32  vil_pixel_format format);
33 };
34 
35 
36 //: Generic image implementation for DICOM files
38 {
41 
42  public:
43  vil_dicom_image(vil_stream* is, unsigned ni,
44  unsigned nj, unsigned nplanes,
45  vil_pixel_format format);
48 
49  virtual unsigned nplanes() const;
50  virtual unsigned ni() const;
51  virtual unsigned nj() const;
52 
53  virtual enum vil_pixel_format pixel_format() const;
54 
55  virtual vil_image_view_base_sptr get_copy_view(unsigned i0, unsigned ni,
56  unsigned j0, unsigned nj) const;
57 
58  virtual vil_image_view_base_sptr get_view(unsigned i0, unsigned ni,
59  unsigned j0, unsigned nj) const;
60 
61  virtual bool put_view(const vil_image_view_base& im, unsigned i0, unsigned j0);
62 
63  char const* file_format() const;
64  bool get_property(char const *tag, void *prop = 0) const;
65 
66  // Dicom specific stuff
67  vil_dicom_header_info const& header() const { return header_; }
68 
69  //:correct known manufacturers drop-offs in header data!
70  //For example Hologic encode pixel-size in the imageComment!
71  //NB if this section starts bloating, use derived classes which override correct_manufacturer_discrepancies
73 
74  //:try and interpret the hologic comments section to extract pixel size
75  virtual bool interpret_hologic_header(float& xpixSize, float& ypixSize);
76 };
77 
78 #endif // vil_dicom_file_format_h_
An abstract base class of smart pointers to actual image data in memory.
vil_pixel_format
Describes the type of the concrete data.
virtual char const * tag() const
Return a character string which uniquely identifies this format.
virtual vil_image_resource_sptr make_input_image(vil_stream *vs)
Attempt to make a generic_image which will read from vil_stream vs.
vil_dicom_image(vil_stream *is, unsigned ni, unsigned nj, unsigned nplanes, vil_pixel_format format)
Loader for DICOM files.
Definition: vil_dicom.h:23
virtual bool interpret_hologic_header(float &xpixSize, float &ypixSize)
try and interpret the hologic comments section to extract pixel size.
Base class for image formats.
vil_dicom_header_info header_
Definition: vil_dicom.h:39
vil_dicom_header_info const & header() const
Definition: vil_dicom.h:67
char const * file_format() const
Return a string describing the file format.
Stream interface for VIL image loaders.
Definition: vil_stream.h:21
virtual void correct_manufacturer_discrepancies()
correct known manufacturers drop-offs in header data!.
virtual enum vil_pixel_format pixel_format() const
Pixel Format.
DICOM information read from the header.
Abstract representation of an image source or image destination.
virtual unsigned ni() const
Dimensions: Planes x ni x nj.
vil_image_view_base_sptr get_copy_view() const
Create a read/write view of a copy of all the data.
DICOM Header reader and writer.
Representation of a generic image source or destination.
virtual bool put_view(const vil_image_view_base &im, unsigned i0, unsigned j0)
Put the data in this view back into the image source.
virtual unsigned nplanes() const
Dimensions: Planes x ni x nj.
Base class for image formats.
virtual vil_image_resource_sptr make_output_image(vil_stream *vs, unsigned ni, unsigned nj, unsigned nplanes, vil_pixel_format format)
vil_image_resource_sptr pixels_
Definition: vil_dicom.h:40
Generic image implementation for DICOM files.
Definition: vil_dicom.h:37
vil_image_view_base_sptr get_view() const
Create a read/write view of all the data.
bool get_property(char const *tag, void *prop=0) const
Extra property information.
virtual unsigned nj() const
Dimensions: Planes x ni x nj.