code: def get_ray_directions(H, W, focal, center=None):
      """
      Get ray directions for all pixels in camera coordinate.
      Reference: https://www.scratchapixel.com/lessons/3d-basic-rendering/
                 ray-tracing-generating-camera-rays/standard-coordinate-systems
      Inputs:
          H, W, focal: image height, width and focal length
      Outputs:
          directions: (H, W, 3), the direction of the rays in camera coordinate
      """
      grid = (
          create_meshgrid(H, W, normalized_coordinates=False)[0] + 0.5
      )
  
      i, j = grid.unbind(-1)
      # the direction here is without +0.5 pixel centering as calibration is not so accurate
      # see https://github.com/bmild/nerf/issues/24
      cent = center if center is not None else [W / 2, H / 2]
      directions = torch.stack(
          [
              (i - cent[0]) / focal[0],
              (j - cent[1]) / focal[1],
              torch.ones_like(i),
          ],
          -1,
      )  # (H, W, 3)
  
      return directions
  
file_path: slimmerf/dataLoader/ray_utils.py
imports: import torch, re
  import numpy
  from torch import searchsorted
  from kornia import create_meshgrid
label_desc: Use image node_id 3 for calling a global function with example usage: get_ray_directions(H, W, focal, center) and returns: directions