Medical Imaging Interaction Toolkit  2024.06.00
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 mitkRawImageFileReader_h
14 #define mitkRawImageFileReader_h
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 
90 
93 
96 
98  itk::Vector<int, 3> m_Dimensions;
99  };
100 
101 } // namespace mitk
102 
103 #endif
mitk::RawImageFileReader::LITTLE
@ LITTLE
Definition: LegacyIO/mitkRawImageFileReader.h:56
mitk::ImageSource
Superclass of all classes generating Images (instances of class Image) as output.
Definition: mitkImageSource.h:36
mitk::RawImageFileReader::m_PixelType
IOPixelType m_PixelType
Definition: LegacyIO/mitkRawImageFileReader.h:89
mitk::RawImageFileReader::m_Dimensionality
int m_Dimensionality
Definition: LegacyIO/mitkRawImageFileReader.h:92
DEPRECATED
#define DEPRECATED(func)
Definition: mitkCommon.h:175
mitkFileReader.h
MitkLegacyIOExports.h
mitk::RawImageFileReader::m_FileName
std::string m_FileName
Definition: LegacyIO/mitkRawImageFileReader.h:80
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitk::BaseDataSource
Superclass of all classes generating some kind of mitk::BaseData.
Definition: mitkBaseDataSource.h:71
mitk::RawImageFileReader
Reader to read raw image files.
Definition: LegacyIO/mitkRawImageFileReader.h:28
mitk::RawImageFileReader::m_FilePrefix
std::string m_FilePrefix
Definition: LegacyIO/mitkRawImageFileReader.h:83
mitk::RawImageFileReader::EndianityType
EndianityType
Definition: LegacyIO/mitkRawImageFileReader.h:56
mitk::RawImageFileReader::m_Endianity
EndianityType m_Endianity
Definition: LegacyIO/mitkRawImageFileReader.h:95
mitk::PixelType
Class for defining the data type of pixels.
Definition: mitkPixelType.h:51
mitk::FileReader
Interface class of readers that read from files.
Definition: mitkFileReader.h:25
mitk::RawImageFileReader::m_FilePattern
std::string m_FilePattern
Definition: LegacyIO/mitkRawImageFileReader.h:86
mitk::RawImageFileReader::IOPixelType
IOPixelType
Definition: LegacyIO/mitkRawImageFileReader.h:52
MITKLEGACYIO_EXPORT
#define MITKLEGACYIO_EXPORT
Definition: MitkLegacyIOExports.h:15
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::RawImageFileReader::m_Dimensions
itk::Vector< int, 3 > m_Dimensions
Definition: LegacyIO/mitkRawImageFileReader.h:98
mitk::RawImageFileReader::USHORT
@ USHORT
Definition: LegacyIO/mitkRawImageFileReader.h:52
mitkImageSource.h