[ITK] [ITK-users] ScalarImageToTextureFeaturesFilter

Zou Jing zjinger at hotmail.com
Sun Jun 24 23:27:37 EDT 2018


Dear all,

I am new to ITK and  I want to calculate texture features of  NIFTI images.
But the result of different images are all the same, the result are 1 0 1 0 0 0
I’d appreciate it if you could help me .
Many thanks.

Here attached the code :

#include "itkImage.h"
#include "itkScalarImageToTextureFeaturesFilter.h"
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
#include "itkNiftiImageIO.h"


typedef itk::Image<float, 3> ImageType;


int main()
{
         typedef itk::ImageFileReader<ImageType>ReaderType;
         ReaderType::Pointer reader = ReaderType::New();
         ReaderType::Pointer reader1 = ReaderType::New();


         reader->SetFileName("C:/Users/studentx/Downloads/lung_data/NormalLung2/F63y/F63_2013.nii");
         reader->Update();

         reader1->SetFileName("C:/Users/studentx/Downloads/lung_data/NormalLung2/F63y/F63_2013_mask.nii");
         reader1->Update();


         typedef itk::Statistics::ScalarImageToTextureFeaturesFilter<ImageType> TextureFilterType;
         TextureFilterType::Pointer textureFilter = TextureFilterType::New();
         textureFilter->SetInput(reader->GetOutput());
         textureFilter->SetMaskImage(reader1->GetOutput());

         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;
}


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://itk.org/pipermail/community/attachments/20180625/49748707/attachment.html>
-------------- next part --------------
The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there!
________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.php

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
https://itk.org/mailman/listinfo/insight-users


More information about the Community mailing list