<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
font-size:10.5pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
.MsoChpDefault
{mso-style-type:export-only;}
/* Page Definitions */
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="blue" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal">Dear all,</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I am new to ITK and I want to calculate texture features of NIFTI images.</p>
<p class="MsoNormal">But the result of different images are all the same, the result are 1 0 1 0 0 0
</p>
<p class="MsoNormal">I’d appreciate it if you could help me .</p>
<p class="MsoNormal">Many thanks.</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Here attached the code :</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">#include "itkImage.h"</p>
<p class="MsoNormal">#include "itkScalarImageToTextureFeaturesFilter.h"</p>
<p class="MsoNormal">#include "itkImageFileReader.h"</p>
<p class="MsoNormal">#include "itkImageFileWriter.h"</p>
<p class="MsoNormal">#include "itkNiftiImageIO.h"</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">typedef itk::Image<float, 3> ImageType;</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">int main()</p>
<p class="MsoNormal">{</p>
<p class="MsoNormal"> typedef itk::ImageFileReader<ImageType>ReaderType;</p>
<p class="MsoNormal"> ReaderType::Pointer reader = ReaderType::New();</p>
<p class="MsoNormal"> ReaderType::Pointer reader1 = ReaderType::New();</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> reader->SetFileName("C:/Users/studentx/Downloads/lung_data/NormalLung2/F63y/F63_2013.nii");</p>
<p class="MsoNormal"> reader->Update();</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> reader1->SetFileName("C:/Users/studentx/Downloads/lung_data/NormalLung2/F63y/F63_2013_mask.nii");</p>
<p class="MsoNormal"> reader1->Update();</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> typedef itk::Statistics::ScalarImageToTextureFeaturesFilter<ImageType> TextureFilterType;</p>
<p class="MsoNormal"> TextureFilterType::Pointer textureFilter = TextureFilterType::New();</p>
<p class="MsoNormal"> textureFilter->SetInput(reader->GetOutput());</p>
<p class="MsoNormal"> textureFilter->SetMaskImage(reader1->GetOutput());</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> textureFilter->Update();</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> const TextureFilterType::FeatureValueVector* output = textureFilter->GetFeatureMeans();</p>
<p class="MsoNormal"> for (unsigned int i = 0; i < output->size(); ++i)</p>
<p class="MsoNormal"> {</p>
<p class="MsoNormal"> std::cout << (*output)[i] << std::endl;</p>
<p class="MsoNormal"> }</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"> return EXIT_SUCCESS;</p>
<p class="MsoNormal">}</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>