Orfeo Toolbox  4.0
itkImageIOBase.cxx
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 
19 #include "itkImageIOBase.h"
21 #include "itkSimpleFastMutexLock.h"
22 #include "itkMutexLockHolder.h"
23 
24 namespace itk
25 {
27  m_PixelType(SCALAR),
28  m_ComponentType(UNKNOWNCOMPONENTTYPE),
29  m_ByteOrder(OrderNotApplicable),
30  m_FileType(TypeNotApplicable),
31  m_NumberOfDimensions(0)
32 {
33  Reset(false);
34 }
35 
36 void ImageIOBase::Reset(const bool)
37 {
38  m_Initialized = false;
39  m_FileName = "";
41  for ( unsigned int i = 0; i < m_NumberOfDimensions; i++ )
42  {
43  m_Dimensions[i] = 0;
44  m_Strides[i] = 0;
45  }
46  m_NumberOfDimensions = 0;
47  m_UseCompression = false;
48  m_UseStreamedReading = false;
49  m_UseStreamedWriting = false;
50 }
51 
53 {}
54 
57 {
58  return this->m_SupportedWriteExtensions;
59 }
60 
63 {
64  return this->m_SupportedReadExtensions;
65 }
66 
67 void ImageIOBase::AddSupportedReadExtension(const char *extension)
68 {
69  this->m_SupportedReadExtensions.push_back(extension);
70 }
71 
72 void ImageIOBase::AddSupportedWriteExtension(const char *extension)
73 {
74  this->m_SupportedWriteExtensions.push_back(extension);
75 }
76 
77 void ImageIOBase::Resize(const unsigned int numDimensions,
78  const unsigned int *dimensions)
79 {
80  m_NumberOfDimensions = numDimensions;
81  if ( dimensions != NULL )
82  {
83  for ( unsigned int i = 0; i < m_NumberOfDimensions; i++ )
84  {
85  m_Dimensions[i] = dimensions[i];
86  }
88  }
89 }
90 
91 void ImageIOBase::SetDimensions(unsigned int i, unsigned int dim)
92 {
93  if ( i >= m_Dimensions.size() )
94  {
95  itkWarningMacro( "Index: " << i
96  << " is out of bounds, expected maximum is "
97  << m_Dimensions.size() );
98  itkExceptionMacro( "Index: " << i
99  << " is out of bounds, expected maximum is "
100  << m_Dimensions.size() );
101  }
102  this->Modified();
103  m_Dimensions[i] = dim;
104 }
105 
106 void ImageIOBase::SetOrigin(unsigned int i, double origin)
107 {
108  if ( i >= m_Origin.size() )
109  {
110  itkWarningMacro( "Index: " << i
111  << " is out of bounds, expected maximum is "
112  << m_Origin.size() );
113  itkExceptionMacro( "Index: " << i
114  << " is out of bounds, expected maximum is "
115  << m_Origin.size() );
116  }
117  this->Modified();
118  m_Origin[i] = origin;
119 }
120 
121 void ImageIOBase::SetSpacing(unsigned int i, double spacing)
122 {
123  if ( i >= m_Spacing.size() )
124  {
125  itkWarningMacro( "Index: " << i
126  << " is out of bounds, expected maximum is "
127  << m_Spacing.size() );
128  itkExceptionMacro( "Index: " << i
129  << " is out of bounds, expected maximum is "
130  << m_Spacing.size() );
131  }
132  this->Modified();
133  m_Spacing[i] = spacing;
134 }
135 
136 void ImageIOBase::SetDirection(unsigned int i, const std::vector< double > & direction)
137 {
138  if ( i >= m_Direction.size() )
139  {
140  itkWarningMacro( "Index: " << i
141  << " is out of bounds, expected maximum is "
142  << m_Direction.size() );
143  itkExceptionMacro( "Index: " << i
144  << " is out of bounds, expected maximum is "
145  << m_Direction.size() );
146  }
147  this->Modified();
148  m_Direction[i] = direction;
149 }
150 
151 void ImageIOBase::SetDirection(unsigned int i, const vnl_vector< double > & direction)
152 {
153  if ( i >= m_Direction.size() )
154  {
155  itkWarningMacro( "Index: " << i
156  << " is out of bounds, expected maximum is "
157  << m_Direction.size() );
158  itkExceptionMacro( "Index: " << i
159  << " is out of bounds, expected maximum is "
160  << m_Direction.size() );
161  }
162  this->Modified();
163  std::vector< double > v;
164  v.resize( m_Direction.size() );
165  for ( unsigned int j = 0; j < v.size(); j++ )
166  {
167  v[j] = direction[j];
168  }
169  m_Direction[i] = v;
170 }
171 
172 const std::type_info & ImageIOBase::GetComponentTypeInfo() const
173 {
174  switch ( m_ComponentType )
175  {
176  case UCHAR:
177  return typeid( unsigned char );
178  case CHAR:
179  return typeid( char );
180  case USHORT:
181  return typeid( unsigned short );
182  case SHORT:
183  return typeid( short );
184  case UINT:
185  return typeid( unsigned int );
186  case INT:
187  return typeid( int );
188  case ULONG:
189  return typeid( unsigned long );
190  case LONG:
191  return typeid( long );
192  case FLOAT:
193  return typeid( float );
194  case DOUBLE:
195  return typeid( double );
197  default:
198  itkExceptionMacro ("Unknown component type: " << m_ComponentType);
199  }
200  return typeid( ImageIOBase::UnknownType );
201 }
202 
204 {
205  m_Strides[0] = this->GetComponentSize();
207  for ( unsigned int i = 2; i <= ( m_NumberOfDimensions + 1 ); i++ )
208  {
209  m_Strides[i] = static_cast<SizeType>(m_Dimensions[i - 2]) * m_Strides[i - 1];
210  }
211 }
212 
213 // Calculates the image size in PIXELS
217 {
218  unsigned int i;
219  SizeType numPixels = 1;
220 
221  for ( i = 0; i < m_NumberOfDimensions; i++ )
222  {
223  numPixels *= m_Dimensions[i];
224  }
225 
226  return numPixels;
227 }
228 
232 {
233  return ( this->GetImageSizeInPixels() * m_NumberOfComponents );
234 }
235 
239 {
240  return ( this->GetImageSizeInComponents() * this->GetComponentSize() );
241 }
242 
246 {
247  return m_Strides[0];
248 }
249 
253 {
254  return m_Strides[1];
255 }
256 
260 {
261  return m_Strides[2];
262 }
263 
267 {
268  return m_Strides[3];
269 }
270 
272 {
273  if ( dim != m_NumberOfDimensions )
274  {
275  m_Origin.resize(dim);
276  m_Spacing.resize(dim);
277  m_Direction.resize(dim);
278  m_Strides.resize(dim + 2);
279  m_NumberOfDimensions = dim;
280  m_Dimensions.resize(dim);
281  m_Direction.resize(dim);
282  std::vector< double > axis(dim);
283  for ( unsigned int i = 0; i < dim; i++ )
284  {
285  for ( unsigned int j = 0; j < dim; j++ )
286  {
287  if ( i == j )
288  {
289  axis[j] = 1.0;
290  }
291  else
292  {
293  axis[j] = 0.0;
294  }
295  }
296  this->SetDirection(i, axis);
297  this->SetOrigin(i, 0.0);
298  this->SetSpacing(i, 1.0);
299  }
300  this->Modified();
301  }
302 }
303 
304 bool
306 ::ReadBufferAsBinary(std::istream & is, void *buffer, ImageIOBase::SizeType num)
307 {
308  const std::streamsize numberOfBytesToBeRead = Math::CastWithRangeCheck< std::streamsize >(num);
309 
310  is.read(static_cast< char * >( buffer ), numberOfBytesToBeRead);
311 
312  const std::streamsize numberOfBytesRead = is.gcount();
313 
314 #ifdef __APPLE_CC__
315  // fail() is broken in the Mac. It returns true when reaches eof().
316  if ( numberOfBytesRead != numberOfBytesToBeRead )
317 #else
318  if ( ( numberOfBytesRead != numberOfBytesToBeRead ) || is.fail() )
319 #endif
320  {
321  return false; // read failed
322  }
323 
324  return true;
325 }
326 
327 unsigned int ImageIOBase::GetPixelSize() const
328 {
331  {
332  itkExceptionMacro ("Unknown pixel or component type: ("
333  << m_PixelType << ", " << m_ComponentType << ")");
334  return 0;
335  }
336 
337  return this->GetComponentSize() * this->GetNumberOfComponents();
338 }
339 
340 unsigned int ImageIOBase::GetComponentSize() const
341 {
342  switch ( m_ComponentType )
343  {
344  case UCHAR:
345  return sizeof( unsigned char );
346  case CHAR:
347  return sizeof( char );
348  case USHORT:
349  return sizeof( unsigned short );
350  case SHORT:
351  return sizeof( short );
352  case UINT:
353  return sizeof( unsigned int );
354  case INT:
355  return sizeof( int );
356  case ULONG:
357  return sizeof( unsigned long );
358  case LONG:
359  return sizeof( long );
360  case FLOAT:
361  return sizeof( float );
362  case DOUBLE:
363  return sizeof( double );
365  default:
366  itkExceptionMacro ("Unknown component type: " << m_ComponentType);
367  }
368 
369  return 0;
370 }
371 
373 {
374  switch ( t )
375  {
376  case ASCII:
377  return std::string( "ASCII");
378  case Binary:
379  return std::string( "Binary");
380  case TypeNotApplicable:
381  default:
382  return std::string( "TypeNotApplicable");
383  }
384  //Not reachable return s = "TypeNotApplicable";
385 }
386 
388 {
389  switch ( t )
390  {
391  case BigEndian:
392  return std::string( "BigEndian");
393  case LittleEndian:
394  return std::string( "LittleEndian");
395  case OrderNotApplicable:
396  default:
397  return std::string( "OrderNotApplicable");
398  }
399 }
400 
402 {
403  switch ( t )
404  {
405  case UCHAR:
406  return std::string( "unsigned_char" );
407  case CHAR:
408  return std::string( "char" );
409  case USHORT:
410  return std::string( "unsigned_short" );
411  case SHORT:
412  return std::string( "short" );
413  case UINT:
414  return std::string( "unsigned_int" );
415  case INT:
416  return std::string( "int" );
417  case ULONG:
418  return std::string( "unsigned_long" );
419  case LONG:
420  return std::string( "long" );
421  case FLOAT:
422  return std::string( "float" );
423  case DOUBLE:
424  return std::string( "double" );
426  return std::string( "unknown" );
427  default:
428  return std::string( "unknown" );
429  }
430 }
431 
433 {
434  if(typeString.compare("unsigned_char") == 0)
435  {
436  return UCHAR;
437  }
438  else if(typeString.compare("char") == 0)
439  {
440  return CHAR;
441  }
442  else if(typeString.compare("unsigned_short") == 0)
443  {
444  return USHORT;
445  }
446  else if(typeString.compare("short") == 0)
447  {
448  return SHORT;
449  }
450  else if(typeString.compare("unsigned_int") == 0)
451  {
452  return UINT;
453  }
454  else if(typeString.compare("int") == 0)
455  {
456  return INT;
457  }
458  else if(typeString.compare("unsigned_long") == 0)
459  {
460  return ULONG;
461  }
462  else if(typeString.compare("long") == 0)
463  {
464  return LONG;
465  }
466  else if(typeString.compare("float") == 0)
467  {
468  return FLOAT;
469  }
470  else if(typeString.compare("double") == 0)
471  {
472  return DOUBLE;
473  }
474  else
475  {
476  return UNKNOWNCOMPONENTTYPE;
477  }
478 }
479 
481 {
482  switch ( t )
483  {
484  case SCALAR:
485  return std::string( "scalar" );
486  case VECTOR:
487  return std::string( "vector" );
488  case COVARIANTVECTOR:
489  return std::string( "covariant_vector" );
490  case POINT:
491  return std::string( "point" );
492  case OFFSET:
493  return std::string( "offset" );
494  case RGB:
495  return std::string( "rgb" );
496  case RGBA:
497  return std::string( "rgba" );
499  return std::string( "symmetric_second_rank_tensor" );
500  case DIFFUSIONTENSOR3D:
501  return std::string( "diffusion_tensor_3D" );
502  case COMPLEX:
503  return std::string( "complex" );
504  case UNKNOWNPIXELTYPE:
505  return std::string( "unknown" );
506  default:
507  return std::string( "unknown" );
508  }
509 }
510 
512 {
513  if(pixelString.compare("scalar") == 0)
514  {
515  return SCALAR;
516  }
517  else if(pixelString.compare("vector") == 0)
518  {
519  return VECTOR;
520  }
521  else if(pixelString.compare("covariant_vector") == 0)
522  {
523  return COVARIANTVECTOR;
524  }
525  else if(pixelString.compare("point") == 0)
526  {
527  return POINT;
528  }
529  else if(pixelString.compare("offset") == 0)
530  {
531  return OFFSET;
532  }
533  else if(pixelString.compare("rgb") == 0)
534  {
535  return RGB;
536  }
537  else if(pixelString.compare("rgba") == 0)
538  {
539  return RGBA;
540  }
541  else if(pixelString.compare("symmetric_second_rank_tensor") == 0)
542  {
544  }
545  else if(pixelString.compare("diffusion_tensor_3D") == 0)
546  {
547  return DIFFUSIONTENSOR3D;
548  }
549  else if(pixelString.compare("complex") == 0)
550  {
551  return COMPLEX;
552  }
553  else
554  {
555  return UNKNOWNPIXELTYPE;
556  }
557 }
558 
559 namespace
560 {
561 template< typename TComponent >
562 void WriteBuffer(std::ostream & os, const TComponent *buffer, ImageIOBase::SizeType num)
563 {
564  const TComponent *ptr = buffer;
565 
566  typedef typename itk::NumericTraits< TComponent >::PrintType PrintType;
567  for ( ImageIOBase::SizeType i = 0; i < num; i++ )
568  {
569  if ( !( i % 6 ) && i )
570  {
571  os << "\n";
572  }
573  os << PrintType(*ptr++) << " ";
574  }
575 }
576 }
577 void ImageIOBase::WriteBufferAsASCII(std::ostream & os, const void *buffer,
578  IOComponentType ctype,
579  ImageIOBase::SizeType numComp)
580 {
581  switch ( ctype )
582  {
583  case UCHAR:
584  {
585  typedef const unsigned char *Type;
586  Type buf = reinterpret_cast< Type >( buffer );
587  WriteBuffer(os, buf, numComp);
588  }
589  break;
590  case CHAR:
591  {
592  typedef const char *Type;
593  Type buf = reinterpret_cast< Type >( buffer );
594  WriteBuffer(os, buf, numComp);
595  }
596  break;
597 
598  case USHORT:
599  {
600  typedef const unsigned short *Type;
601  Type buf = reinterpret_cast< Type >( buffer );
602  WriteBuffer(os, buf, numComp);
603  }
604  break;
605 
606  case SHORT:
607  {
608  typedef const short *Type;
609  Type buf = reinterpret_cast< Type >( buffer );
610  WriteBuffer(os, buf, numComp);
611  }
612  break;
613 
614  case UINT:
615  {
616  typedef const unsigned int *Type;
617  Type buf = reinterpret_cast< Type >( buffer );
618  WriteBuffer(os, buf, numComp);
619  }
620  break;
621 
622  case INT:
623  {
624  typedef const int *Type;
625  Type buf = reinterpret_cast< Type >( buffer );
626  WriteBuffer(os, buf, numComp);
627  }
628  break;
629 
630  case ULONG:
631  {
632  typedef const unsigned long *Type;
633  Type buf = reinterpret_cast< Type >( buffer );
634  WriteBuffer(os, buf, numComp);
635  }
636  break;
637 
638  case LONG:
639  {
640  typedef const long *Type;
641  Type buf = reinterpret_cast< Type >( buffer );
642  WriteBuffer(os, buf, numComp);
643  }
644  break;
645 
646  case FLOAT:
647  {
648  typedef const float *Type;
649  Type buf = reinterpret_cast< Type >( buffer );
650  WriteBuffer(os, buf, numComp);
651  }
652  break;
653 
654  case DOUBLE:
655  {
656  typedef const double *Type;
657  Type buf = reinterpret_cast< Type >( buffer );
658  WriteBuffer(os, buf, numComp);
659  }
660  break;
661 
662  default:
663  break;
664  }
665 }
666 
667 namespace
668 {
669 template< typename TComponent >
670 void ReadBuffer(std::istream & is, TComponent *buffer, ImageIOBase::SizeType num)
671 {
672  typedef typename itk::NumericTraits< TComponent >::PrintType PrintType;
673  PrintType temp;
674  TComponent *ptr = buffer;
675  for ( ImageIOBase::SizeType i = 0; i < num; i++, ptr++ )
676  {
677  is >> temp;
678  *ptr = static_cast< TComponent >( temp );
679  }
680 }
681 }
682 void ImageIOBase::ReadBufferAsASCII(std::istream & is, void *buffer,
683  IOComponentType ctype,
684  ImageIOBase::SizeType numComp)
685 {
686  switch ( ctype )
687  {
688  case UCHAR:
689  {
690  unsigned char *buf = reinterpret_cast< unsigned char * >( buffer );
691  ReadBuffer(is, buf, numComp);
692  }
693  break;
694  case CHAR:
695  {
696  char *buf = reinterpret_cast< char * >( buffer );
697  ReadBuffer(is, buf, numComp);
698  }
699  break;
700 
701  case USHORT:
702  {
703  unsigned short *buf = reinterpret_cast< unsigned short * >( buffer );
704  ReadBuffer(is, buf, numComp);
705  }
706  break;
707 
708  case SHORT:
709  {
710  short *buf = reinterpret_cast< short * >( buffer );
711  ReadBuffer(is, buf, numComp);
712  }
713  break;
714 
715  case UINT:
716  {
717  unsigned int *buf = reinterpret_cast< unsigned int * >( buffer );
718  ReadBuffer(is, buf, numComp);
719  }
720  break;
721 
722  case INT:
723  {
724  int *buf = reinterpret_cast< int * >( buffer );
725  ReadBuffer(is, buf, numComp);
726  }
727  break;
728 
729  case ULONG:
730  {
731  unsigned long *buf = reinterpret_cast< unsigned long * >( buffer );
732  ReadBuffer(is, buf, numComp);
733  }
734  break;
735 
736  case LONG:
737  {
738  long *buf = reinterpret_cast< long * >( buffer );
739  ReadBuffer(is, buf, numComp);
740  }
741  break;
742 
743  case FLOAT:
744  {
745  float *buf = reinterpret_cast< float * >( buffer );
746  ReadBuffer(is, buf, numComp);
747  }
748  break;
749 
750  case DOUBLE:
751  {
752  double *buf = reinterpret_cast< double * >( buffer );
753  ReadBuffer(is, buf, numComp);
754  }
755  break;
756 
757  default:
758  break;
759  }
760 }
761 
762 namespace
763 {
764 SimpleFastMutexLock ioDefaultSplitterLock;
765 ImageRegionSplitterBase::Pointer ioDefaultSplitter;
766 
767 }
768 
769 const ImageRegionSplitterBase*
771 {
772  if ( ioDefaultSplitter.IsNull() )
773  {
774  // thread safe lazy initialization, prevent race condition on
775  // setting, with an atomic set if null.
776  MutexLockHolder< SimpleFastMutexLock > lock(ioDefaultSplitterLock);
777  if ( ioDefaultSplitter.IsNull() )
778  {
779  ioDefaultSplitter = ImageRegionSplitterSlowDimension::New().GetPointer();
780  }
781  }
782  return ioDefaultSplitter;
783 }
784 
785 unsigned int
787  const ImageIORegion & pasteRegion) const
788 {
789  const ImageRegionSplitterBase* splitter = this->GetImageRegionSplitter();
790  return splitter->GetNumberOfSplits(pasteRegion, numberOfRequestedSplits);
791 }
792 
793 unsigned int
794 ImageIOBase::GetActualNumberOfSplitsForWriting(unsigned int numberOfRequestedSplits,
795  const ImageIORegion & pasteRegion,
796  const ImageIORegion & largestPossibleRegion)
797 {
798  if ( this->CanStreamWrite() )
799  {
800  return GetActualNumberOfSplitsForWritingCanStreamWrite(numberOfRequestedSplits, pasteRegion);
801  }
802  if ( pasteRegion != largestPossibleRegion )
803  {
804  itkExceptionMacro( "Pasting is not supported! Can't write:" << this->GetFileName() );
805  }
806  if ( numberOfRequestedSplits != 1 )
807  {
808  itkDebugMacro("Requested more then 1 splits for streaming");
809  itkDebugMacro("This IO class does not support streaming!");
810  }
811  return 1;
812 }
813 
816  unsigned int numberOfActualSplits,
817  const ImageIORegion & pasteRegion) const
818 {
819  ImageIORegion splitRegion = pasteRegion;
820 
821  const ImageRegionSplitterBase* splitter = this->GetImageRegionSplitter();
822  splitter->GetSplit( ithPiece, numberOfActualSplits, splitRegion );
823 
824  return splitRegion;
825 }
826 
829  unsigned int numberOfActualSplits,
830  const ImageIORegion & pasteRegion,
831  const ImageIORegion & largestPossibleRegion)
832 {
833  if ( this->CanStreamWrite() )
834  {
835  return GetSplitRegionForWritingCanStreamWrite(ithPiece, numberOfActualSplits, pasteRegion);
836  }
837  return largestPossibleRegion;
838 }
839 
847  const ImageIORegion & requested) const
848 {
849  //
850  // The default implementations determines that the streamable region is
851  // equal to the minimal size of the image in the file. That is two
852  // say the return ImageIORegion::GetImageSizeInPixels() is equal to
853  // the number in the file.
854  //
855 
856  // Since the image in the file may have a lower or higher dimension
857  // than the image type over which the ImageFileReader is
858  // being instantiated we must choose an image dimension which will
859  // represent all the pixels. That is we can trim trailing 1s.
860 
861  unsigned int minIODimension = this->m_NumberOfDimensions;
862 
863  while ( minIODimension )
864  {
865  if ( this->m_Dimensions[minIODimension - 1] == 1 )
866  {
867  --minIODimension;
868  }
869  else
870  {
871  break;
872  }
873  }
874 
875  // dimension size we use to represent the region
876  unsigned int maxDimension =
877  minIODimension > requested.GetImageDimension() ? minIODimension : requested.GetImageDimension();
878 
879  // First: allocate with the correct dimensions
880  ImageIORegion streamableRegion(maxDimension);
881 
882  // Second: copy only the number of dimension that the file has.
883  for ( unsigned int i = 0; i < minIODimension; i++ )
884  {
885  streamableRegion.SetSize(i, this->m_Dimensions[i]);
886  streamableRegion.SetIndex(i, 0);
887  }
888 
889  // Third: set the rest to the default : start = 0, size = 1
890  for ( unsigned int j = minIODimension; j < streamableRegion.GetImageDimension(); j++ )
891  {
892  streamableRegion.SetSize(j, 1);
893  streamableRegion.SetIndex(j, 0);
894  }
895 
896  // Finally: return the streamable region
897  return streamableRegion;
898 }
899 
903 std::vector< double >
905 ::GetDefaultDirection(unsigned int k) const
906 {
907  std::vector< double > axis;
908  axis.resize( this->GetNumberOfDimensions() );
909 
910  // Fill up with the equivalent of a line from an Identity matrix
911  for ( unsigned int r = 0; r < axis.size(); r++ )
912  {
913  axis[r] = 0.0;
914  }
915 
916  axis[k] = 1.0;
917 
918  return axis;
919 }
920 
921 void ImageIOBase::PrintSelf(std::ostream & os, Indent indent) const
922 {
923  Superclass::PrintSelf(os, indent);
924 
925  os << indent << "FileName: " << m_FileName << std::endl;
926  os << indent << "FileType: " << this->GetFileTypeAsString(m_FileType) << std::endl;
927  os << indent << "ByteOrder: " << this->GetByteOrderAsString(m_ByteOrder) << std::endl;
928  os << indent << "IORegion: " << std::endl;
929  m_IORegion.Print( os, indent.GetNextIndent() );
930  os << indent << "Number of Components/Pixel: " << m_NumberOfComponents << "\n";
931  os << indent << "Pixel Type: " << this->GetPixelTypeAsString(m_PixelType) << std::endl;
932  os << indent << "Component Type: " << this->GetComponentTypeAsString(m_ComponentType)
933  << std::endl;
934  os << indent << "Dimensions: ( ";
935  for ( unsigned int i = 0; i < m_NumberOfDimensions; i++ )
936  {
937  os << m_Dimensions[i] << " ";
938  }
939  os << ")" << std::endl;
940  os << indent << "Origin: ( ";
941  for ( unsigned int i = 0; i < m_NumberOfDimensions; i++ )
942  {
943  os << m_Origin[i] << " ";
944  }
945  os << ")" << std::endl;
946 
947  if ( m_UseCompression )
948  {
949  os << indent << "UseCompression: On" << std::endl;
950  }
951  else
952  {
953  os << indent << "UseCompression: Off" << std::endl;
954  }
955  if ( m_UseStreamedReading )
956  {
957  os << indent << "UseStreamedReading: On" << std::endl;
958  }
959  else
960  {
961  os << indent << "UseStreamedReading: Off" << std::endl;
962  }
963  if ( m_UseStreamedWriting )
964  {
965  os << indent << "UseStreamedWriting: On" << std::endl;
966  }
967  else
968  {
969  os << indent << "UseStreamedWriting: Off" << std::endl;
970  }
971 }
972 
973 } //namespace itk

Generated at Sat Mar 8 2014 14:50:10 for Orfeo Toolbox with doxygen 1.8.3.1