Medical Imaging Interaction Toolkit  2018.4.99-bd7b41ba
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef RawImageFileReader_H_HEADER_INCLUDED
14 #define RawImageFileReader_H_HEADER_INCLUDED
15 #include "itkVector.h"
16 #include "mitkFileReader.h"
17 #include "mitkImageSource.h"
18 #include <MitkLegacyIOExports.h>
19 
20 namespace mitk
21 {
22  //##Documentation
23  //## @brief Reader to read raw image files
26  //## @ingroup MitkLegacyIOModule
27  //## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
29  {
30  public:
32 
34  itkFactorylessNewMacro(Self);
35  itkCloneMacro(Self);
36  itkSetMacro(FileName, std::string);
37  itkSetStringMacro(FileName);
38  itkGetMacro(FileName, std::string);
39  itkGetStringMacro(FileName);
40 
41  itkSetMacro(FilePrefix, std::string);
42  itkSetStringMacro(FilePrefix);
43  itkGetMacro(FilePrefix, std::string);
44  itkGetStringMacro(FilePrefix);
45 
46  itkSetMacro(FilePattern, std::string);
47  itkSetStringMacro(FilePattern);
48  itkGetMacro(FilePattern, std::string);
49  itkGetStringMacro(FilePattern);
50 
52  typedef enum { UCHAR, SCHAR, USHORT, SSHORT, UINT, SINT, FLOAT, DOUBLE } IOPixelType;
53  itkSetMacro(PixelType, IOPixelType);
54 
56  typedef enum { LITTLE, BIG } EndianityType;
57  itkSetMacro(Endianity, EndianityType);
58 
59  itkSetMacro(Dimensionality, int);
60  itkGetMacro(Dimensionality, int);
61 
63  void SetDimensions(unsigned int i, unsigned int dim);
64 
65  unsigned int GetDimensions(unsigned int i) const;
66 
67  static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern);
68 
69  protected:
71 
72  ~RawImageFileReader() override;
73 
74  void GenerateData() override;
75 
76  template <typename TPixel, unsigned int VImageDimensions>
77  void TypedGenerateData();
78 
80  std::string m_FileName;
81 
83  std::string m_FilePrefix;
84 
86  std::string m_FilePattern;
87 
89  IOPixelType m_PixelType;
90 
93 
95  EndianityType m_Endianity;
96 
98  itk::Vector<int, 3> m_Dimensions;
99  };
100 
101 } // namespace mitk
102 
103 #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:179
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
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:51