ITK/Examples/Images/Size: Difference between revisions

From KitwarePublic
< ITK‎ | Examples
Jump to navigationJump to search
mNo edit summary
(Deprecated content that is moved to sphinx)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
This class is used to represent the size of a region in an image.  
{{warning|1=The media wiki content on this page is no longer maintained.  The examples presented on the https://itk.org/Wiki/*  pages likely require ITK version 4.13 or earlier releases.  In many cases, the examples on this page no longer conform to the best practices for modern ITK versions.
}}


==Size.cxx==
[https://itk.org/ITKExamples[ITK Sphinx Examples]]
<source lang="cpp">
#include "itkSize.h"
 
int main(int, char *[])
{
  itk::Size<2> size;
  // You will often get this type from an image type. That is, ImageType::SizeType rather than itk::Size<2> explicitly.
 
  // Method 1 - set both components (size[0] and size[1]) to the same value (in this case, 0).
  size.Fill(0);
  std::cout << size << std::endl;
 
  // Method 2 - set each component separately.
  size[0] = 1;
  size[1] = 2;
 
  std::cout << size << std::endl;
 
  return EXIT_SUCCESS;
}
 
</source>
 
{{ITKCMakeLists|Size}}

Latest revision as of 20:41, 30 May 2019

Warning: The media wiki content on this page is no longer maintained. The examples presented on the https://itk.org/Wiki/* pages likely require ITK version 4.13 or earlier releases. In many cases, the examples on this page no longer conform to the best practices for modern ITK versions.

[ITK Sphinx Examples]