[Insight-users] subsample of binary image

Luis Ibanez luis.ibanez at kitware.com
Tue Jun 10 09:33:55 EDT 2008



Hi Noha,


1) Could you please post a screenshot of your input and output images
    in a public web site, and maybe add an arrow pointing to the "holes"
    that you are referring to ?

    That will help us understand your observation.



2) All the implementation of the Nearest Neighbor interpolator is in
    the header file:

    Insight/Code/Common/itkNearestNeighborInterpolateImageFunction.h

    it all comes down to lines 77 and 83

   virtual OutputType EvaluateAtContinuousIndex(
     const ContinuousIndexType & index ) const
    {
     IndexType nindex;
     this->ConvertContinuousIndexToNearestIndex(index, nindex);
     return static_cast<OutputType>(
                  this->GetInputImage()->GetPixel( nindex ) );
     }



   Regards,


      Luis


-------------------
נועה ברוידא wrote:
> Hi,
> 
> I'm trying to use "itkNearestNeighborInterpolateImageFunction" to 
> perform subsampling on a binary image,
> I got an image in the right size that preserved the original structure, 
> but with many "holes".
> I thought "itkNearestNeighborInterpolateImageFunction" would be a good 
> solution where  working on binary images but I compared the results of  
> "itkNearestNeighborInterpolateImageFunction" to "LinearInterpolation" 
> filter on the same binary image and they give the same result.
> ( I used "LinearInterpolation" for subsampling of not-binary image and 
> it works well).
> 
> I couldn't find the implementation for 
> "itkNearestNeighborInterpolateImageFunction" (the txx file)
> Am I missing something?
> 
> Thank you,
> Noah.
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users


More information about the Insight-users mailing list