[Insight-users] how to change propagation speed in
segmentationlevelsetfunction class?
ning qian
ningqian37 at hotmail.com
Thu Aug 17 00:48:08 EDT 2006
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
More information about the Insight-users
mailing list