Wrapping/WrapITK/Python/itkExtras/__init__.py
def physical_point_to_continuous_index( imageOrFilter, p ):
  """Get the continuous index in an image from the physical point
  
  imageOrFilter is the image where the physical point must be computed
  p is the point used to compute the index
  """
  from __builtin__ import range # required because range is overladed in this module
  # get the image if needed
  img = image( imageOrFilter )
  dim = img.GetImageDimension()
  o = origin( img )
  s = spacing( img )
  
  # use the typemaps to really get a point
  import itk
  p = itk.Point[ itk.D, dim ]( p )
  
  # create the output object
  idx = itk.ContinuousIndex[ itk.D, dim ]()
  for i in range( 0, dim ):
    idx.SetElement( i, ( p.GetElement(i) - o.GetElement(i) ) / s.GetElement(i) )
  return idx
Get the continuous index in an image from the physical point
  
  imageOrFilter is the image where the physical point must be computed
  p is the point used to compute the index
  
Get the continuous index in an image from the physical point
imageOrFilter is the image where the physical point must be computed
p is the point used to compute the index
Get the continuous index in an image from the physical point imageOrFilter is the image where the physical point must be computed p is the point used to compute the index
def physical_point_to_continuous_index( imageOrFilter, p ):
  from __builtin__ import range 
  img = image( imageOrFilter )
  dim = img.GetImageDimension()
  o = origin( img )
  s = spacing( img )
  import itk
  p = itk.Point[ itk.D, dim ]( p )
  idx = itk.ContinuousIndex[ itk.D, dim ]()
  for i in range( 0, dim ):
    idx.SetElement( i, ( p.GetElement(i) - o.GetElement(i) ) / s.GetElement(i) )
  return idx
def physical_point_to_continuous_index ( imageOrFilter , p ) : from __builtin__ import range img = image ( imageOrFilter ) dim = img . GetImageDimension ( ) o = origin ( img ) s = spacing ( img ) import itk p = itk . Point [ itk . D , dim ] ( p ) idx = itk . ContinuousIndex [ itk . D , dim ] ( ) for i in range ( 0 , dim ) : idx . SetElement ( i , ( p . GetElement ( i ) - o . GetElement ( i ) ) / s . GetElement ( i ) ) return idx
Get the continuous index in an image from the physical point
imageOrFilter is the image where the physical point must be computed
p is the point used to compute the index
Get the continuous index in an image from the physical point imageOrFilter is the image where the physical point must be computed p is the point used to compute the index
"""Get the continuous index in an image from the physical point
  
  imageOrFilter is the image where the physical point must be computed
  p is the point used to compute the index
  """ # required because range is overladed in this module # get the image if needed # use the typemaps to really get a point # create the output object
imageOrFilter
p