SimpleITK  
sitkImageReaderBase.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef sitkImageReaderBase_h
19#define sitkImageReaderBase_h
20
21#include "sitkProcessObject.h"
22#include "sitkPixelIDValues.h"
23#include "sitkPathType.h"
24#include "sitkIO.h"
25
26namespace itk
27{
28
29// Forward declaration for pointer
30class ImageIOBase;
31
32template <class T>
33class SmartPointer;
34
35namespace simple
36{
37
43{
44public:
46
47 ~ImageReaderBase() override;
48
50
51
60 SITK_RETURN_SELF_TYPE_HEADER
65
66
72 virtual Image
73 Execute() = 0;
74
75 std::string
76 ToString() const override;
77
80 virtual std::vector<std::string>
82
88 virtual SITK_RETURN_SELF_TYPE_HEADER
89 SetLoadPrivateTags(bool loadPrivateTags);
90 virtual bool
92 virtual void
94 virtual void
97
98
112 virtual SITK_RETURN_SELF_TYPE_HEADER
113 SetImageIO(const std::string & imageio);
114 virtual std::string
115 GetImageIO() const;
117
126 static std::string
128
129protected:
131 GetImageIOBase(const PathType & fileName);
132
133 void
134 GetPixelIDFromImageIO(const PathType & fileName, PixelIDValueType & outPixelType, unsigned int & outDimensions);
135 void
136 GetPixelIDFromImageIO(const itk::ImageIOBase * iobase, PixelIDValueType & outPixelType, unsigned int & outDimensions);
137
138 unsigned int
139 GetDimensionFromImageIO(const PathType & filename, unsigned int i);
140 unsigned int
141 GetDimensionFromImageIO(const itk::ImageIOBase * iobase, unsigned int i);
142
143
144private:
146 ExecuteInternalReadScalar(int componentType);
147
149 ExecuteInternalReadVector(int componentType);
150
152 ExecuteInternalReadComplex(int componentType);
153
154
157
158 std::string m_ImageIOName;
159};
160} // namespace simple
161} // namespace itk
162
163
164#endif // sitkImageReaderBase_h
virtual std::vector< std::string > GetRegisteredImageIOs() const
Get a vector of the names of registered itk ImageIOs.
virtual Image Execute()=0
PixelIDValueType ExecuteInternalReadScalar(int componentType)
std::string ToString() const override
virtual bool GetLoadPrivateTags() const
Set/Get loading private DICOM tags into Image's MetaData.
virtual std::string GetImageIO() const
Set/Get name of ImageIO to use.
PixelIDValueType ExecuteInternalReadVector(int componentType)
void GetPixelIDFromImageIO(const itk::ImageIOBase *iobase, PixelIDValueType &outPixelType, unsigned int &outDimensions)
unsigned int GetDimensionFromImageIO(const itk::ImageIOBase *iobase, unsigned int i)
unsigned int GetDimensionFromImageIO(const PathType &filename, unsigned int i)
itk::SmartPointer< ImageIOBase > GetImageIOBase(const PathType &fileName)
virtual Self & SetLoadPrivateTags(bool loadPrivateTags)
Set/Get loading private DICOM tags into Image's MetaData.
void GetPixelIDFromImageIO(const PathType &fileName, PixelIDValueType &outPixelType, unsigned int &outDimensions)
static std::string GetImageIOFromFileName(const PathType &fileName)
Get the automatic ImageIO from the ImageIOFactory.
Self & SetOutputPixelType(PixelIDValueEnum pixelID)
Set/Get The output PixelType of the image.
PixelIDValueEnum GetOutputPixelType() const
Set/Get The output PixelType of the image.
virtual void LoadPrivateTagsOff()
Set/Get loading private DICOM tags into Image's MetaData.
virtual Self & SetImageIO(const std::string &imageio)
Set/Get name of ImageIO to use.
PixelIDValueType ExecuteInternalReadComplex(int componentType)
virtual void LoadPrivateTagsOn()
Set/Get loading private DICOM tags into Image's MetaData.
The Image class for SimpleITK.
Definition sitkImage.h:77
std::string PathType
PixelIDValueEnum
Enumerated values of pixelIDs.
#define SITKIO_EXPORT
Definition sitkIO.h:33