[Insight-users] how to change propagation speed in segmentationlevelsetfunction class?

Luis Ibanez luis.ibanez at kitware.com
Sun Aug 20 18:35:28 EDT 2006



Hi Ning,


It is not surprising that your code changes didn't have any effect
in the results of the segmentation.


Your line for looking at the pixels of the new m_PropImage is only
used if the pixel in question is *outside* of the current speed image.


Since very often the speed image has the same support as the feature
image, then it is very unlikely that your m_PropImage will ever be
actually queried for pixel values.


What you probably want to do is to connect your m_PropImage to the
interpolator that now is connected to the Speed image, and then
remove the "else" that you added to the if( IsInsideBuffer).
In this way, your m_PropImage will replace the m_Speed image.


The replacement of the input to the interpolator should be made
in lines 29 and 63.


    Regards,



       Luis




-----------------
ning qian wrote:
> 
> Hi, all, I just started hacking in itk. I am trying to change the 
> propagation speed in segmentation levelset. I derived my class from 
> segmentationlevelsetfunction and defined my PropagationSpeed() function 
> as follows:
> 
> PropagationSpeed(const NeighborhoodType &neighborhood,
>                   const FloatOffsetType &offset, GlobalDataStruct *) const
> {
>  IndexType idx = neighborhood.GetIndex();
>  ContinuousIndexType cdx;
>  for (unsigned i = 0; i < ImageDimension; ++i)
>    {
>    cdx[i] = static_cast<double>(idx[i]) - offset[i];
>    }
>  if ( m_Interpolator->IsInsideBuffer(cdx) )
>    {
>    return (static_cast<ScalarValueType>(
>              m_Interpolator->EvaluateAtContinuousIndex(cdx)));
>    }
>  else return ( static_cast<ScalarValueType>(m_PropImage->GetPixel(idx)) );
> }
> 
> 
> where m_PropImage is a new member I defined for the propagation speed. 
> But when I ran the simulation using examples, it seems that the results 
> did not change at all as using originally defined m_SpeedImage. Besides 
> this change, do I need to make any other modifications?
> 
> Thanks a lot for your help.
> 
> Best, Ning
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 
> 




More information about the Insight-users mailing list