[Insight-developers] GrayscaleReconstructionByDilatationImageFilter contribution and some related questions

Gaetan Lehmann gaetan.lehmann at jouy.inra.fr
Wed Jun 8 11:22:15 EDT 2005


Hi,

I have implemented a more efficient algorithm for reconstruction by  
dilatation. To give an idea of improvement, the same reconstruction on one  
of my 3D image runs in 47 min with GrayscaleGeodesicDilateImageFilter  
iterated to stability, and in 23 sec with this filter.

Code is attached. I hope you'll agree to add it in ITK :-)

Implementation of this algorithm leads to some questions :

+ Is GrayscaleReconstructionByDilatationImageFilter a good name ? I find  
it very large...

+ should I test precondition (mask >= marker) or should I let user take  
care of that ?

+ to activate neighbors for the fully connected case, I'm using this code  
(oIt is a ShapedNeighborhoodIterator object) :
     for (d=0; d < oIt.GetCenterNeighborhoodIndex()*2+1; ++d)
       {
         oIt.ActivateOffset(oIt.GetOffset(d));
	}
     offset.Fill(0);
     oIt.DeactivateOffset(offset);
oIt.Size() method is protected, so to get the neighborhood size, I used  
oIt.GetCenterNeighborhoodIndex()*2+1, but I don't find it really clean !
Is there a cleaner way to do that ? A oIt.ActivateAllNeighbors() method  
would be great :-)

+ with this algorithm, we don't need to have boundary condition. I don't  
find how to skip neighbors out of image, so I use a boundary condition  
with which I'm sure to never try to set pixel out of image, but I don't  
find this really clean. Is there a way to skip out of image neighbors  
during iteration ?

+ This algorithm is completed in 2 steps. First step is an iteration over  
each pixel of image; second step is an iteration over a number of pixels  
known a the end of the first step (and smaller than the number of pixel).  
I tried to use 2 progress reporter, but it doesn't work as I want... how  
can progress be managed in this case ?

+ this algorithm is far much efficient than geodesic dilatation iterated  
until stability, but is non threadable, and can't use face optimization.  
Should it replace GrayscaleGeodesicDilateImageFilter iterated to stability  
in already existing filters which use it (HMaximaImageFilter,  
GrayscaleGrindPeakImageFilter, DoubleThresholdImageFilter and  
GrayscaleConnectedOpeningImageFilter) ? If yes, should we add  
FullyConnected attribute to all theses filters ?

+ Should FullyConnected attribute be added to  
GrayscaleGeodesicDilateImageFilter ?

+ I surely have done lots of english mistakes, even if I have only written  
a few words :-(
Can someone read and correct comments ?

This algorithm can be easily applied to  
ReconstructionByErosionImageFilter. I'll be pleased to make it, once  
ReconstructionByDilatationImageFilter will be totally clean :-)

Regards,

Gaetan

-- 
Gaetan Lehmann <gaetan.lehmann at jouy.inra.fr>
Tel: +33 1 34 65 29 66
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
Web: http://voxel.jouy.inra.fr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: itkGrayscaleReconstructionByDilatationImageFilter.h
Type: application/octet-stream
Size: 6475 bytes
Desc: not available
Url : http://www.itk.org/mailman/private/insight-developers/attachments/20050608/088ed296/itkGrayscaleReconstructionByDilatationImageFilter-0002.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: itkGrayscaleReconstructionByDilatationImageFilter.txx
Type: application/octet-stream
Size: 10897 bytes
Desc: not available
Url : http://www.itk.org/mailman/private/insight-developers/attachments/20050608/088ed296/itkGrayscaleReconstructionByDilatationImageFilter-0003.obj


More information about the Insight-developers mailing list