[Insight-developers] proposed addition to itkImage: get indexed pixel Voronoi region

Torsten Rohlfing torsten at synapse.sri.com
Wed Aug 3 13:27:32 EDT 2005


Hi Luis and everyone:

I was wondering what the general sentiment is about adding a member 
function to itkImage to compute a pixel's Voronoi region? This function 
might look something like this:

  /** Get the Voronoi region of a pixel in physical space (in the space which

   * the origin and spacing infomation comes from) from a discrete index (in the index space)

   */

  template<class TCoordRep>

  void GetPixelVoronoiCellFromIndex(

    const IndexType & index,

    Point<TCoordRep, VImageDimension>& voronoiRegionFrom,

    Point<TCoordRep, VImageDimension>& voronoiRegionTo ) const

  {

    for (unsigned int i = 0 ; i < VImageDimension ; i++)

      {

      voronoiRegionFrom[i] = 

    static_cast<TCoordRep>( this->m_Spacing[i] *

                ( static_cast<double>( index[i] ) - 0.5 )

                + this->m_Origin[i] );

      voronoiRegionTo[i] = 

    voronoiRegionFrom[i] + static_cast<TCoordRep>( this->m_Spacing[i] ); 

      }

  }

 
I would also be curious if you could think of a better way to represent 
the resulting region, rather than by its two corner points. I couldn't 
seem to find any lightweight class for a physical-space box in ITK, but 
maybe I am just missing something?

Thanks for any comments and suggestions!
  Torsten

PS: why do I need this? Well, once I have the Voronoi region of any 
given pixel, I can compute the intersections of any given line with the 
boundaries of that region (currently coding that), and that will be very 
useful in implementing Mori's DTI fiber tracking algorithm in ITK. In 
the long run, the line intersection may also be useful for high-quality 
DRR computation and/or ART-type CT reconstruction.

-- 
Torsten Rohlfing, PhD          SRI International, Neuroscience Program
 Research Scientist             333 Ravenswood Ave, Menlo Park, CA 94025
  Phone: ++1 (650) 859-3379      Fax: ++1 (650) 859-2743
   torsten at synapse.sri.com        http://www.stanford.edu/~rohlfing/

     "Though this be madness, yet there is a method in't"



More information about the Insight-developers mailing list