[Insight-users] Re: possible bug in VarianceImageFunction

Luis Ibanez luis.ibanez@kitware.com
Tue May 18 20:57:32 EDT 2004


Hi Natasha,


Thanks a lot for your suggestion regarding the
ConfidenceConnected image filter.

It was actually quite easy to implement.


Now, when you set the radius to zero:

  confConnectedfilter-> InitialNeighborhoodRadius( 0 );

only the values at the seed points are used for
computing the mean and variance needed by the filter.

You can now feed this filter with a large number of
seed points and it should behave well.

Retrospectively..., the previous crash is actually
a bug, because the filter should have verified the
radius to be at least one.  In any case, this is no
longer a problem.

In order to get these modifications you will have to
update your CVS checkout of ITK.


Please let us know if you find any problems,


    Thanks


       Luis



-------------------------
Natasha Kovacevic wrote:

> Thank you very much for our detailed answer. Yes, I think that
> calculating statistics based on multiple points with nbhd radius zero
> would be a useful addition to the ConfidenceConnectedImageFilter. I will
> try ThresholdSegmentationLevelSet in the meantime. 
>

  ....

> 
> Regards,
> Natasha
> 
> 
> 
> 
> On Thu, 2004-05-13 at 16:31, Luis Ibanez wrote:
> 
>>Hi Natasha,
>>
>>
>>Thanks for your detailed email.
>>
>>I'm afraid that the use of a zero radius is
>>not intended to  be supported in this class.
>>
>>Just to give you some historical background:
>>Originally this class was intended to be used
>>with a single seed. In that context, the statistics
>>of variance and mean must be computed from a neighborhood
>>region around the seed point. If the radius of this region
>>is = 0 then we will be computing statistics on a single
>>pixels (and probably making some division by zero).
>>
>>Later on, this class was extended to support multiple
>>seed points, and the statistics were modified in order
>>to still compute local means and variances,  and then
>>gather then in a global mean and variance.
>>
>>It is still the case that if you provide a zero radius,
>>the local statics around each seed point will produce
>>a crash.
>>
>>---
>>
>>I assume that what you want to do is to provide a lot
>>of seed points and compute statistics (mean and variance)
>>from the pixel values of these seed point and without
>>using any neighborhood regions around them.  This seems
>>to be a reasonable approach. We may be able to introduce
>>it as an option in this filter. E.g. with a boolean flag.
>>or... even better, just use this option when the radius
>>is set to zero.
>>
>>
>>--
>>
>>For your particular application I'll rather think in
>>using a LevelSet method. They are a good option if you
>>already have a rough segmentation of the object and
>>you are only looking for a refinement of that segmentation.
>>
>>
>>A possible option is to use the ThresholdSegmentationLevelSet
>>and pass your pre-segmented image as initial level set.
>>This is more computationally intensive than Confidence
>>connected but it is also less prone to producing leaks.
>>
>>
>>Please let me know if I'm missing something in your
>>description.
>>
>>
>>
>>    Thanks,
>>
>>
>>
>>      Luis
>>
>>
>>--
>>

....


>>
>>-------------------------
>>
>>Natasha Kovacevic wrote:
>>
>>
>>>Hi Luis,
>>>
>>>I have been looking at ConfidenceConnectedImageFilter and was trying to
>>>initialize it with many seeds with the idea that initial segmentation
>>>may be rough on edges and may be cleaned up based on intensities. For
>>>this reason I set confidenceConnected->SetInitialNeighborhoodRadius to
>>>0. But then it looks like initial variance estimate fails (gives nan).
>>>
>>>I am attaching the code that I have. It reads one grayscale image and a
>>>corresponding labeling image. Then all voxels that belong to given
>>>labels (here 8 and 108) are set as seeds for the ConfidenceConnected
>>>filter. Actually, I was looking for a general method for doing
>>>segmentation that is guided by an initial, registration based,
>>>segmentation which is reasonably close. The idea is to simply clean up
>>>the edges in cases where labels are expected to have reasonably gaussian
>>>intensity distribution. For example left ventricle can be prevented from
>>>leaking into other csf regions by staying close to the initial
>>>segmentation, but the edges of this initial segmentation can be cleaned
>>>up based on intensities. Would you have any suggestions for this?
>>>
>>>Many thanks, 
>>>
>>>Natasha
>>>Natasa Kovacevic, Ph.D
>>>Mouse Imaging Centre
>>>Hospital For Sick Children
>>>555 University Avenue
>>>Toronto, ON M5G 1X8
>>>Canada
>>>  
>>>tel. (416) 586-4800/6511
>>>nkovacev@sickkids.ca
>>>
>>>
>>>
>>> 
>>>
>>>
>>
>>
> 
> 






More information about the Insight-users mailing list