That’s a good question, Brad.  When I wrote this filter, I started with the
LabelStatisticsImageFilter since it was, in my mind, closest to what I 
wanted to write.  That override is simply leftover from what I copied
originally: 

https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/ImageStatistics/include/itkLabelStatisticsImageFilter.hxx#L43

It certainly is not a result of me trying to do something sophisticated.  I
didn’t know any better so I just left it in.  The same could probably be 
said for anything questionable that you might find in this class.

Nick



On Mar 8, 2014, at 3:55 PM, Bradley Lowekamp <[email protected]> wrote:

> Nick,
> 
> I am trying to add LabelOverlapImageFilter to SimpleITK. It's failing one of 
> my test in SimpleITK. At this is the section:
> 
>  itk::simple::Image smallImage( 1,1,1,itk::simple::sitkUInt8 );
>  itk::simple::Image largeImage( 10,10,10,itk::simple::sitkUInt8 );
>  itk::simple::Image smallShortImage( 1,1,1,itk::simple::sitkUInt16 );
>  try
>    {
>    // Try executing with different size images.
>    // This will either work or throw an exception, either is OK. So
>    // this is here just to make sure that the behavior does not cause
>    // undefined behavior such as segfault, or other errouneos behavior.
>    filter.Execute ( largeImage, smallImage );
>    } catch (... )
>    { }
> 
> http://open.cdash.org/testDetails.php?test=240179118&build=3246420
> 
> This is causing a miss-matched region assert to fail in the iterator:
> https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Core/Common/include/itkImageConstIterator.h#L208
> 
> During the construction of the iterator here:
> https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/ImageStatistics/include/itkLabelOverlapMeasuresImageFilter.hxx#L142
> 
> There is also a non-standard GenerateInputRequestedRegion:
> https://github.com/InsightSoftwareConsortium/ITK/blob/master/Modules/Filtering/ImageStatistics/include/itkLabelOverlapMeasuresImageFilter.hxx#L39
> 
> The normal implementation of this method requests all inputs to have the same 
> ImageRegion. This normally then triggers exceptions with the requested region 
> not able to be generated from the pipeline.
> 
> I don't immediately see the reason why the GenerateInputRequestedRegion was 
> overridden, the default should work ok. Do you know why?
> 
> Thanks,
> Brad

_______________________________________________
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.php

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

Reply via email to