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
64 /* @} */
65
66 virtual Image
67 Execute() = 0;
68
69 std::string
70 ToString() const override;
71
74 virtual std::vector<std::string>
76
82 virtual SITK_RETURN_SELF_TYPE_HEADER
83 SetLoadPrivateTags(bool loadPrivateTags);
84 virtual bool
86 virtual void
88 virtual void
90 /* @} */
91
92
106 virtual SITK_RETURN_SELF_TYPE_HEADER
107 SetImageIO(const std::string & imageio);
108 virtual std::string
109 GetImageIO() const;
110 /* @} */
111
120 static std::string
122
123protected:
125 GetImageIOBase(const PathType & fileName);
126
127 void
128 GetPixelIDFromImageIO(const PathType & fileName, PixelIDValueType & outPixelType, unsigned int & outDimensions);
129 void
130 GetPixelIDFromImageIO(const itk::ImageIOBase * iobase, PixelIDValueType & outPixelType, unsigned int & outDimensions);
131
132 unsigned int
133 GetDimensionFromImageIO(const PathType & filename, unsigned int i);
134 unsigned int
135 GetDimensionFromImageIO(const itk::ImageIOBase * iobase, unsigned int i);
136
137
138private:
140 ExecuteInternalReadScalar(int componentType);
141
143 ExecuteInternalReadVector(int componentType);
144
146 ExecuteInternalReadComplex(int componentType);
147
148
151
152 std::string m_ImageIOName;
153};
154} // namespace simple
155} // namespace itk
156
157
158#endif // sitkImageReaderBase_h
virtual std::vector< std::string > GetRegisteredImageIOs() const
Get a vector of the names of registered itk ImageIOs.
virtual Image Execute()=0
Set/Get The output PixelType of the image.
PixelIDValueType ExecuteInternalReadScalar(int componentType)
Set/Get The output PixelType of the image.
std::string ToString() const override
Set/Get The output PixelType of the image.
virtual bool GetLoadPrivateTags() const
Set/Get The output PixelType of the image.
virtual std::string GetImageIO() const
Set/Get The output PixelType of the image.
PixelIDValueType ExecuteInternalReadVector(int componentType)
Set/Get The output PixelType of the image.
PixelIDValueEnum m_OutputPixelType
Set/Get The output PixelType of the image.
void GetPixelIDFromImageIO(const itk::ImageIOBase *iobase, PixelIDValueType &outPixelType, unsigned int &outDimensions)
Set/Get The output PixelType of the image.
unsigned int GetDimensionFromImageIO(const itk::ImageIOBase *iobase, unsigned int i)
Set/Get The output PixelType of the image.
unsigned int GetDimensionFromImageIO(const PathType &filename, unsigned int i)
Set/Get The output PixelType of the image.
itk::SmartPointer< ImageIOBase > GetImageIOBase(const PathType &fileName)
Set/Get The output PixelType of the image.
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)
Set/Get The output PixelType of the image.
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.
std::string m_ImageIOName
Set/Get The output PixelType of the image.
bool m_LoadPrivateTags
Set/Get The output PixelType of the image.
PixelIDValueEnum GetOutputPixelType() const
Set/Get The output PixelType of the image.
virtual void LoadPrivateTagsOff()
Set/Get The output PixelType of the image.
virtual Self & SetImageIO(const std::string &imageio)
Set/Get name of ImageIO to use.
PixelIDValueType ExecuteInternalReadComplex(int componentType)
Set/Get The output PixelType of the image.
virtual void LoadPrivateTagsOn()
Set/Get The output PixelType of the image.
The Image class for SimpleITK.
Definition sitkImage.h:77
std::string PathType
PixelIDValueEnum
Enumerated values of pixelIDs.
#define SITKIO_EXPORT
Definition sitkIO.h:33