def min_and_max_indices
      # I indices:
      if @p1.x < @p2.x
        if @alpha_min == @alpha_x_min
          @i_min = 1
        else
          @i_min = phi_x(@alpha_min)
        end
        if @alpha_max == @alpha_x_max
          @i_max = @vs.nx
        else
          @i_max = phi_x(@alpha_max)
        end
      else
        if @alpha_min == @alpha_x_min
          @i_max = @vs.nx - 1
        else
          @i_max = phi_x(@alpha_min)
        end
        if @alpha_max == @alpha_x_max
          @i_min = 0
        else
          @i_min = phi_x(@alpha_max)
        end
      end
      # J indices:
      if @p1.y < @p2.y
        if @alpha_min == @alpha_y_min
          @j_min = 1
        else
          @j_min = phi_y(@alpha_min)
        end
        if @alpha_max == @alpha_y_max
          @j_max = @vs.ny
        else
          @j_max = phi_y(@alpha_max)
        end
      else
        if @alpha_min == @alpha_y_min
          @j_max = @vs.ny - 1
        else
          @j_max = phi_y(@alpha_min)
        end
        if @alpha_max == @alpha_y_max
          @j_min = 0
        else
          @j_min = phi_y(@alpha_max)
        end
      end
      # K indices:
      if @p1.z < @p2.z
        if @alpha_min == @alpha_z_min
          @k_min = 1
        else
          @k_min = phi_z(@alpha_min)
        end
        if @alpha_max == @alpha_z_max
          @k_max = @vs.nz
        else
          @k_max = phi_z(@alpha_max)
        end
      else
        if @alpha_min == @alpha_z_min
          @k_max = @vs.nz - 1
        else
          @k_max = phi_z(@alpha_min)
        end
        if @alpha_max == @alpha_z_max
          @k_min = 0
        else
          @k_min = phi_z(@alpha_max)
        end
      end
    end
def min_and_max_indices
      # I indices:
      if @p1.x < @p2.x
        if @alpha_min == @alpha_x_min
          @i_min = 1
        else
          @i_min = phi_x(@alpha_min)
        end
        if @alpha_max == @alpha_x_max
          @i_max = @vs.nx
        else
          @i_max = phi_x(@alpha_max)
        end
      else
        if @alpha_min == @alpha_x_min
          @i_max = @vs.nx - 1
        else
          @i_max = phi_x(@alpha_min)
        end
        if @alpha_max == @alpha_x_max
          @i_min = 0
        else
          @i_min = phi_x(@alpha_max)
        end
      end
      # J indices:
      if @p1.y < @p2.y
        if @alpha_min == @alpha_y_min
          @j_min = 1
        else
          @j_min = phi_y(@alpha_min)
        end
        if @alpha_max == @alpha_y_max
          @j_max = @vs.ny
        else
          @j_max = phi_y(@alpha_max)
        end
      else
        if @alpha_min == @alpha_y_min
          @j_max = @vs.ny - 1
        else
          @j_max = phi_y(@alpha_min)
        end
        if @alpha_max == @alpha_y_max
          @j_min = 0
        else
          @j_min = phi_y(@alpha_max)
        end
      end
      # K indices:
      if @p1.z < @p2.z
        if @alpha_min == @alpha_z_min
          @k_min = 1
        else
          @k_min = phi_z(@alpha_min)
        end
        if @alpha_max == @alpha_z_max
          @k_max = @vs.nz
        else
          @k_max = phi_z(@alpha_max)
        end
      else
        if @alpha_min == @alpha_z_min
          @k_max = @vs.nz - 1
        else
          @k_max = phi_z(@alpha_min)
        end
        if @alpha_max == @alpha_z_max
          @k_min = 0
        else
          @k_min = phi_z(@alpha_max)
        end
      end
    end
Determines the intersection indices [i,j,k]_min (the first intersected
 plane after the ray entered the voxel space) and [i,j,k]_max (when the
 destination is outside the voxel space, this will be the outer voxel plane).