[Insight-users] Re: long time delay during implementation of
MathematicalMorphologyBinaryFilters
Gaëtan Lehmann
gaetan.lehmann at jouy.inra.fr
Tue Apr 24 06:16:00 EDT 2007
Hi,
I have just found and fixed a bug in the binary filters in ITK which
make them work a lot slower than what they should:
http://www.itk.org/cgi-bin/cvsweb.cgi/Code/BasicFilters/
itkBinaryMorphologyImageFilter.txx?
root=Insight&sortby=date&r2=1.9&r1=1.8
Try to apply this patch to your ITK source code, or try ITK cvs, and
you should see a huge difference of performance.
Gaëtan
Le 22 avr. 07 à 14:17, Gaëtan Lehmann a écrit :
>
> Hi,
>
> Just some comments and corrections:
>
> - you must build your project in release mode to get all the
> efficiency of ITK. According to your logs, your project is built in
> debug mode.
>
> - 15 is not really huge. I was frequently running some binary
> closing/opening with structuring element of radius 30x30x15 some
> months ago
>
> - the binary filters are not using the brute force algorithm.
> However, the algorithm used in very sensible to the content of the
> image, especially the number of pixels on the border of the object,
> so depending of the contente of the image, the filter of the
> consolidatedMorphology contribution may give better results. If a
> box structuring element is used the consolidatedMorphology will
> most of the time give better results.
>
> - most of the time we are doing a opening with such a big
> structuring element to remove the objects in the image to small to
> be an object of interest. This method is really inefficient when
> the objects are big, and a opening by size should be prefered. A
> (not officialy published yet) contribution would let you do that
> efficiently: http://voxel.jouy.inra.fr/darcsweb/darcsweb.cgi?
> r=binaryAttributeMorphology;a=summary . To give an example, an
> image of 512x512x70 is filtered in less than 2 second on a recent
> computer, without dependency on the size of the object to remove.
>
> Gaëtan
>
>
> Le 22 avr. 07 à 11:04, Richard Beare a écrit :
>
>> Hi,
>>
>> This is definitely a problem with the default morphology operators -
>> they use a direct implementation of max and min over a neighborhood.
>> Gaetan and I have been working on faster versions that can give
>> implementation times that are independent of SE size, depending on
>> the
>> shape of the SE. There are also versions that handle arbitary shape
>> and knock one dimension off the complexity - i.e a x by y by z SE
>> will have comlexity x by y instead of x by y by z. The former uses
>> the
>> vanHerk, Gil, Werman decomposition while the latter uses the
>> Talbot/vanDrogenBroek method.
>>
>> Anyway, a preliminary version of this was posted to insight journal
>> while the current version we use is available in Gaetan's darcs
>> repository:
>>
>> http://voxel.jouy.inra.fr/darcsweb/darcsweb.cgi
>>
>> The one you are after is consolidatedMorphology.
>>
>> ITK is missing quite a few of these efficient implementations of
>> quite
>> important filters and we are working on them. In many cases this will
>> give filters that are similar to the current gaussian smoothing
>> filters in terms of complexity because they use recursive techniques
>> and decomposition.
>>
>> On 4/22/07, Luis Ibanez <luis.ibanez at kitware.com> wrote:
>>>
>>> Hi Alireza,
>>>
>>> A an structural element of radius 15 is Hughe !!.
>>>
>>> That easily explains that your processing is taking so long.
>>>
>>>
>>> Are you sure that you need such a large structuring element ?
>>>
>>>
>>> What is the size (in pixels) of the image features that you
>>> are trying to eliminate ?
>>>
>>>
>>> What is the size (in pixels) of your image. ?
>>>
>>>
>>> Please let us know,
>>>
>>>
>>> Thanks
>>>
>>>
>>> Luis
>>>
>>>
>>> ------------------------
>>> Alireza Salamy wrote:
>>> > hi luis,
>>> > I have try to implement
>>> > MathematicalMorphologyBinaryFilters.cxx on my 3D.dicom volume
>>> image ,but
>>> > it is now around 1 hour that I have debuded it,but it hasn't
>>> finished
>>> > yet.the only change that I made to the code:1-I changed the
>>> Dimension
>>> > from 2 to 3
>>> > 2-set the radius equal to 15
>>> > and bellow is mu command line:
>>> > C:\>"C:\Documents and Settings\Alireza\Desktop\Segmentation of
>>> Tumors in
>>> > MRI\Ins
>>> > ightToolkit-3.2.0\ITKb\bin\debug
>>> \MathematicalMorphologyBinaryFilters.exe"
>>> > "C:\Do
>>> > cuments and Settings\Alireza\Desktop\Segmentation of Tumors in
>>> > MRI\InsightToolki
>>> > t-3.2.0\ITKb\bin\debug\test.dcm" "C:\Documents and
>>> > Settings\Alireza\Desktop\Segm
>>> > entation of Tumors in MRI\InsightToolkit-3.2.0\ITKb\bin\debug
>>> \ero1.dcm"
>>> > "C:\Docu
>>> > ments and Settings\Alireza\Desktop\Segmentation of Tumors in
>>> > MRI\InsightToolkit-
>>> > 3.2.0\ITKb\bin\debug\dil1.dcm" 300 1750
>>> > so what's wrong with that?
>>> > it is too important for me to check out what's wrong with
>>> that!!!!!???
>>> > Thanks for your help
>>> > Alireza
>>> >
>>> >
>>> --------------------------------------------------------------------
>>> ----
>>> > Ahhh...imagining that irresistible "new car" smell?
>>> > Check out new cars at Yahoo! Autos.
>>> > <http://us.rd.yahoo.com/evt=48245/*http://autos.yahoo.com/
>>> new_cars.html;_ylc=X3oDMTE1YW1jcXJ2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFnc
>>> wRzbGsDbmV3LWNhcnM->
>>> >
>>> _______________________________________________
>>> Insight-users mailing list
>>> Insight-users at itk.org
>>> http://www.itk.org/mailman/listinfo/insight-users
>>>
>> _______________________________________________
>> Insight-users mailing list
>> Insight-users at itk.org
>> http://www.itk.org/mailman/listinfo/insight-users
>
> --
> Gaëtan Lehmann
> Biologie du Développement et de la Reproduction
> INRA de Jouy-en-Josas (France)
> tel: +33 1 34 65 29 66 fax: 01 34 65 29 09
> http://voxel.jouy.inra.fr
>
>
>
--
Gaëtan Lehmann
Biologie du Développement et de la Reproduction
INRA de Jouy-en-Josas (France)
tel: +33 1 34 65 29 66 fax: 01 34 65 29 09
http://voxel.jouy.inra.fr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: =?ISO-8859-1?Q?Ceci_est_une_signature_=E9lectronique_PGP?=
Url : http://public.kitware.com/pipermail/insight-users/attachments/20070424/10a49005/PGP.pgp
More information about the Insight-users
mailing list