[Insight-developers] texture features question

Luis Ibanez luis.ibanez at kitware.com
Mon May 16 21:56:57 EDT 2011


Yeap, it looks like a bug.

The implementation of Histogram will misuse the value
of max()+1:


itkHistogram.txx : lines 237-249:


Histogram< TMeasurement, TFrequencyContainer >
::Initialize(const SizeType & size, MeasurementVectorType & lowerBound,
             MeasurementVectorType & upperBound)
{
  this->Initialize(size);

  float interval;
  for ( unsigned int i = 0; i < this->GetMeasurementVectorSize(); i++ )
    {
    if ( size[i] > 0 )
      {
      interval = static_cast<float>( upperBound[i] - lowerBound[i] )
        / static_cast< MeasurementType >( size[i] );

---


     Luis

----------------------------
On Mon, May 16, 2011 at 9:50 PM, Nicholas Tustison <ntustison at gmail.com> wrote:
> Thanks Luis.  If you go to lines 168-169, the lower and upper bounds
> are used to initialize the joint histogram.
>
>  size.Fill(m_NumberOfBinsPerAxis);
>  output->Initialize(size, m_LowerBound, m_UpperBound);
>
> Was that what you were asking about?
>
> The problem is that if everything is the same except the intensity range of one
> image is scaled between [0,256] and its counterpart is scaled between [0,1],
> creating a histogram which spans between [0, 257] on each axis is going to be
> quite different from one that spans between [0,2].
>
>
>
>
> On May 16, 2011, at 9:43 PM, Luis Ibanez wrote:
>
>> Hi Nick,
>>
>> Yeap, that looks like a bug.
>>
>> Although, to make sense of it,
>> we have to dive into how the
>> bounds are used in the histogram
>> computation...
>>
>>
>>     Luis
>>
>>
>> --------------------------------------------------
>> On Mon, May 16, 2011 at 9:19 PM, Nicholas Tustison <ntustison at gmail.com> wrote:
>>> Hi,
>>>
>>> I've been working with the cooccurrence matrix texture features classes and noticed that
>>> if I simply rescale the values, the texture measures are completely different.  I tracked it
>>> down to lines 384 and 385 of itkScalarImageToCooccurrenceMatrixFilter.txx which the
>>> user uses to set the min and max values of the joint histogram:
>>>
>>>  m_LowerBound.Fill(min);
>>>  m_UpperBound.Fill(max + 1);
>>>
>>> It would seem that line 385 should, instead, be
>>>
>>>  m_UpperBound.Fill(max);
>>>
>>> Does that make sense or am I missing something?
>>>
>>> Thanks,
>>> Nick
>>>
>>>
>>>
>>> _______________________________________________
>>> 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://kitware.com/products/protraining.html
>>>
>>> Please keep messages on-topic and check the ITK FAQ at:
>>> http://www.itk.org/Wiki/ITK_FAQ
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://www.itk.org/mailman/listinfo/insight-developers
>>>
>
>


More information about the Insight-developers mailing list