class_docstr: First version of Epistemic computation used as active learning strategy
class_docstr_tok: ["First","version","of","Epistemic","computation","used","as","active","learning","strategy"]
code: def variance_volume(self, vol_input, ignore_nans=True):
      if ignore_nans:
          vol_input[vol_input <= 0] = 0.0005
          vari = np.nanvar(
              vol_input.cpu().detach().numpy(), axis=0
          )  # torch.var vs np.nanvar (ignore_nans)
          variance = np.sum(vari, axis=0)
      else:
          variance_metric = VarianceMetric(
              threshold=0.0005, spatial_map=True, scalar_reduction="sum"
          )
          variance = variance_metric(vol_input)
  
      if self.dimension == 3:
          variance = np.expand_dims(variance, axis=0)
          variance = np.expand_dims(variance, axis=0)
      return variance
  
file_path: MONAILabel/monailabel/tasks/scoring/epistemic_v2.py
imports: import logging
  import multiprocessing
  import os
  import time
  from concurrent.futures import ThreadPoolExecutor
  import numpy
  import torch
  from monai.metrics.active_learning_metrics import VarianceMetric
  from monailabel.interfaces.datastore import Datastore
  from monailabel.interfaces.tasks.scoring import ScoringMethod
  from monailabel.tasks.infer.basic_infer import BasicInferTask
  from monailabel.utils.others.generic import name_to_device
label_desc: Use image node_id 3 for calling the EpistemicScoring obj's underlying member method code with example usage: obj.variance_volume(vol_input, ignore_nans) and returns: variance