Dear ITK Users,<div><br></div><div>When i run this code, </div><div><div><br></div><div>//#include <itkDenseFrequencyContainer2.h></div><div>#include "itkHistogramToTextureFeaturesFilter.h"</div><div>#include "itkScalarImageToCooccurrenceMatrixFilter.h"</div>
</div><div><br></div><div><div>typedef itk::Neighborhood<float, Dimension> NeighborhoodType;</div><div>typedef itk::Statistics::ScalarImageToCooccurrenceMatrixFilter< FloatImageType > Image2CoOccuranceType;</div>
<div>typedef Image2CoOccuranceType::HistogramType HistogramType;</div><div>typedef itk::Statistics::HistogramToTextureFeaturesFilter<HistogramType> Hist2FeaturesType;</div><div>typedef FloatImageType::OffsetType OffsetType;</div>
<div>typedef itk::AddImageFilter < FloatImageType > AddImageFilterType;</div><div>typedef itk::MultiplyImageFilter< FloatImageType > MultiplyImageFilterType;</div></div><div><br></div><div><div>void calcTextureFeatureImage (OffsetType offset, FloatImageType::Pointer inputImage, FloatImageType::Pointer outInertia, </div>
<div><span class="Apple-tab-span" style="white-space:pre">                                                        </span> FloatImageType::Pointer outCorrelation, FloatImageType::Pointer outEnergy)</div><div>{</div><div> //allocate output images</div><div> outInertia->CopyInformation(inputImage);</div>
<div> outInertia->SetRegions(inputImage->GetLargestPossibleRegion());</div><div> outInertia->Allocate();</div><div> outInertia->FillBuffer(0);</div><div> outCorrelation->CopyInformation(inputImage);</div>
<div> outCorrelation->SetRegions(inputImage->GetLargestPossibleRegion());</div><div> outCorrelation->Allocate();</div><div> outCorrelation->FillBuffer(0);</div><div> outEnergy->CopyInformation(inputImage);</div>
<div> outEnergy->SetRegions(inputImage->GetLargestPossibleRegion());</div><div> outEnergy->Allocate();</div><div> outEnergy->FillBuffer(0);</div><div> </div><div> Image2CoOccuranceType::Pointer glcmGenerator=Image2CoOccuranceType::New();</div>
<div> glcmGenerator->SetOffset(offset);</div><div> glcmGenerator->SetNumberOfBinsPerAxis(16); //reasonable number of bins</div><div> glcmGenerator->SetPixelValueMinMax(0, 255); //for input UCHAR pixel type</div>
<div> Hist2FeaturesType::Pointer featureCalc=Hist2FeaturesType::New();</div><div> </div><div> typedef itk::RegionOfInterestImageFilter<FloatImageType,FloatImageType> roiType;</div><div> roiType::Pointer roi=roiType::New();</div>
<div> roi->SetInput(inputImage);</div><div> </div><div> FloatImageType::RegionType window;</div><div> FloatImageType::RegionType::SizeType size;</div><div> size.Fill(3); //window size=3x3x3</div><div> window.SetSize(size);</div>
<div> FloatImageType::IndexType pi; //pixel index</div><div> </div><div> //slide window over the entire image</div><div> for (unsigned x=1; x<inputImage->GetLargestPossibleRegion().GetSize(0)-1; x++)</div><div>
{</div><div> pi.SetElement(0,x);</div><div> window.SetIndex(0,x-1);</div><div> for (unsigned y=1; y<inputImage->GetLargestPossibleRegion().GetSize(1)-1; y++)</div><div> {</div><div> pi.SetElement(1,y);</div>
<div> window.SetIndex(1,y-1);</div><div> for (unsigned z=1; z<inputImage->GetLargestPossibleRegion().GetSize(2)-1; z++)</div><div> {</div><div> pi.SetElement(2,z);</div>
<div> window.SetIndex(2,z-1);</div><div> roi->SetRegionOfInterest(window);</div><div> roi->Update();</div><div> glcmGenerator->SetInput(roi->GetOutput());</div>
<div> glcmGenerator->Update();</div><div> featureCalc->SetInput( glcmGenerator->GetOutput() );</div><div> featureCalc->Update();</div><div> </div><div> outInertia->SetPixel(pi, featureCalc->GetFeature(Hist2FeaturesType::Inertia));</div>
<div> outCorrelation->SetPixel(pi, featureCalc->GetFeature(Hist2FeaturesType::Correlation));</div><div> outEnergy->SetPixel(pi, featureCalc->GetFeature(Hist2FeaturesType::Energy));</div>
<div> }</div><div> }</div><div> std::cout<<'.';</div><div> }</div><div>}</div></div><div><br></div><div>void main()</div><div>{</div><div><div> NeighborhoodType neighborhood;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>neighborhood.SetRadius(1);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>unsigned int centerIndex = neighborhood.GetCenterNeighborhoodIndex();</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>OffsetType offset;</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>WriterType::Pointer writer=WriterType::New();</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>char buf[64];</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>for ( unsigned int d = 0; d < centerIndex; d++ )</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>offset = neighborhood.GetOffset(d);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>InternalImageType::Pointer inertia=InternalImageType::New();</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>InternalImageType::Pointer correlation=InternalImageType::New();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>InternalImageType::Pointer energy=InternalImageType::New();</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>calcTextureFeatureImage(offset, image, inertia, correlation, energy);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>writer->SetInput(inertia);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>snprintf(buf, 100, "Inertia%u.mha", d);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>writer->SetFileName(buf);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>writer->Update();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>writer->SetInput(correlation);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>snprintf(buf, 100, "Correlation%u.mha", d);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>writer->SetFileName(buf);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>writer->Update();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>writer->SetInput(energy);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>snprintf(buf, 100, "Energy%u.mha", d);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>writer->SetFileName(buf);</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>writer->Update();</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>std::cout<<'\n';</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div>
</div><div>}</div><div><br></div><div>i found following error msg: </div><div><br></div><div><div>H:\ITK\ITK\Code\Review\Statistics\itkDenseFrequencyContainer2.h(58) : error C2039: 'InstanceIdentifier' : is not a member of 'itk::MeasurementVectorTraits'</div>
<div>2> h:\itk\itk\code\numerics\statistics\itkMeasurementVectorTraits.h(44) : see declaration of 'itk::MeasurementVectorTraits'</div><div>2>H:\ITK\ITK\Code\Review\Statistics\itkDenseFrequencyContainer2.h(58) : error C2146: syntax error : missing ';' before identifier 'InstanceIdentifier'</div>
<div>2>H:\ITK\ITK\Code\Review\Statistics\itkDenseFrequencyContainer2.h(58) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int</div><div>2>H:\ITK\ITK\Code\Review\Statistics\itkDenseFrequencyContainer2.h(58) : error C2602: 'itk::Statistics::DenseFrequencyContainer2::InstanceIdentifier' is not a member of a base class of 'itk::Statistics::DenseFrequencyContainer2'</div>
<div>2> H:\ITK\ITK\Code\Review\Statistics\itkDenseFrequencyContainer2.h(58) : see declaration of 'itk::Statistics::DenseFrequencyContainer2::InstanceIdentifier'</div><div>2> H:\ITK\ITK\Code\Review\Statistics\itkDenseFrequencyContainer2.h(42) : see declaration of 'itk::Statistics::DenseFrequencyContainer2'</div>
<div><br></div><div><br></div><div><br></div>-- <br><font face="arial, helvetica, sans-serif">-- <br>Best Regards, <br><br></font><div><b><font face="arial, helvetica, sans-serif">HUMAYUN IRSHAD</font></b></div><div><span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><div>
<span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><div style="display:inline!important"><span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><font face="arial, helvetica, sans-serif">PhD student, University of Joseph Fourier, Grenoble, France</font></span></b></span></div>
</span></b></span></div></span></b></span><span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><div style="display:inline!important"><span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><div style="display:inline!important">
<span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><font face="arial, helvetica, sans-serif">Research Engineer, </font></span></b></span></div></span></b></span></div></span></b></span><span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><div style="display:inline!important">
<span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><font face="arial, helvetica, sans-serif">IPAL – Image & Pervasive Access Lab, Singapore</font></span></b></span></div>
</span></b></span><span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><div><span style="border-collapse:collapse"><b><span style="border-collapse:separate;font-weight:normal"><font face="arial, helvetica, sans-serif">UMI CNRS (I2R/A*STAR, NUS, UJF, UPMC, IT)</font></span></b></span></div>
<div><div><div><span style="border-collapse:collapse"><font face="arial, helvetica, sans-serif"><div><span style="border-collapse:collapse"><br></span></div>Institute for Infocomm Research (I2R)<br>1 Fusionopolis Way<br>#10-19 Connexis South Tower<br>
Singapore 138632<br>Tel:+65-65162864</font></span></div></div></div><div><span style="border-collapse:collapse"><font face="arial, helvetica, sans-serif">Cell: +65-83851671</font></span></div><div><span style="font-family:arial,sans-serif;font-size:13px;border-collapse:collapse"><br>
</span></div></span></b></span></div><br>
</div>