View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011481ITKITKpublic2010-11-18 23:032010-11-19 09:30
ReporterDavid Doria 
Assigned ToGabe Hart 
PrioritynormalSeverityminorReproducibilitysometimes
StatusassignedResolutionopen 
PlatformLinuxOSFedoraOS Version13
Product VersionITK-4-A3 
Target VersionFixed in Version 
Summary0011481: itkImageToHistogramFilter Strange Behavior when image has zero variance in at least one component
DescriptionIf at least one component of an image has zero variance, iterating over the histogram displays strange behavior.

How should this case be handled? Throw an error/warning that the bounds do not make sense to compute? Choose arbitrary bin end points (0 - 1, etc)?
Steps To ReproduceI have attached Test.cxx which demonstrates the problem. The CreateImage function creates a mostly black image with one red and one green pixel. There is code to create a blue pixel, but it is commented. If this blue pixel is added, then no components have zero variance and everything works as expected. Without this blue pixel, calling:

<< histogram->GetIndex(histogramIterator.GetMeasurementVector()) << " "
<< histogram->GetIndex(histogramIterator.GetInstanceIdentifier()) << " "

produces the wrong values for the index. However, calling

<< histogram->GetIndex(histogramIterator.GetInstanceIdentifier()) << " "
<< histogram->GetIndex(histogramIterator.GetMeasurementVector()) << " "

produces the correct values (note that these are the same calls, just in the opposite order).

By "wrong values", I mean the index is actually out of bounds. Here I have created a 2x2x2 histogram, and sometimes the a component of the index is 2, which is invalid. Also, the iterator doesn't seem to traverse the histogram in the correct order. This is probably due to the fact that the position is being computed using invalid bounds (in the zero variance case only).
TagsNo tags attached.
Resolution Date
Sprint
Sprint Statusbacklog
Attached Filescxx file icon Test.cxx [^] (3,677 bytes) 2010-11-18 23:03

 Relationships

  Notes
There are no notes attached to this issue.

 Issue History
Date Modified Username Field Change
2010-11-18 23:03 David Doria New Issue
2010-11-18 23:03 David Doria Status new => assigned
2010-11-18 23:03 David Doria Assigned To => Luis Ibanez
2010-11-18 23:03 David Doria File Added: Test.cxx
2010-11-19 09:30 Gabe Hart Assigned To Luis Ibanez => Gabe Hart


Copyright © 2000 - 2018 MantisBT Team