ITK  6.0.0
Insight Toolkit
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>
47class VariableLengthVector;
48
77class ITKIOImageBase_EXPORT ImageIOBase : public LightProcessObject
78{
79public:
80 ITK_DISALLOW_COPY_AND_MOVE(ImageIOBase);
81
87
89 itkOverrideGetNameOfClassMacro(ImageIOBase);
90
92 itkSetStringMacro(FileName);
93 itkGetStringMacro(FileName);
99
106 {};
107
108#if !defined(ITK_LEGACY_REMOVE)
110 using IOPixelType = IOPixelEnum;
111 static constexpr IOPixelEnum UNKNOWNPIXELTYPE = IOPixelEnum::UNKNOWNPIXELTYPE;
112 static constexpr IOPixelEnum SCALAR = IOPixelEnum::SCALAR;
113 static constexpr IOPixelEnum RGB = IOPixelEnum::RGB;
114 static constexpr IOPixelEnum RGBA = IOPixelEnum::RGBA;
115 static constexpr IOPixelEnum OFFSET = IOPixelEnum::OFFSET;
116 static constexpr IOPixelEnum VECTOR = IOPixelEnum::VECTOR;
117 static constexpr IOPixelEnum POINT = IOPixelEnum::POINT;
118 static constexpr IOPixelEnum COVARIANTVECTOR = IOPixelEnum::COVARIANTVECTOR;
119 static constexpr IOPixelEnum SYMMETRICSECONDRANKTENSOR = IOPixelEnum::SYMMETRICSECONDRANKTENSOR;
120 static constexpr IOPixelEnum DIFFUSIONTENSOR3D = IOPixelEnum::DIFFUSIONTENSOR3D;
121 static constexpr IOPixelEnum COMPLEX = IOPixelEnum::COMPLEX;
122 static constexpr IOPixelEnum FIXEDARRAY = IOPixelEnum::FIXEDARRAY;
123 static constexpr IOPixelEnum MATRIX = IOPixelEnum::MATRIX;
124#endif
125
127#if !defined(ITK_LEGACY_REMOVE)
129 using IOComponentType = IOComponentEnum;
130 static constexpr IOComponentEnum UNKNOWNCOMPONENTTYPE = IOComponentEnum::UNKNOWNCOMPONENTTYPE;
131 static constexpr IOComponentEnum UCHAR = IOComponentEnum::UCHAR;
132 static constexpr IOComponentEnum CHAR = IOComponentEnum::CHAR;
133 static constexpr IOComponentEnum USHORT = IOComponentEnum::USHORT;
134 static constexpr IOComponentEnum SHORT = IOComponentEnum::SHORT;
135 static constexpr IOComponentEnum UINT = IOComponentEnum::UINT;
136 static constexpr IOComponentEnum INT = IOComponentEnum::INT;
137 static constexpr IOComponentEnum ULONG = IOComponentEnum::ULONG;
138 static constexpr IOComponentEnum LONG = IOComponentEnum::LONG;
139 static constexpr IOComponentEnum ULONGLONG = IOComponentEnum::ULONGLONG;
140 static constexpr IOComponentEnum LONGLONG = IOComponentEnum::LONGLONG;
141 static constexpr IOComponentEnum FLOAT = IOComponentEnum::FLOAT;
142 static constexpr IOComponentEnum DOUBLE = IOComponentEnum::DOUBLE;
143#endif
144
146#if !defined(ITK_LEGACY_REMOVE)
148 static constexpr IOFileEnum ASCII = IOFileEnum::ASCII;
149 static constexpr IOFileEnum Binary = IOFileEnum::Binary;
150 static constexpr IOFileEnum TypeNotApplicable = IOFileEnum::TypeNotApplicable;
151#endif
152
154#if !defined(ITK_LEGACY_REMOVE)
155 using ByteOrder = itk::IOByteOrderEnum;
157 static constexpr IOByteOrderEnum BigEndian = IOByteOrderEnum::BigEndian;
158 static constexpr IOByteOrderEnum LittleEndian = IOByteOrderEnum::LittleEndian;
159 static constexpr IOByteOrderEnum OrderNotApplicable = IOByteOrderEnum::OrderNotApplicable;
160#endif
161
165 void
167
168 itkGetConstMacro(NumberOfDimensions, unsigned int);
169
173 virtual void
174 SetDimensions(unsigned int i, SizeValueType dim);
177 virtual SizeValueType
178 GetDimensions(unsigned int i) const
179 {
180 return m_Dimensions[i];
181 }
182
185 virtual void
186 SetOrigin(unsigned int i, double origin);
187
188 virtual double
189 GetOrigin(unsigned int i) const
190 {
191 return m_Origin[i];
192 }
193
196 virtual void
197 SetSpacing(unsigned int i, double spacing);
198
199 virtual double
200 GetSpacing(unsigned int i) const
201 {
202 return m_Spacing[i];
203 }
204
207 virtual void
208 SetDirection(unsigned int i, const std::vector<double> & direction);
209
210 virtual void
211 SetDirection(unsigned int i, const vnl_vector<double> & direction);
212
213 virtual std::vector<double>
214 GetDirection(unsigned int i) const
215 {
216 return m_Direction[i];
217 }
218
221 virtual std::vector<double>
222 GetDefaultDirection(unsigned int k) const;
223
230 itkSetMacro(IORegion, ImageIORegion);
231 itkGetConstReferenceMacro(IORegion, ImageIORegion);
239 itkSetEnumMacro(PixelType, itk::CommonEnums::IOPixel);
240 itkGetEnumMacro(PixelType, itk::CommonEnums::IOPixel);
245 itkSetEnumMacro(ComponentType, IOComponentEnum);
246 itkGetEnumMacro(ComponentType, IOComponentEnum);
247
253 virtual const std::type_info &
255
260 itkSetMacro(NumberOfComponents, unsigned int);
261 itkGetConstReferenceMacro(NumberOfComponents, unsigned int);
265 itkSetMacro(UseCompression, bool);
266 itkGetConstMacro(UseCompression, bool);
267 itkBooleanMacro(UseCompression);
276 itkSetClampMacro(CompressionLevel, int, 1, this->GetMaximumCompressionLevel());
277 itkGetConstMacro(CompressionLevel, int);
278
289 virtual void
290 SetCompressor(std::string _c);
291 itkGetConstReferenceMacro(Compressor, std::string);
292
294 itkSetMacro(UseStreamedReading, bool);
295 itkGetConstMacro(UseStreamedReading, bool);
296 itkBooleanMacro(UseStreamedReading);
300 itkSetMacro(UseStreamedWriting, bool);
301 itkGetConstMacro(UseStreamedWriting, bool);
302 itkBooleanMacro(UseStreamedWriting);
309 itkSetMacro(ExpandRGBPalette, bool);
310 itkGetConstMacro(ExpandRGBPalette, bool);
311 itkBooleanMacro(ExpandRGBPalette);
316 itkSetMacro(WritePalette, bool);
317 itkGetConstMacro(WritePalette, bool);
318 itkBooleanMacro(WritePalette);
325 itkGetConstMacro(IsReadAsScalarPlusPalette, bool);
326
330
332 static IOComponentEnum
333 GetComponentTypeFromString(const std::string & typeString);
334
338
340 static IOPixelEnum
341 GetPixelTypeFromString(const std::string & pixelString);
342
345 itkSetEnumMacro(FileType, IOFileEnum);
346 itkGetEnumMacro(FileType, IOFileEnum);
347 void
349 {
350 this->SetFileType(IOFileEnum::ASCII);
351 }
354 void
356 {
357 this->SetFileType(IOFileEnum::Binary);
358 }
359
371 itkSetEnumMacro(ByteOrder, IOByteOrderEnum);
372 itkGetEnumMacro(ByteOrder, IOByteOrderEnum);
373 void
375 {
376 this->SetByteOrder(IOByteOrderEnum::BigEndian);
377 }
380 void
382 {
383 this->SetByteOrder(IOByteOrderEnum::LittleEndian);
384 }
385
388 std::string GetFileTypeAsString(IOFileEnum) const;
389
393
395 using SizeType = itk::intmax_t;
396
400
407 virtual SizeType
409
413
417
422
427 virtual unsigned int
429
430 /*-------- This part of the interfaces deals with reading data ----- */
431
434 virtual bool
435 CanReadFile(const char *) = 0;
436
441 virtual bool
443 {
444 return false;
445 }
446
449 virtual void
451
453 virtual void
454 Read(void * buffer) = 0;
455
456 /*-------- This part of the interfaces deals with writing data ----- */
457
460 virtual bool
461 CanWriteFile(const char *) = 0;
462
469 virtual bool
471 {
472 return false;
473 }
474
477 virtual void
479
483 virtual void
484 Write(const void * buffer) = 0;
485
486 /* --- Support reading and writing data as a series of files. --- */
487
493 virtual bool
494 SupportsDimension(unsigned long dim)
495 {
496 return (dim == 2);
497 }
498
510 virtual ImageIORegion
512
527 virtual unsigned int
528 GetActualNumberOfSplitsForWriting(unsigned int numberOfRequestedSplits,
529 const ImageIORegion & pasteRegion,
530 const ImageIORegion & largestPossibleRegion);
531
538 virtual ImageIORegion
539 GetSplitRegionForWriting(unsigned int ithPiece,
540 unsigned int numberOfActualSplits,
541 const ImageIORegion & pasteRegion,
542 const ImageIORegion & largestPossibleRegion);
543
545 using ArrayOfExtensionsType = std::vector<std::string>;
546
553
560
561 template <typename TPixel>
562 void
563 SetTypeInfo(const TPixel *);
564
566 template <typename TPixel>
568 {
570 };
571 template <typename TPixel>
572 void
573 SetPixelTypeInfo(const TPixel *)
574 {
575 this->SetNumberOfComponents(1);
576 this->SetPixelType(IOPixelEnum::SCALAR);
577 this->SetComponentType(MapPixelType<TPixel>::CType);
578 }
579 template <typename TPixel>
580 void
582 {
583 this->SetNumberOfComponents(3);
584 this->SetPixelType(IOPixelEnum::RGB);
585 this->SetComponentType(MapPixelType<TPixel>::CType);
586 }
587 template <typename TPixel>
588 void
590 {
591 this->SetNumberOfComponents(4);
592 this->SetPixelType(IOPixelEnum::RGBA);
593 this->SetComponentType(MapPixelType<TPixel>::CType);
594 }
595 template <unsigned int VLength>
596 void
598 {
599 this->SetNumberOfComponents(VLength);
600 this->SetPixelType(IOPixelEnum::OFFSET);
601 this->SetComponentType(IOComponentEnum::LONG);
602 }
603 template <typename TPixel, unsigned int VLength>
604 void
606 {
607 this->SetNumberOfComponents(VLength);
608 this->SetPixelType(IOPixelEnum::VECTOR);
609 this->SetComponentType(MapPixelType<TPixel>::CType);
610 }
611 template <typename TCoordRep, unsigned int VPointDimension>
612 void
614 {
615 this->SetNumberOfComponents(VPointDimension);
616 this->SetPixelType(IOPixelEnum::POINT);
617 this->SetComponentType(MapPixelType<TCoordRep>::CType);
618 }
619 template <typename TPixel, unsigned int VLength>
620 void
622 {
623 this->SetNumberOfComponents(VLength);
624 this->SetPixelType(IOPixelEnum::COVARIANTVECTOR);
625 this->SetComponentType(MapPixelType<TPixel>::CType);
626 }
627 template <typename TPixel, unsigned int VLength>
628 void
630 {
631 this->SetNumberOfComponents(VLength * (VLength + 1) / 2);
632 this->SetPixelType(IOPixelEnum::SYMMETRICSECONDRANKTENSOR);
633 this->SetComponentType(MapPixelType<TPixel>::CType);
634 }
635 template <typename TPixel>
636 void
638 {
639 this->SetNumberOfComponents(6);
640 this->SetPixelType(IOPixelEnum::DIFFUSIONTENSOR3D);
641 this->SetComponentType(MapPixelType<TPixel>::CType);
642 }
643 template <typename TPixel>
644 void
645 SetPixelTypeInfo(const std::complex<TPixel> *)
646 {
647 this->SetNumberOfComponents(2);
648 this->SetPixelType(IOPixelEnum::COMPLEX);
649 this->SetComponentType(MapPixelType<TPixel>::CType);
650 }
651 template <typename TPixel, unsigned int VLength>
652 void
654 {
655 this->SetNumberOfComponents(VLength);
656 this->SetPixelType(IOPixelEnum::FIXEDARRAY);
657 this->SetComponentType(MapPixelType<TPixel>::CType);
658 }
659 template <typename TPixel>
660 void
662 {
663 this->SetNumberOfComponents(1);
664 this->SetPixelType(IOPixelEnum::VARIABLELENGTHVECTOR);
665 this->SetComponentType(MapPixelType<TPixel>::CType);
666 }
667 template <typename TValue>
668 void
670 {
671 this->SetNumberOfComponents(1);
672 this->SetPixelType(IOPixelEnum::ARRAY);
673 this->SetComponentType(MapPixelType<TValue>::CType);
674 }
675 template <typename TPixel, unsigned int VLength>
676 void
678 {
679 this->SetNumberOfComponents(VLength * VLength);
680 this->SetPixelType(IOPixelEnum::MATRIX);
681 this->SetComponentType(MapPixelType<TPixel>::CType);
682 }
683 template <typename TValue>
684 void
686 {
687 this->SetNumberOfComponents(1);
688 this->SetPixelType(IOPixelEnum::VARIABLESIZEMATRIX);
689 this->SetComponentType(MapPixelType<TValue>::CType);
690 }
694protected:
696 ~ImageIOBase() override;
697 void
698 PrintSelf(std::ostream & os, Indent indent) const override;
699
700 virtual const ImageRegionSplitterBase *
702
707 virtual bool
708 HasSupportedReadExtension(const char * fileName, bool ignoreCase = true);
709 virtual bool
710 HasSupportedWriteExtension(const char * fileName, bool ignoreCase = true);
715
719
722
724
726 bool m_Initialized{};
727
729 std::string m_FileName{};
730
733 unsigned int m_NumberOfComponents{};
734
736 unsigned int m_NumberOfDimensions{ 0 };
737
739 bool m_UseCompression{ false };
740
741
742 int m_CompressionLevel{ 30 };
743 int m_MaximumCompressionLevel{ 100 };
744 std::string m_Compressor{ "uninitialized" };
745
747 virtual void
749 itkGetConstMacro(MaximumCompressionLevel, int);
755 virtual void
756 InternalSetCompressor(const std::string & _compressor);
757
759 bool m_UseStreamedReading{};
760
762 bool m_UseStreamedWriting{};
763
765 bool m_ExpandRGBPalette{};
766
769 bool m_IsReadAsScalarPlusPalette{};
770
772 bool m_WritePalette{};
773
776 ImageIORegion m_IORegion{};
777
779 std::vector<SizeValueType> m_Dimensions{};
780
783 std::vector<double> m_Spacing{};
784
786 std::vector<double> m_Origin{};
787
789 std::vector<std::vector<double>> m_Direction{};
790
793 std::vector<SizeType> m_Strides{};
794
796 virtual void
797 Reset(const bool freeDynamic = true);
798
800 void
801 Resize(const unsigned int numDimensions, const unsigned int * dimensions);
802
805 virtual unsigned int
807
814 void
816
821
826
831
843 virtual void
844 OpenFileForReading(std::ifstream & inputStream, const std::string & filename, bool ascii = false);
845
861 virtual void
862 OpenFileForWriting(std::ofstream & outputStream,
863 const std::string & filename,
864 bool truncate = true,
865 bool ascii = false);
866
868 virtual void
869 WriteBufferAsASCII(std::ostream & os, const void * buffer, IOComponentEnum ctype, SizeType numComp);
870
872 virtual void
873 ReadBufferAsASCII(std::istream & is, void * buffer, IOComponentEnum ctype, SizeType numComp);
874
876 bool
877 ReadBufferAsBinary(std::istream & is, void * buffer, SizeType num);
878
880 void
881 AddSupportedReadExtension(const char * extension);
882
884 void
885 AddSupportedWriteExtension(const char * extension);
886
887
888 void
890 void
892
895 virtual unsigned int
896 GetActualNumberOfSplitsForWritingCanStreamWrite(unsigned int numberOfRequestedSplits,
897 const ImageIORegion & pasteRegion) const;
898
901 virtual ImageIORegion
903 unsigned int numberOfActualSplits,
904 const ImageIORegion & pasteRegion) const;
905
906private:
907 bool
908 HasSupportedExtension(const char *, const ArrayOfExtensionsType &, bool ignoreCase = true);
909
910 ArrayOfExtensionsType m_SupportedReadExtensions{};
911 ArrayOfExtensionsType m_SupportedWriteExtensions{};
912};
913
915extern ITKIOImageBase_EXPORT void
917 const void * buffer,
918 std::ofstream & file,
919 IOByteOrderEnum byteOrder,
920 SizeValueType numberOfBytes,
921 SizeValueType numberOfComponents);
922
924extern ITKIOImageBase_EXPORT void
926 void * buffer,
927 IOByteOrderEnum byteOrder,
928 SizeValueType numberOfComponents);
929
930#define IMAGEIOBASE_TYPEMAP(type, ctype) \
931 template <> \
932 struct ImageIOBase::MapPixelType<type> \
933 { \
934 static constexpr IOComponentEnum CType = ctype; \
935 }
936
937// the following typemaps are not platform independent
939IMAGEIOBASE_TYPEMAP(char, std::numeric_limits<char>::is_signed ? IOComponentEnum::CHAR : IOComponentEnum::UCHAR);
951#undef IMAGIOBASE_TYPEMAP
952
953} // end namespace itk
954
955#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.
Definition: itkFixedArray.h:54
Abstract superclass defines image IO interface.
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 > *)
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 > *)
void SetByteOrderToBigEndian()
virtual void SetOrigin(unsigned int i, double origin)
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
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
virtual unsigned int GetPixelSize() const
SizeType GetRowStride() const
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)
virtual unsigned int GetComponentSize() const
SizeType GetComponentStride() const
std::string GetByteOrderAsString(IOByteOrderEnum) const
virtual const ImageRegionSplitterBase * GetImageRegionSplitter() const
SizeType GetImageSizeInBytes() const
void SetTypeInfo(const TPixel *)
void SetPixelTypeInfo(const Point< TCoordRep, VPointDimension > *)
virtual bool SupportsDimension(unsigned long dim)
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
void SetFileTypeToBinary()
virtual bool CanStreamWrite()
static IOComponentEnum GetComponentTypeFromString(const std::string &typeString)
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 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 > *)
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
static std::string GetComponentTypeAsString(IOComponentEnum)
static std::string GetPixelTypeAsString(IOPixelEnum)
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 *)
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
virtual void Read(void *buffer)=0
void SetPixelTypeInfo(const VariableLengthVector< TPixel > *)
virtual void OpenFileForReading(std::ifstream &inputStream, const std::string &filename, bool ascii=false)
Opens a file for reading and random access.
virtual SizeType GetPixelStride() const
itk::IndexValueType IndexValueType
void PrintSelf(std::ostream &os, Indent indent) const override
virtual const std::type_info & GetComponentTypeInfo() const
SizeType GetSliceStride() const
An ImageIORegion represents a structured region of data.
Divide an image region into several pieces.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Light weight base class for most itk classes.
LightProcessObject is the base class for all process objects (source, filters, mappers) in the Insigh...
A templated class holding a M x N size Matrix.
Definition: itkMatrix.h:53
Base class for most ITK classes.
Definition: itkObject.h:62
Represent Red, Green, Blue and Alpha components for color images.
Definition: itkRGBAPixel.h:60
Represent Red, Green and Blue components for color images.
Definition: itkRGBPixel.h:59
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
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
IMAGEIOBASE_TYPEMAP(signed char, IOComponentEnum::CHAR)
CommonEnums::IOComponent IOComponentEnum
CommonEnums::IOByteOrder IOByteOrderEnum
ITKIOImageBase_EXPORT void WriteRawBytesAfterSwapping(IOComponentEnum componentType, const void *buffer, std::ofstream &file, IOByteOrderEnum byteOrder, SizeValueType numberOfBytes, SizeValueType numberOfComponents)
long IndexValueType
Definition: itkIntTypes.h:93
CommonEnums::IOPixel IOPixelEnum
CommonEnums::IOFile IOFileEnum
unsigned long SizeValueType
Definition: itkIntTypes.h:86
long OffsetValueType
Definition: itkIntTypes.h:97
ITKIOImageBase_EXPORT void ReadRawBytesAfterSwapping(IOComponentEnum componentType, void *buffer, IOByteOrderEnum byteOrder, SizeValueType numberOfComponents)
Represent a n-dimensional offset between two n-dimensional indexes of n-dimensional image.
Definition: itkOffset.h:67