ITK/Examples/WishList/Statistics/ScalarImageToTextureFeaturesFilter: Difference between revisions

From KitwarePublic
< ITK‎ | Examples
Jump to navigationJump to search
No edit summary
(Deprecated content that is moved to sphinx)
 
Line 1: Line 1:
==ScalarImageToTextureFeaturesFilter.cxx==
{{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 releasesIn many cases, the examples on this page no longer conform to the best practices for modern ITK versions.}}
<source lang="cpp">
#include "itkImage.h"
#include "itkRandomImageSource.h"
#include "itkScalarImageToTextureFeaturesFilter.h"
 
typedef itk::Image<float, 2> ImageType;
 
static void CreateImage(ImageType::Pointer);
 
int main(int, char *[])
{
  ImageType::Pointer image = ImageType::New();
  CreateImage(image);
 
  typedef itk::Statistics::ScalarImageToTextureFeaturesFilter<ImageType> TextureFilterType;
  TextureFilterType::Pointer textureFilter = TextureFilterType::New();
  textureFilter->SetInput(image);
  textureFilter->Update();
 
  const TextureFilterType::FeatureValueVector* output = textureFilter->GetFeatureMeans();
  for(unsigned int i = 0; i < output->size(); ++i)
    {
    std::cout << (*output)[i] << std::endl;
    }
 
  return EXIT_SUCCESS;
}
 
static void CreateImage(ImageType::Pointer image)
{
  itk::Index<2> index;
  index.Fill(0);
 
  itk::Size<2> size;
  size.Fill(100);
 
   itk::ImageRegion<2> region(index, size);
  image->SetRegions(region);
  image->Allocate();
}
 
</source>
 
{{ITKCMakeLists|{{SUBPAGENAME}}}}

Latest revision as of 22:31, 7 June 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.