code: def to_nchan(x: Tensor, wins, bins=None):
      res = [x.windowed(*win) for win in wins]
      if not isinstance(bins, int) or bins != 0:
          res.append(x.hist_scaled(bins).clamp(0, 1))
      dim = [0, 1][x.dim() == 3]
      return TensorCTScan(torch.stack(res, dim=dim))
  
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 24 for calling a global function with example usage: to_nchan(x, wins, bins) and returns: TensorCTScan