code: def freqhist_bins(self: Tensor, n_bins=100):
      "A function to split the range of pixel values into groups, such that each group has around the same number of pixels"
      imsd = self.view(-1).sort()[0]
      t = torch.cat(
          [
              tensor([0.001]),
              torch.arange(n_bins).float() / n_bins + (1 / 2 / n_bins),
              tensor([0.999]),
          ]
      )
      t = (len(imsd) * t).long()
      return imsd[t].unique()
  
imports: from __future__ import annotations
  from ..basics import *
  from ..vision.all import *
  from ..data.transforms import *
  import pydicom, kornia, skimage
  from pydicom.dataset import Dataset
  from pydicom.tag import BaseTag
  from pydicom.multival import MultiValue
  from PIL import Image
label_desc: Use image node_id 7 for calling a global function with example usage: freqhist_bins(n_bins) and returns: imsd