View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010025ITKpublic2009-12-10 14:482009-12-16 08:21
ReporterGreg Harris 
Assigned ToHans Johnson 
PrioritynormalSeveritycrashReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionITK-3-16 
Target VersionFixed in Version 
Summary0010025: Review/Statistics/itkScalarImageToHistogramGenerator.txx SetHistogramMin and SetHistogramMax allocate MeasurementVectorType
DescriptionReview/Statistics/itkScalarImageToHistogramGenerator.txx contains methods for SetHistogramMin and SetHistogramMax that allocate minVector and maxVector with size defaulted to zero instead of like this:

MeasurementVectorType minVector(1);

The result of executing it this way:

MeasurementVectorType minVector;

is a memory fault crash.
Additional Informationcvs diff itkScalarImageToHistogramGenerator.txx
Index: itkScalarImageToHistogramGenerator.txx
===================================================================
RCS file: /cvsroot/Insight/Insight/Code/Review/Statistics/itkScalarImageToHistogramGenerator.txx,v
retrieving revision 1.4
diff -r1.4 itkScalarImageToHistogramGenerator.txx
79c79
< MeasurementVectorType minVector;
---
> MeasurementVectorType minVector(1);
91c91
< MeasurementVectorType maxVector;
---
> MeasurementVectorType maxVector(1);
TagsNo tags attached.
Resolution Date
Sprint
Sprint Status
Attached Files

 Relationships

  Notes
(0018807)
Bradley Lowekamp (developer)
2009-12-10 19:42

What PixelType was used for the ImageType provided for the ScalarImageToHistogramGenerator?

This may effect what the MeasurementVectorType is,
(0018812)
Hans Johnson (developer)
2009-12-11 08:04

Since the name of the class is ScalarImageToHistogramGenerator, I assume that MeasurementVectorType must contain just one element.

A new test was written for nightly regression testing.

Recommended fix was implemented.
(0018820)
Bradley Lowekamp (developer)
2009-12-11 12:04

Because MeasurementVectors can be a variety of types, which each have different constructors MeasurementVectorTraits have a methods called SetLength. I believe this the the generic and best way to set the correct length of a measurement vector.
(0018912)
Hans Johnson (developer)
2009-12-16 08:21

This has been fixed and submitted. Thanks to Brad and Luis for suggestions.

 Issue History
Date Modified Username Field Change
2009-12-10 14:48 Greg Harris New Issue
2009-12-10 19:42 Bradley Lowekamp Note Added: 0018807
2009-12-11 08:01 Hans Johnson Status new => assigned
2009-12-11 08:01 Hans Johnson Assigned To => Hans Johnson
2009-12-11 08:04 Hans Johnson Note Added: 0018812
2009-12-11 12:04 Bradley Lowekamp Note Added: 0018820
2009-12-16 08:21 Hans Johnson Note Added: 0018912
2009-12-16 08:21 Hans Johnson Status assigned => resolved
2009-12-16 08:21 Hans Johnson Resolution open => fixed
2009-12-16 08:21 Hans Johnson Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team