class_docstr: Compute the Variance of a given T-repeats N-dimensional array/tensor. The primary usage is as an uncertainty based
  metric for Active Learning.
  
  It can return the spatial variance/uncertainty map based on user choice or a single scalar value via mean/sum of the
  variance for scoring purposes
  
  Args:
      include_background: Whether to include the background of the spatial image or channel 0 of the 1-D vector
      spatial_map: Boolean, if set to True, spatial map of variance will be returned corresponding to i/p image dimensions
      scalar_reduction: reduction type of the metric, either 'sum' or 'mean' can be used
      threshold: To avoid NaN's a threshold is used to replace zero's
class_docstr_tok: ["Compute","the","Variance","of","a","given","T-repeats","N-dimensional","array\/tensor",".","The","primary","usage","is","as","an","uncertainty","based","metric","for","Active","Learning",".","It","can","return","the","spatial","variance\/uncertainty","map","based","on","user","choice","or","a","single","scalar","value","via","mean\/sum","of","the","variance","for","scoring","purposes","Args",":","include_background",":","Whether","to","include","the","background","of","the","spatial","image","or","channel","0","of","the","1-D","vector","spatial_map",":","Boolean",",","if","set","to","True",",","spatial","map","of","variance","will","be","returned","corresponding","to","i\/p","image","dimensions","scalar_reduction",":","reduction","type","of","the","metric",",","either","'sum","'","or","'mean","'","can","be","used","threshold",":","To","avoid","NaN","'s","a","threshold","is","used","to","replace","zero","'s"]
code: def __init__(
      self,
      include_background: bool = True,
      spatial_map: bool = False,
      scalar_reduction: str = "sum",
      threshold: float = 0.0005,
  ) -> None:
      super().__init__()
      self.include_background = include_background
      self.spatial_map = spatial_map
      self.scalar_reduction = scalar_reduction
      self.threshold = threshold
  
file_path: MONAI/monai/metrics/active_learning_metrics.py
imports: from __future__ import annotations
  import warnings
  from typing import Any
  import torch
  from monai.metrics.utils import ignore_background
  from monai.utils import MetricReduction
  from .metric import Metric
label_desc: Use image node_id 1 to create a new VarianceMetric object from inherited base classes: Metric with example: obj = VarianceMetric(include_background, spatial_map, scalar_reduction, threshold)