[Insight-developers] blox pipelining

Luis Ibanez luis.ibanez@kitware.com
Wed, 27 Mar 2002 09:38:24 -0500


Damion,

The problem is a combination of two elements.

1) There was a  "PixelType & Value(void)"  method
    in the ImageConstIterator that is redundant
    because the  "const PixelType & Value(void) const "
    is already there and is enough for covering all
    the functionality of the ImageConstIterator.
    I'm removing this redundant method.

2) In your code, every pixel is an std container.
    you are creating a STD iterator to walk through
    the componenet of this container.  This "iterator"
    should be "const_iterator" because you are walking
    through a container whose elements are not supposed
    to change.


I'm making an experimental build here with these changes,
before checking the modifications in.  So it will take about
an hour before this is updated in the cvs repository.
Maybe in the meantime you may want to do the changes in
your local checkout.


     Thanks

        Luis		


PS,  A short unrelated comment:

ImageIterators in your code are being created like:

  ImageIterator it  =  ImageIterator( imgPtr, region );

That works just fine but you are doing two unnecessary
copy constructions in the process. If you want, you can
just write:

          ImageIterator  it( imgPtr, region );

----------------------------------------------------------

Damion Shelton wrote:
> Hi,
> 
> As was suggested at the Feb. meeting, I've been working on pipelining 
> the blox classes. This has been mostly completed: filters to convert 
> gradient images to blox boundary point images, and blox boundary point 
> images to core atoms images are now checked in. The former works 
> perfectly, the latter has some issues with const image iterators.
> 
> Specifically, in itkBloxBoundaryPointToCoreAtomImageFilter I've had to 
> comment out the functions FindCoreAtoms() and 
> FindCoreAtomsAtBoundaryPoint() in order to avoid compilation errors.
> 
> The problems appear to arise with the lines:
> 
>  typedef ImageRegionConstIterator<TInputImage> TImageIteratorType;
> 
>  TImageIteratorType imageIt = TImageIteratorType(m_InputPtr,
> 
> m_InputPtr->GetRequestedRegion() );
> 
> Oddly enough, nearly identical code in 
> itkGradientImageToBloxBoundaryPointImageFilter works fine. The intent is 
> to create a const iterator over the input image, and I'm not quite sure 
> why it's not compiling.
> 
> Perhaps someone with more const iterator experience can uncomment the 
> functions and suggest what might be going wrong?
> 
> Incidentally, this should not break the dashboard - I've tested a local 
> build and it works fine (with the affected code commented out).
> 
> Thanks,
> 
> -Damion-
> _______________________________________________
> Insight-developers mailing list
> Insight-developers@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-developers
>