Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
LegacyIO/mitkRawImageFileReader.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef RawImageFileReader_H_HEADER_INCLUDED
18 #define RawImageFileReader_H_HEADER_INCLUDED
19 #include "itkVector.h"
20 #include "mitkFileReader.h"
21 #include "mitkImageSource.h"
22 #include <MitkLegacyIOExports.h>
23 
24 namespace mitk
25 {
26  //##Documentation
27  //## @brief Reader to read raw image files
30  //## @ingroup MitkLegacyIOModule
31  //## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
33  {
34  public:
36 
38  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
39 
40  itkSetMacro(FileName, std::string);
41  itkSetStringMacro(FileName);
42  itkGetMacro(FileName, std::string);
43  itkGetStringMacro(FileName);
44 
45  itkSetMacro(FilePrefix, std::string);
46  itkSetStringMacro(FilePrefix);
47  itkGetMacro(FilePrefix, std::string);
48  itkGetStringMacro(FilePrefix);
49 
50  itkSetMacro(FilePattern, std::string);
51  itkSetStringMacro(FilePattern);
52  itkGetMacro(FilePattern, std::string);
53  itkGetStringMacro(FilePattern);
54 
56  typedef enum { UCHAR, SCHAR, USHORT, SSHORT, UINT, SINT, FLOAT, DOUBLE } IOPixelType;
57  itkSetMacro(PixelType, IOPixelType);
58 
60  typedef enum { LITTLE, BIG } EndianityType;
61  itkSetMacro(Endianity, EndianityType);
62 
63  itkSetMacro(Dimensionality, int);
64  itkGetMacro(Dimensionality, int);
65 
67  void SetDimensions(unsigned int i, unsigned int dim);
68 
69  unsigned int GetDimensions(unsigned int i) const;
70 
71  static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern);
72 
73  protected:
75 
77 
78  virtual void GenerateData() override;
79 
80  template <typename TPixel, unsigned int VImageDimensions>
81  void TypedGenerateData();
82 
84  std::string m_FileName;
85 
87  std::string m_FilePrefix;
88 
90  std::string m_FilePattern;
91 
94 
97 
100 
102  itk::Vector<int, 3> m_Dimensions;
103  };
104 
105 } // namespace mitk
106 
107 #endif /* RawImageFileReader_H_HEADER_INCLUDED */
Superclass of all classes generating Images (instances of class Image) as output. ...
#define MITKLEGACYIO_EXPORT
Superclass of all classes generating some kind of mitk::BaseData.
DataCollection - Class to facilitate loading/accessing structured data.
#define DEPRECATED(func)
Definition: mitkCommon.h:183
static const std::string filename
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
Interface class of readers that read from files.
Reader to read raw image files.
Class for defining the data type of pixels.
Definition: mitkPixelType.h:55