[Insight-developers] GrayscaleReconstructionByDilatationImageFilter contributionand some related questions

Miller, James V (Research) millerjv at crd.ge.com
Wed Jun 8 13:02:27 EDT 2005


Gaeten, 

Thanks for the filter.  I will take a look at it. With the timings you are 
reporting, perhaps we do not need the original (threaded) implementation.

It would be great to have an erosion version as well.  I'll probably ask 
you do that one after we smooth out any issues we have with the dilate 
case.

Thanks again.

Jim



-----Original Message-----
From: insight-developers-bounces+millerjv=crd.ge.com at itk.org
[mailto:insight-developers-bounces+millerjv=crd.ge.com at itk.org]On Behalf
Of Gaetan Lehmann
Sent: Wednesday, June 08, 2005 11:22 AM
To: insight-developers at itk.org
Subject: [Insight-developers]
GrayscaleReconstructionByDilatationImageFilter contributionand some
related questions



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


More information about the Insight-developers mailing list