[Insight-developers] Bug in itkShrinkImageFilter

Bradley Lowekamp blowekamp at mail.nih.gov
Wed Dec 10 10:36:47 EST 2008


Hello,

	Another thing to consider is the bug I recent found: http://public.kitware.com/Bug/view.php?id=8245 
  I believe the EnlargeOutputRequestedRegion method implemented in  
ShrinkImageFilter is wrong, not needed and prevents this filter from  
streaming. I have not had a chance to write a couple of tests though.

	I have been needing a box filter shrinking image filter. I am  
planning on writing it shortly. The one thing I have pondered is if  
there is a good way to use different types of kernels when doing the  
resampling. I am not sure how this relates to how Hans is using the  
original filter, but may be useful.

	The proposed patched does two thing. First it changes the filter to  
use a linear interpolator. I agree that this should not be added.  
Second it improves the calculation of the origin so that the center of  
the image remains the same. I think that this makes sense and should  
seriously be considered. For Hans' calculations it would give improved  
accuracy on the center of the image. I am wondering if for multi-scale  
registration methods if it would give additional accuracy too...

  Brad



========================================================
Bradley Lowekamp
Lockheed Martin Contractor for
Office of High Performance Computing and Communications
National Library of Medicine
blowekamp at mail.nih.gov


On Dec 10, 2008, at 5:21 AM, Bill Lorensen wrote:

> Hans,
>
> Another issue if you make your changes. If the new Shrink is run on a
> labeled image, I believe your code will interpolate the new pixels.
> This behavior is not desirable for subsampling a labeled image.
>
> Perhaps we should leave this filter alone and change the
> multiresolution pyramid code to use ResampleImageFilter with the
> proper values set to do subsampling.
>
> Bill
>
> On Wed, Dec 10, 2008 at 12:05 AM, Bill Lorensen <bill.lorensen at gmail.com 
> > wrote:
>> Hans,
>>
>> The documentation for ShrinkImageFilter says that it does simple
>> subsampling. So it is not really a bug according to the  
>> documentation.
>> However, I think your implementation is more useful (I assume it is
>> correctly done). You should probably fix the documentation in the .h
>> file when you commit these changes.
>>
>> Also, beware that we have enabled a KWStyle commit check for some
>> directories. These directories are Testing/Code/Review, Code/Review,
>> Code/IO and Code/BasicFilters. All of these directories are currently
>> clear of any style defects.
>>
>> Bill
>>
>> On Tue, Dec 9, 2008 at 11:55 PM, Bill Lorensen <bill.lorensen at gmail.com 
>> > wrote:
>>> Hans,
>>>
>>> Two of the tests are seg faulting.
>>>
>>> Bill
>>>
>>> On Tue, Dec 9, 2008 at 11:38 PM, Hans Johnson <hans-johnson at uiowa.edu 
>>> > wrote:
>>>> Luis and Bill,
>>>>
>>>> I think I've uncovered a bug in the itkShrinkImageFilter that has
>>>> ramifications in any use of the  
>>>> itkMultiResolutionPyramidImageFilterTest.
>>>>
>>>> I was writing a program that aligns the mid-sagital plane with  
>>>> the center of
>>>> an image, and found that as I went from low-resolution estimates to
>>>> high-resolution estimates, the center of mass of the object in  
>>>> the different
>>>> scale images would change.
>>>>
>>>> A new test (currently failing) has been added, and the patch that  
>>>> makes that
>>>> test pass has been included in the Bug report:
>>>> http://public.kitware.com/Bug/view.php?id=8275
>>>>
>>>> This change, however, will cause any of the tests that depend on  
>>>> the
>>>> MultiResolutionPyramidImage (and prehaps others) to start  
>>>> failing.  I'd like
>>>> your advice on how to get this bug fix resolved in the least  
>>>> obtrusive way.
>>>>
>>>> Thanks,
>>>> Hans
>>>>
>>>>
>>>
>>
> _______________________________________________
> Insight-developers mailing list
> Insight-developers at itk.org
> 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/20081210/a6859d6c/attachment.htm>


More information about the Insight-developers mailing list