[Insight-developers] ImageToHistogramFilter issue
kent williams
norman-k-williams at uiowa.edu
Mon Nov 22 10:49:48 EST 2010
Not directly related, but something in the general vicinity of this bug:
http://public.kitware.com/Bug/view.php?id=11443
Which I logged when I found that itkSampleToHistogramFilterTest7. There¹s a
problem with overflow for unsigned types if you set the range to
NumericTraits<TIntType>::min() to NumericTraits<TIntType>::max(). Part if
the problem is that if TIntType is a signed integer type, then
NumericTraits<TIntType>::max() - NumericTraits<TIntType>::min() >
NumericTraits<TIntType>::max()
Another problem that I ran into in the ColorTable class --
int x = NumericTraits<int>::max(); // will not overflow
double intMaxAsDouble(static_cast<double>(x));
// the following will overflow, at least on OS X with GCC 4.2.1
int x = static_cast<int>(intMaxAsDouble);
On 11/20/10 6:35 PM, "Luis Ibanez" <luis.ibanez at kitware.com> wrote:
> For the record:
>
> We reviewed this with David on Thursday,
>
> and it seems to be a bug in the automatic
> computation of minimum and maximum
> values for the bins.
>
> David logged a bug entry for this issue:
>
> http://public.kitware.com/Bug/view.php?id=11480
>
>
> Luis
>
>
> --------------------------------
> On Wed, Nov 17, 2010 at 4:51 AM, Iván Macía <imacia at vicomtech.org> wrote:
>> Hi David,
>>
>> For our applications we have been using itk::ScalarImageToHistogramGenerator
>> with the new Statistics framework, since we suffered the overflow issue with
>> the previous version. The corresponding multi-component version seems to be
>> itk::ImageToHistogramGenerator.
>>
>> Having a look at the documentation of ITK 3.20 I don't clearly see what is
>> the difference between itk::ImageToHistogramGenerator and
>> itk::ImageToHistogramFilter. Furthermore, the API for the later seems to be
>> a bit obscure (SetInput1()? SetInput3()? SetInput5()?). In general there is
>> a lack of documentation of these filters.
>>
>> It seems like itk::ImageToHistogramGenerator is not part of ITK 4.0, is this
>> true? I have been very busy lately and need to put up with all the ITK v4.0
>> and git stuff but need some time since it seems to be hard :S
>>
>> Best regards
>>
>> Ivan
>>
>>
>>
>> -----Mensaje original-----
>> De: insight-developers-bounces at itk.org
>> [mailto:insight-developers-bounces at itk.org] En nombre de David Doria
>> Enviado el: martes, 16 de noviembre de 2010 23:21
>> Para: Insight Developers
>> Asunto: [Insight-developers] ImageToHistogramFilter issue
>>
>> Hi all,
>>
>> I am trying to use the ImageToHistogramFilter. I see some unexpected
>> things when I create an iterator to traverse the histogram. First, it
>> seems to only traverse the first component. That is, I see indices of
>>
>> 0, 0, 0
>> 1, 0, 0
>> 2, 0, 0
>> ...
>> 0, 0, 0 (this repeats exactly from the beginning, rather than
>> incrementing the 2nd or 3rd component)
>> 1, 0, 0
>> ....
>>
>> The histogram cell centers (the iterator's .GetMeasurementVector())
>> also seem to follow the pattern of the index in that the second two
>> components don't move from zero.
>>
>> Also, my query for "how many red pixels are there?" returns 0, when I
>> would expect 2 (there are two red pixels in the example input image).
>>
>> Here is my demonstration of the problem:
>> http://www.vtk.org/Wiki/ITK/Examples/Broken/Statistics/ImageToHistogramFilte
>> r
>>
>> Any thoughts? Has anyone successfully created a 3D histogram from an
>> image after the Statistics overhaul?
>>
>> Thanks,
>>
>> David
>> _______________________________________________
>> Powered by www.kitware.com <http://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
>>
>> _______________________________________________
>> Powered by www.kitware.com <http://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
>
>
>
> _______________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20101122/d621e72a/attachment.htm>
More information about the Insight-developers
mailing list