ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkImageIOBase.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 * https://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 itkImageIOBase_h
19#define itkImageIOBase_h
20#include "ITKIOImageBaseExport.h"
21
22#include "itkIOConfigure.h"
23
25#include "itkIndent.h"
26#include "itkImageIORegion.h"
27#include "itkRGBPixel.h"
28#include "itkRGBAPixel.h"
29#include "itkCovariantVector.h"
32#include "itkArray.h"
35#include "itkCommonEnums.h"
36
37#include "vnl/vnl_vector.h"
38#include "vcl_compiler.h"
39
40#include <fstream>
41#include <string>
42
43namespace itk
44{
45// Forward reference for VariableLengthVector
46template <typename TValue>
48
77class ITKIOImageBase_EXPORT ImageIOBase : public LightProcessObject
78{
79public:
80 ITK_DISALLOW_COPY_AND_MOVE(ImageIOBase);
81
87
89 itkOverrideGetNameOfClassMacro(ImageIOBase);
90
93 itkSetStringMacro(FileName);
94 itkGetStringMacro(FileName);
96
100
107 {};
108
109#if !defined(ITK_LEGACY_REMOVE)
111 using IOPixelType = IOPixelEnum;
112 static constexpr IOPixelEnum UNKNOWNPIXELTYPE = IOPixelEnum::UNKNOWNPIXELTYPE;
113 static constexpr IOPixelEnum SCALAR = IOPixelEnum::SCALAR;
114 static constexpr IOPixelEnum RGB = IOPixelEnum::RGB;
115 static constexpr IOPixelEnum RGBA = IOPixelEnum::RGBA;
116 static constexpr IOPixelEnum OFFSET = IOPixelEnum::OFFSET;
117 static constexpr IOPixelEnum VECTOR = IOPixelEnum::VECTOR;
118 static constexpr IOPixelEnum POINT = IOPixelEnum::POINT;
119 static constexpr IOPixelEnum COVARIANTVECTOR = IOPixelEnum::COVARIANTVECTOR;
120 static constexpr IOPixelEnum SYMMETRICSECONDRANKTENSOR = IOPixelEnum::SYMMETRICSECONDRANKTENSOR;
121 static constexpr IOPixelEnum DIFFUSIONTENSOR3D = IOPixelEnum::DIFFUSIONTENSOR3D;
122 static constexpr IOPixelEnum COMPLEX = IOPixelEnum::COMPLEX;
123 static constexpr IOPixelEnum FIXEDARRAY = IOPixelEnum::FIXEDARRAY;
124 static constexpr IOPixelEnum MATRIX = IOPixelEnum::MATRIX;
125#endif
126
128#if !defined(ITK_LEGACY_REMOVE)
130 using IOComponentType = IOComponentEnum;
131 static constexpr IOComponentEnum UNKNOWNCOMPONENTTYPE = IOComponentEnum::UNKNOWNCOMPONENTTYPE;
132 static constexpr IOComponentEnum UCHAR = IOComponentEnum::UCHAR;
133 static constexpr IOComponentEnum CHAR = IOComponentEnum::CHAR;
134 static constexpr IOComponentEnum USHORT = IOComponentEnum::USHORT;
135 static constexpr IOComponentEnum SHORT = IOComponentEnum::SHORT;
136 static constexpr IOComponentEnum UINT = IOComponentEnum::UINT;
137 static constexpr IOComponentEnum INT = IOComponentEnum::INT;
138 static constexpr IOComponentEnum ULONG = IOComponentEnum::ULONG;
139 static constexpr IOComponentEnum LONG = IOComponentEnum::LONG;
140 static constexpr IOComponentEnum ULONGLONG = IOComponentEnum::ULONGLONG;
141 static constexpr IOComponentEnum LONGLONG = IOComponentEnum::LONGLONG;
142 static constexpr IOComponentEnum FLOAT = IOComponentEnum::FLOAT;
143 static constexpr IOComponentEnum DOUBLE = IOComponentEnum::DOUBLE;
144#endif
145
147#if !defined(ITK_LEGACY_REMOVE)
149 static constexpr IOFileEnum ASCII = IOFileEnum::ASCII;
150 static constexpr IOFileEnum Binary = IOFileEnum::Binary;
151 static constexpr IOFileEnum TypeNotApplicable = IOFileEnum::TypeNotApplicable;
152#endif
153
155#if !defined(ITK_LEGACY_REMOVE)
156 using ByteOrder = itk::IOByteOrderEnum;
158 static constexpr IOByteOrderEnum BigEndian = IOByteOrderEnum::BigEndian;
159 static constexpr IOByteOrderEnum LittleEndian = IOByteOrderEnum::LittleEndian;
160 static constexpr IOByteOrderEnum OrderNotApplicable = IOByteOrderEnum::OrderNotApplicable;
161#endif
162
166 void
168
169 itkGetConstMacro(NumberOfDimensions, unsigned int);
170
175 virtual void
176 SetDimensions(unsigned int i, SizeValueType dim);
177 virtual SizeValueType
178
179 GetDimensions(unsigned int i) const
180 {
181 return m_Dimensions[i];
182 }
183
184
187 virtual void
188 SetOrigin(unsigned int i, double origin);
189
190 virtual double
191 GetOrigin(unsigned int i) const
192 {
193 return m_Origin[i];
194 }
195
198 virtual void
199 SetSpacing(unsigned int i, double spacing);
200
201 virtual double
202 GetSpacing(unsigned int i) const
203 {
204 return m_Spacing[i];
205 }
206
209 virtual void
210 SetDirection(unsigned int i, const std::vector<double> & direction);
211
212 virtual void
213 SetDirection(unsigned int i, const vnl_vector<double> & direction);
214
215 virtual std::vector<double>
216 GetDirection(unsigned int i) const
217 {
218 return m_Direction[i];
219 }
220
223 virtual std::vector<double>
224 GetDefaultDirection(unsigned int k) const;
225
233 itkSetMacro(IORegion, ImageIORegion);
234 itkGetConstReferenceMacro(IORegion, ImageIORegion);
236
243 itkSetEnumMacro(PixelType, itk::CommonEnums::IOPixel);
244 itkGetEnumMacro(PixelType, itk::CommonEnums::IOPixel);
246
249 itkSetEnumMacro(ComponentType, IOComponentEnum);
250 itkGetEnumMacro(ComponentType, IOComponentEnum);
251
252#ifndef ITK_LEGACY_REMOVE
260 itkLegacyMacro(virtual const std::type_info & GetComponentTypeInfo() const);
261#endif
262
268 itkSetMacro(NumberOfComponents, unsigned int);
269 itkGetConstReferenceMacro(NumberOfComponents, unsigned int);
271
274 itkSetMacro(UseCompression, bool);
275 itkGetConstMacro(UseCompression, bool);
276 itkBooleanMacro(UseCompression);
278
285 itkSetClampMacro(CompressionLevel, int, 1, this->GetMaximumCompressionLevel());
286 itkGetConstMacro(CompressionLevel, int);
287
298 virtual void
299 SetCompressor(std::string _c);
300 itkGetConstReferenceMacro(Compressor, std::string);
301
304 itkSetMacro(UseStreamedReading, bool);
305 itkGetConstMacro(UseStreamedReading, bool);
306 itkBooleanMacro(UseStreamedReading);
308
311 itkSetMacro(UseStreamedWriting, bool);
312 itkGetConstMacro(UseStreamedWriting, bool);
313 itkBooleanMacro(UseStreamedWriting);
315
321 itkSetMacro(ExpandRGBPalette, bool);
322 itkGetConstMacro(ExpandRGBPalette, bool);
323 itkBooleanMacro(ExpandRGBPalette);
325
329 itkSetMacro(WritePalette, bool);
330 itkGetConstMacro(WritePalette, bool);
331 itkBooleanMacro(WritePalette);
333
338 itkGetConstMacro(IsReadAsScalarPlusPalette, bool);
339
343
345 static IOComponentEnum
346 GetComponentTypeFromString(const std::string & typeString);
347
351
353 static IOPixelEnum
354 GetPixelTypeFromString(const std::string & pixelString);
355
359 itkSetEnumMacro(FileType, IOFileEnum);
360 itkGetEnumMacro(FileType, IOFileEnum);
361 void
363 {
364 this->SetFileType(IOFileEnum::ASCII);
365 }
366
367
368 void
370 {
371 this->SetFileType(IOFileEnum::Binary);
372 }
373
386 itkSetEnumMacro(ByteOrder, IOByteOrderEnum);
387 itkGetEnumMacro(ByteOrder, IOByteOrderEnum);
388 void
390 {
391 this->SetByteOrder(IOByteOrderEnum::BigEndian);
392 }
393
394
395 void
397 {
398 this->SetByteOrder(IOByteOrderEnum::LittleEndian);
399 }
400
403 std::string GetFileTypeAsString(IOFileEnum) const;
404
408
410 using SizeType = itk::intmax_t;
411
415
422 virtual SizeType
424
428
432
437
442 virtual unsigned int
444
445 /*-------- This part of the interfaces deals with reading data ----- */
446
449 virtual bool
450 CanReadFile(const char *) = 0;
451
456 virtual bool
458 {
459 return false;
460 }
461
464 virtual void
466
468 virtual void
469 Read(void * buffer) = 0;
470
471 /*-------- This part of the interfaces deals with writing data ----- */
472
475 virtual bool
476 CanWriteFile(const char *) = 0;
477
484 virtual bool
486 {
487 return false;
488 }
489
492 virtual void
494
498 virtual void
499 Write(const void * buffer) = 0;
500
501 /* --- Support reading and writing data as a series of files. --- */
502
508 virtual bool
509 SupportsDimension(unsigned long dim)
510 {
511 return (dim == 2);
512 }
513
525 virtual ImageIORegion
527
542 virtual unsigned int
543 GetActualNumberOfSplitsForWriting(unsigned int numberOfRequestedSplits,
544 const ImageIORegion & pasteRegion,
545 const ImageIORegion & largestPossibleRegion);
546
553 virtual ImageIORegion
554 GetSplitRegionForWriting(unsigned int ithPiece,
555 unsigned int numberOfActualSplits,
556 const ImageIORegion & pasteRegion,
557 const ImageIORegion & largestPossibleRegion);
558
560 using ArrayOfExtensionsType = std::vector<std::string>;
561
568
575
576 template <typename TPixel>
577 void
578 SetTypeInfo(const TPixel *);
579
582 template <typename TPixel>
584 {
585 static constexpr IOComponentEnum CType = IOComponentEnum::UNKNOWNCOMPONENTTYPE;
586 };
587 template <typename TPixel>
588 void
589 SetPixelTypeInfo(const TPixel *)
590 {
591 this->SetNumberOfComponents(1);
592 this->SetPixelType(IOPixelEnum::SCALAR);
594 }
595 template <typename TPixel>
596 void
598 {
599 this->SetNumberOfComponents(3);
600 this->SetPixelType(IOPixelEnum::RGB);
602 }
603 template <typename TPixel>
604 void
606 {
607 this->SetNumberOfComponents(4);
608 this->SetPixelType(IOPixelEnum::RGBA);
610 }
611 template <unsigned int VLength>
612 void
614 {
615 this->SetNumberOfComponents(VLength);
616 this->SetPixelType(IOPixelEnum::OFFSET);
617 this->SetComponentType(IOComponentEnum::LONG);
618 }
619 template <typename TPixel, unsigned int VLength>
620 void
622 {
623 this->SetNumberOfComponents(VLength);
624 this->SetPixelType(IOPixelEnum::VECTOR);
626 }
627 template <typename TCoordinate, unsigned int VPointDimension>
628 void
630 {
631 this->SetNumberOfComponents(VPointDimension);
632 this->SetPixelType(IOPixelEnum::POINT);
634 }
635 template <typename TPixel, unsigned int VLength>
636 void
638 {
639 this->SetNumberOfComponents(VLength);
640 this->SetPixelType(IOPixelEnum::COVARIANTVECTOR);
642 }
643 template <typename TPixel, unsigned int VLength>
644 void
646 {
647 this->SetNumberOfComponents(VLength * (VLength + 1) / 2);
648 this->SetPixelType(IOPixelEnum::SYMMETRICSECONDRANKTENSOR);
650 }
651 template <typename TPixel>
652 void
654 {
655 this->SetNumberOfComponents(6);
656 this->SetPixelType(IOPixelEnum::DIFFUSIONTENSOR3D);
658 }
659 template <typename TPixel>
660 void
661 SetPixelTypeInfo(const std::complex<TPixel> *)
662 {
663 this->SetNumberOfComponents(2);
664 this->SetPixelType(IOPixelEnum::COMPLEX);
666 }
667 template <typename TPixel, unsigned int VLength>
668 void
670 {
671 this->SetNumberOfComponents(VLength);
672 this->SetPixelType(IOPixelEnum::FIXEDARRAY);
674 }
675 template <typename TPixel>
676 void
678 {
679 this->SetNumberOfComponents(1);
680 this->SetPixelType(IOPixelEnum::VARIABLELENGTHVECTOR);
682 }
683 template <typename TValue>
684 void
686 {
687 this->SetNumberOfComponents(1);
688 this->SetPixelType(IOPixelEnum::ARRAY);
690 }
691 template <typename TPixel, unsigned int VLength>
692 void
694 {
695 this->SetNumberOfComponents(VLength * VLength);
696 this->SetPixelType(IOPixelEnum::MATRIX);
698 }
699 template <typename TValue>
700 void
702 {
703 this->SetNumberOfComponents(1);
704 this->SetPixelType(IOPixelEnum::VARIABLESIZEMATRIX);
706 }
707
708
709protected:
711 ~ImageIOBase() override;
712 void
713 PrintSelf(std::ostream & os, Indent indent) const override;
714
715 virtual const ImageRegionSplitterBase *
717
723 virtual bool
724 HasSupportedReadExtension(const char * fileName, bool ignoreCase = true);
725 virtual bool
726 HasSupportedWriteExtension(const char * fileName, bool ignoreCase = true);
728
730 IOPixelEnum m_PixelType{ IOPixelEnum::SCALAR };
731
734 IOComponentEnum m_ComponentType{ IOComponentEnum::UNKNOWNCOMPONENTTYPE };
735
737 IOByteOrderEnum m_ByteOrder{ IOByteOrderEnum::OrderNotApplicable };
738
739 IOFileEnum m_FileType{ IOFileEnum::TypeNotApplicable };
740
743
745 std::string m_FileName{};
746
749 unsigned int m_NumberOfComponents{};
750
752 unsigned int m_NumberOfDimensions{ 0 };
753
755 bool m_UseCompression{ false };
756
757
760 std::string m_Compressor{ "uninitialized" };
761
764 virtual void
766 itkGetConstMacro(MaximumCompressionLevel, int);
768
772 virtual void
773 InternalSetCompressor(const std::string & _compressor);
774
777
780
783
787
790
794
796 std::vector<SizeValueType> m_Dimensions{};
797
800 std::vector<double> m_Spacing{};
801
803 std::vector<double> m_Origin{};
804
806 std::vector<std::vector<double>> m_Direction{};
807
810 std::vector<SizeType> m_Strides{};
811
813 virtual void
814 Reset(const bool freeDynamic = true);
815
817 void
818 Resize(const unsigned int numDimensions, const unsigned int * dimensions);
819
822 virtual unsigned int
824
831 void
833
838
843
848
860 virtual void
861 OpenFileForReading(std::ifstream & inputStream, const std::string & filename, bool ascii = false);
862
878 virtual void
879 OpenFileForWriting(std::ofstream & outputStream,
880 const std::string & filename,
881 bool truncate = true,
882 bool ascii = false);
883
885 virtual void
886 WriteBufferAsASCII(std::ostream & os, const void * buffer, IOComponentEnum ctype, SizeType numComp);
887
889 virtual void
890 ReadBufferAsASCII(std::istream & is, void * buffer, IOComponentEnum ctype, SizeType numComp);
891
893 bool
894 ReadBufferAsBinary(std::istream & is, void * buffer, SizeType num);
895
897 void
898 AddSupportedReadExtension(const char * extension);
899
901 void
902 AddSupportedWriteExtension(const char * extension);
903
904
905 void
907 void
909
912 virtual unsigned int
913 GetActualNumberOfSplitsForWritingCanStreamWrite(unsigned int numberOfRequestedSplits,
914 const ImageIORegion & pasteRegion) const;
915
918 virtual ImageIORegion
920 unsigned int numberOfActualSplits,
921 const ImageIORegion & pasteRegion) const;
922
923private:
924 bool
925 HasSupportedExtension(const char *, const ArrayOfExtensionsType &, bool ignoreCase = true);
926
929};
930
932extern ITKIOImageBase_EXPORT void
934 const void * buffer,
935 std::ofstream & file,
936 IOByteOrderEnum byteOrder,
937 SizeValueType numberOfBytes,
938 SizeValueType numberOfComponents);
939
941extern ITKIOImageBase_EXPORT void
943 void * buffer,
944 IOByteOrderEnum byteOrder,
945 SizeValueType numberOfComponents);
946
947#define IMAGEIOBASE_TYPEMAP(type, ctype) \
948 template <> \
949 struct ImageIOBase::MapPixelType<type> \
950 { \
951 static constexpr IOComponentEnum CType = ctype; \
952 }
953
954// the following typemaps are not platform independent
955IMAGEIOBASE_TYPEMAP(signed char, IOComponentEnum::CHAR);
956IMAGEIOBASE_TYPEMAP(char, std::numeric_limits<char>::is_signed ? IOComponentEnum::CHAR : IOComponentEnum::UCHAR);
957IMAGEIOBASE_TYPEMAP(unsigned char, IOComponentEnum::UCHAR);
958IMAGEIOBASE_TYPEMAP(short, IOComponentEnum::SHORT);
959IMAGEIOBASE_TYPEMAP(unsigned short, IOComponentEnum::USHORT);
960IMAGEIOBASE_TYPEMAP(int, IOComponentEnum::INT);
961IMAGEIOBASE_TYPEMAP(unsigned int, IOComponentEnum::UINT);
962IMAGEIOBASE_TYPEMAP(long, IOComponentEnum::LONG);
963IMAGEIOBASE_TYPEMAP(unsigned long, IOComponentEnum::ULONG);
964IMAGEIOBASE_TYPEMAP(long long, IOComponentEnum::LONGLONG);
965IMAGEIOBASE_TYPEMAP(unsigned long long, IOComponentEnum::ULONGLONG);
966IMAGEIOBASE_TYPEMAP(float, IOComponentEnum::FLOAT);
967IMAGEIOBASE_TYPEMAP(double, IOComponentEnum::DOUBLE);
968#undef IMAGIOBASE_TYPEMAP
969
970} // end namespace itk
971
972#endif // itkImageIOBase_h
Array class with size defined at construction time.
Definition itkArray.h:48
A templated class holding a n-Dimensional covariant vector.
Represent a diffusion tensor as used in DTI images.
Simulate a standard C array with copy semantics.
virtual unsigned int GetActualNumberOfSplitsForWriting(unsigned int numberOfRequestedSplits, const ImageIORegion &pasteRegion, const ImageIORegion &largestPossibleRegion)
void SetPixelTypeInfo(const VariableSizeMatrix< TValue > *)
virtual double GetOrigin(unsigned int i) const
~ImageIOBase() override
virtual ImageIORegion GetSplitRegionForWriting(unsigned int ithPiece, unsigned int numberOfActualSplits, const ImageIORegion &pasteRegion, const ImageIORegion &largestPossibleRegion)
void SetPixelTypeInfo(const Matrix< TPixel, VLength, VLength > *)
std::vector< std::vector< double > > m_Direction
virtual void InternalSetCompressor(const std::string &_compressor)
bool ReadBufferAsBinary(std::istream &is, void *buffer, SizeType num)
virtual void Reset(const bool freeDynamic=true)
void AddSupportedReadExtension(const char *extension)
virtual double GetSpacing(unsigned int i) const
void SetPixelTypeInfo(const DiffusionTensor3D< TPixel > *)
SmartPointer< const Self > ConstPointer
void SetByteOrderToBigEndian()
virtual void SetOrigin(unsigned int i, double origin)
std::vector< SizeValueType > m_Dimensions
itk::intmax_t SizeType
void SetPixelTypeInfo(const CovariantVector< TPixel, VLength > *)
virtual void OpenFileForWriting(std::ofstream &outputStream, const std::string &filename, bool truncate=true, bool ascii=false)
Opens a file for writing and random access.
virtual bool CanReadFile(const char *)=0
IOByteOrderEnum m_ByteOrder
virtual void SetNumberOfComponents(unsigned int _arg)
virtual void ReadBufferAsASCII(std::istream &is, void *buffer, IOComponentEnum ctype, SizeType numComp)
virtual bool HasSupportedWriteExtension(const char *fileName, bool ignoreCase=true)
void SetPixelTypeInfo(const FixedArray< TPixel, VLength > *)
virtual std::vector< double > GetDirection(unsigned int i) const
std::vector< double > m_Spacing
virtual unsigned int GetPixelSize() const
SizeType GetRowStride() const
virtual void SetComponentType(const IOComponentEnum _arg)
IOComponentEnum m_ComponentType
std::vector< double > m_Origin
virtual ImageIORegion GetSplitRegionForWritingCanStreamWrite(unsigned int ithPiece, unsigned int numberOfActualSplits, const ImageIORegion &pasteRegion) const
void SetPixelTypeInfo(const SymmetricSecondRankTensor< TPixel, VLength > *)
SizeType GetImageSizeInComponents() const
virtual void WriteBufferAsASCII(std::ostream &os, const void *buffer, IOComponentEnum ctype, SizeType numComp)
virtual void SetDirection(unsigned int i, const std::vector< double > &direction)
void SetSupportedReadExtensions(const ArrayOfExtensionsType &)
virtual void SetMaximumCompressionLevel(int)
std::string m_FileName
virtual unsigned int GetComponentSize() const
SizeType GetComponentStride() const
ArrayOfExtensionsType m_SupportedWriteExtensions
unsigned int m_NumberOfComponents
std::string GetByteOrderAsString(IOByteOrderEnum) const
virtual const ImageRegionSplitterBase * GetImageRegionSplitter() const
SizeType GetImageSizeInBytes() const
void SetTypeInfo(const TPixel *)
virtual bool SupportsDimension(unsigned long dim)
ArrayOfExtensionsType m_SupportedReadExtensions
virtual bool HasSupportedReadExtension(const char *fileName, bool ignoreCase=true)
virtual unsigned int GetActualNumberOfSplitsForWritingCanStreamWrite(unsigned int numberOfRequestedSplits, const ImageIORegion &pasteRegion) const
virtual void SetCompressor(std::string _c)
Set/Get the compression algorithm to use.
const ArrayOfExtensionsType & GetSupportedReadExtensions() const
virtual bool CanStreamWrite()
static IOComponentEnum GetComponentTypeFromString(const std::string &typeString)
SmartPointer< Self > Pointer
bool HasSupportedExtension(const char *, const ArrayOfExtensionsType &, bool ignoreCase=true)
static IOPixelEnum GetPixelTypeFromString(const std::string &pixelString)
void SetPixelTypeInfo(const Vector< TPixel, VLength > *)
void SetPixelTypeInfo(const Offset< VLength > *)
void SetPixelTypeInfo(const Array< TValue > *)
virtual void SetByteOrder(const IOByteOrderEnum _arg)
virtual bool CanWriteFile(const char *)=0
virtual void Write(const void *buffer)=0
virtual void SetDirection(unsigned int i, const vnl_vector< double > &direction)
virtual ImageIORegion GenerateStreamableReadRegionFromRequestedRegion(const ImageIORegion &requested) const
void SetPixelTypeInfo(const RGBPixel< TPixel > *)
itk::IOByteOrderEnum IOByteOrderEnum
void SetPixelTypeInfo(const std::complex< TPixel > *)
void SetByteOrderToLittleEndian()
void SetSupportedWriteExtensions(const ArrayOfExtensionsType &)
virtual SizeValueType GetDimensions(unsigned int i) const
const ArrayOfExtensionsType & GetSupportedWriteExtensions() const
SizeType GetImageSizeInPixels() const
void Resize(const unsigned int numDimensions, const unsigned int *dimensions)
std::string GetFileTypeAsString(IOFileEnum) const
itk::OffsetValueType BufferSizeType
virtual void WriteImageInformation()=0
itk::IOComponentEnum IOComponentEnum
IOPixelEnum m_PixelType
static std::string GetComponentTypeAsString(IOComponentEnum)
virtual void SetFileType(const IOFileEnum _arg)
std::vector< SizeType > m_Strides
LightProcessObject Superclass
static std::string GetPixelTypeAsString(IOPixelEnum)
unsigned int m_NumberOfDimensions
virtual void SetDimensions(unsigned int i, SizeValueType dim)
virtual void SetSpacing(unsigned int i, double spacing)
void SetPixelTypeInfo(const RGBAPixel< TPixel > *)
void SetPixelTypeInfo(const TPixel *)
ImageIORegion m_IORegion
virtual void SetPixelType(const itk::CommonEnums::IOPixel _arg)
void SetNumberOfDimensions(unsigned int)
itk::SizeValueType SizeValueType
virtual bool CanStreamRead()
void AddSupportedWriteExtension(const char *extension)
virtual void ReadImageInformation()=0
std::vector< std::string > ArrayOfExtensionsType
virtual std::vector< double > GetDefaultDirection(unsigned int k) const
IOFileEnum m_FileType
virtual void Read(void *buffer)=0
void SetPixelTypeInfo(const VariableLengthVector< TPixel > *)
std::string m_Compressor
virtual void OpenFileForReading(std::ifstream &inputStream, const std::string &filename, bool ascii=false)
Opens a file for reading and random access.
itk::IOFileEnum IOFileEnum
virtual int GetMaximumCompressionLevel() const
virtual SizeType GetPixelStride() const
itk::IndexValueType IndexValueType
void PrintSelf(std::ostream &os, Indent indent) const override
SizeType GetSliceStride() const
void SetPixelTypeInfo(const Point< TCoordinate, VPointDimension > *)
An ImageIORegion represents a structured region of data.
Divide an image region into several pieces.
Control indentation during Print() invocation.
Definition itkIndent.h:50
A templated class holding a M x N size Matrix.
Definition itkMatrix.h:53
A templated class holding a geometric point in n-Dimensional space.
Definition itkPoint.h:54
Represent Red, Green, Blue and Alpha components for color images.
Represent Red, Green and Blue components for color images.
Definition itkRGBPixel.h:59
Implements transparent reference counting.
Represent a symmetric tensor of second rank.
A templated class holding a M x N size Matrix.
A templated class holding a n-Dimensional vector.
Definition itkVector.h:63
#define IMAGEIOBASE_TYPEMAP(type, ctype)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
CommonEnums::IOComponent IOComponentEnum
unsigned long SizeValueType
Definition itkIntTypes.h:86
long OffsetValueType
Definition itkIntTypes.h:97
CommonEnums::IOFile IOFileEnum
CommonEnums::IOByteOrder IOByteOrderEnum
ITKIOImageBase_EXPORT void WriteRawBytesAfterSwapping(IOComponentEnum componentType, const void *buffer, std::ofstream &file, IOByteOrderEnum byteOrder, SizeValueType numberOfBytes, SizeValueType numberOfComponents)
CommonEnums::IOPixel IOPixelEnum
long IndexValueType
Definition itkIntTypes.h:93
ITKIOImageBase_EXPORT void ReadRawBytesAfterSwapping(IOComponentEnum componentType, void *buffer, IOByteOrderEnum byteOrder, SizeValueType numberOfComponents)
static constexpr IOComponentEnum CType
Represent a n-dimensional offset between two n-dimensional indexes of n-dimensional image.
Definition itkOffset.h:67