[Insight-users] Regarding Fast Marching

Dawood Al Masslawi masslawi at gmail.com
Wed Jun 22 11:29:05 EDT 2011


Dear Amit,

Note that the value of the speed image close to edges approaches 0 and
increases/decreases

in the rest of the image (see figure 9.14 in page 532 of the software
guide). Having that in

mind, variable K1 refers to the minimum of the image intensity along the
tissue contours

to be segmented (where speed value is 0) and variable K2 refers to the
average intensity

value in the rest of the image (preferably inside the object to be
segmented).

The goal of the Sigmoid filter is to generate a speed image similar to what
is illustrated in

figure 9.14.

To get a better idea of how this works it might be helpful to read a chapter
from an image

processing/computer vision textbook on this subject.

Also try changing the parameters and observe the change in the resulting
images in the

pipeline (write the images after execution of each filter).

Best regards,

Dawood


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<



On Wed, Jun 22, 2011 at 10:53 AM, amit satish <amitsatish.unde at teamta.in>wrote:

> **
> On 6/21/2011 4:04 PM, Dawood Al Masslawi wrote:
>
> What do you mean by "failed"?!!
>
>  Did you get errors or just didn't get the results you desired?
>
>  Parameter tuning is of course time consuming and an error-prone process
> but it can be done easier
>
>  if you would have prior knowledge about the components (pipeline) of the
> segmentation method.
>
>  To get more information about the available segmentation methods in ITK
> it's very helpful to read
>
>  the ITK software guide, specially the "Segmentation" chapter (chapter
> 9).
>
>  You also could do a little search on the mailing list  and see previous
> discussions about the segmentation
>
>  method you want to use, level-set methods certainly has been discussed
> frequently!
>
>  Following are some of my posts on this subject,
>
>
>  ------------------------------------------------------
>
>  "GeodesicActiveContours processing time and SignedDanielssonDistanceMap"
>
> You don't need to use the fastMarching filter if you are using the DanielssonDistanceMap
> and vice versa.
> If you want to lower the computation time you can decrease the number of iterations or
> assign lower values for the maximum allowed RMS.
> The initialDistance parameter is the distance between the seed points and the desired
> initial contour.
>
> Note that the assigned Alpha and Beta values for the sigmoid filter can have a significant
>
> effect on the results. It is best to choose the Beta close to the initial contour value and
> assign the Alpha in which an acceptable range of values around the Beta would be
> mapped.
>
> "on tuning Laplacian Level Set Segmentation
> (LaplacianSegmentationLevelSetImageFilter.cxx)"
>
> For better convergence it is best to have a good initial estimation
> of the level set as a seed image. Larger number of iterations alone
> does not guarantee the convergence.
> Basically using the diffusion filter improves the quality of the
> segmentation, however over-diffusing the images can cause loss of
> details.
> You can use the resulting image (SpeedImage.mha) to determine that
> to what extent you want to diffuse the input image. Increasing the
> number of diffusion iterations and higher values for the conductance
> will give a more diffused image.
> Propagation weight determines the relative amount emphasis on
> the propagation speed and with higher values results in narrower
> surfaces, opposing to the curvature weight (curvature scaling) which
> with higher values gains smoother surfaces.
> The isovalue I think is best to be assigned as halfway between the
> maximum and minimum values in the seed image.
> Also, Premature elimination might be the result of the low maximum
> allowed RMS.
> As for number of iterations for both diffusion and segmentation after
> couple of tries and assigning different values you should be able to
> find the best fit for your application.
>
> "handle watershed oversegmentation"
>
> The level of details in watershed segmentation is controlled by a
> smoothing step. It is most likely that the parameter setting
> for the smoothing step in your application is causing an under-smoothing
> effect. Usually for smoothing prior to the watershed segmentation an
> anisotropic diffusion filter is used. The level of smoothing in anisotropic
> diffusion filter is controlled by three parameters, number of iterations,
> time step and conductivity. Increasing the number of iterations and the
> conductivity factor can smooth more edges.
> However, depending on your images better results might be achievable
> using a different smoothing method.
>
> ------------------------------------------
>
> There are sure more discussions on the mailing list, I just included some I wrote
>
> in previous discussions.
>
> One little thing to add, the time step for the diffusion filter should be less than
>
> 1/(2^N), N being image dimensions. Usually something around 0.125 works fine (for 2D images).
>
> Also note that the described segmentation methods in the ITK software guide are just
>
> examples and you can replace any of the used components with other filters better suited
>
> to your application.
>
> By the "middle bright region" do you mean the cerebral hemisphere, White Matter or the white
>
> region (tumor?!!) in the middle of the right lobe?
>
> Dawood
>
>
>  >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>
>
> On Tue, Jun 21, 2011 at 10:18 AM, amit satish <amitsatish.unde at teamta.in>wrote:
>
>>  On 6/18/2011 5:40 PM, Dawood Al Masslawi wrote:
>>
>> Hi Amit,
>>
>>  In addition to what Kevin said, select the Alpha and Beta values such
>> that the regions you want to
>>
>>  segment would be emphasized in the resulting image, for an instance,
>> make the bright regions brighter
>>
>>  if you want to segment the bright regions.
>>
>>  Choose the value for Sigma based on how much detail you want to include
>> in the segmented image,
>>
>>  lower values will result in more details and higher values will smooth
>> more details hence resulting in less
>>
>>  details in the segmented image.
>>
>>  Assigning the seed points and the threshold by users (radiologists in
>> your case) can be done using Graphical User Interface
>>
>>  tools such as FLTK or Qt and VTK, but it's probably better to get your
>> application up and running before developing a GUI.
>>
>>  Hope that helps,
>>
>>  Dawood
>>
>>
>>
>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>>
>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>>
>>
>>  On 06/17/2011 01:39 AM, amitsatish.unde at teamta.in <http://www.itk.org/mailman/listinfo/insight-users> wrote:
>> >* I am using ItK fast marching for liver tumor segmentation. I want to select manually seed point and output is segmented tumor. My problems is as below,*>* 1.can you specify exact value of alpha,beta and sigma for all examples?*>* 2.it's very difficult to give threshold value everytime. I am trying to implement a method such that radiologists will choose seed point in tumor region and our algorithm will give exact boundary of tumor. All other parameters i want to set by me.*>**>**>* Regards,*>* Amit*
>> The parameters used in the software guide for the fast marching
>> example are listed at the top of the source code :
>>
>> //  Software Guide : BeginCommandLineArgs
>> //    INPUTS: {BrainProtonDensitySlice.png}
>> //    OUTPUTS: {FastMarchingImageFilterOutput5.png}
>> //    81 114 1.0  -0.5  3.0   100 100
>> //  Software Guide : EndCommandLineArgs
>> //  Software Guide : BeginCommandLineArgs
>> //    INPUTS: {BrainProtonDensitySlice.png}
>> //    OUTPUTS: {FastMarchingImageFilterOutput6.png}
>> //    99 114 1.0  -0.5  3.0   100 100
>> //  Software Guide : EndCommandLineArgs
>> //  Software Guide : BeginCommandLineArgs
>> //    INPUTS: {BrainProtonDensitySlice.png}
>> //    OUTPUTS: {FastMarchingImageFilterOutput7.png}
>> //    56 92 1.0  -0.3  2.0   200 100
>> //  Software Guide : EndCommandLineArgs
>> //  Software Guide : BeginCommandLineArgs
>> //    INPUTS: {BrainProtonDensitySlice.png}
>> //    OUTPUTS: {FastMarchingImageFilterOutput8.png}
>> //    OUTPUTS: [FastMarchingFilterOutput1.png]
>> //    OUTPUTS: [FastMarchingFilterOutput2.png]
>> //    OUTPUTS: [FastMarchingFilterOutput3.png]
>> //    40 90 0.5  -0.3  2.0   200 100
>> //  Software Guide : EndCommandLineArgs
>>
>> Unfortunately, the parameters are there for a reason, one value
>> does not always work well for all images.
>>
>> My advice to you is to take the example programs and to cut them
>> up into the smallest usable pieces so that you can actually look
>> at the images at each step. For the fast marching example you'd
>> end up with 5 tiny programs :
>>
>> reader -> smoother           -> writer
>> reader -> gradient magnitude -> writer
>> reader -> sigmoid            -> writer
>> reader -> fast marching      -> writer
>> reader -> threshold          -> writer
>>
>> Take a typical example of your images and open it up in ParaView
>> (or your viewer of choice).
>>
>> You'll probably find that the intensity profile through the
>> object you're interested in is bumpy :
>>                                                  oo
>>                               oooooo   oo    oo
>>         o          oo                  oo           o         o
>> oooo ooo oo    ooo                             ooooo oooo
>>
>> adjust the parameters of the smoothing filter until the profile
>> looks as much like this as possible:
>>
>>                                 ooooooooooooo
>>                               o                          o
>> ooooooooooooooo                              ooooooooo
>>
>>
>> adjust the parameters of the gradient magnitude filter until it
>> looks like this :
>>                               o                            o
>>                             o  o                        o  o
>> oooooooooooooo      ooooooooooo      oooooooo
>>
>>
>> sigmoid :
>>
>> ooooooooooooooo oooooooooooooo oooooooooo
>>
>>                               o                            o
>>
>> fast :
>>
>>                               o                            o
>>                                  o                       o
>>                                    o                   o
>>                                      o               o
>>                                         o          o
>>                                            o     o
>>                                               oo
>>
>> the point is LOOK at the intermediate images.
>>
>>
>>  I am now totally confusing. I am not understanding which is good methods
>> for segmentation because decision of various parameter is critical.
>> I tried for threshold level set segmentation, geodesic active contour for
>> tumor boundary detection but i failed every time. Please explain briefly how
>> to choose exact parameter for above methods.
>> I have attached image in which i want to segment middle bright region.
>>
>
>
>  Dear Sir,
>                from itk guide pdf i got some information about how to
> choose exact alpha and beta value but it is not clearly understanding. It is
> as follow,
>
> The Sigmoid Image Filter class requires two parameters to define the linear
> transformation to
> be applied to the sigmoid argument. These parameters are passed using the
> Set Alpha() and
> Set Beta() methods. In the context of this example, the parameters are used
> to intensify the
> differences between regions of low and high values in the speed image. In
> an ideal case, the
> speed value should be 1.0 in the homogeneous regions of anatomical
> structures and the value
> should decay rapidly to 0.0 around the edges of structures. The heuristic
> for finding the values
> is the following. From the gradient magnitude image, let's call K1 the
> minimum value along
> the contour of the anatomical structure to be segmented. Then, let's call
> K2 an average value of
> the gradient magnitude in the middle of the structure. These two values
> indicate the dynamic
> range that we want to map to the interval [0 : 1] in the speed image. We
> want the sigmoid to map
> K1 to 0.0 and K2 to 1.0. Given that K1 is expected to be higher than K2 and
> we want to map
> those values to 0.0 and 1.0 respectively, we want to select a negative
> value for alpha so that the
> sigmoid function will also do an inverse intensity mapping. This mapping
> will produce a speed
> image such that the level set will march rapidly on the homogeneous region
> and will definitely
> stop on the contour. The suggested value for beta is (K1+K2)/2 while the
> suggested value for
> alpha is (K2-K1)/6, which must be a negative number. In our simple example
> the values are
> provided by the user from the command line arguments. The user can estimate
> these values by
> observing the gradient magnitude image.
>
> Again my doubt is how to find value of k1 and k2 from gradient image?
> actually i have not understood the meaning of k1 and k2 value. Please
> explain me.
>
>
> Regards,
> Amit.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110622/511f87e0/attachment-0001.htm>


More information about the Insight-users mailing list