class_docstr: DicomSeries
  This class represents a serie of dicom files (SimpleDicomReader
  objects) that belong together. If these are multiple files, they
  represent the slices of a volume (like for CT or MRI).
class_docstr_tok: ["DicomSeries","This","class","represents","a","serie","of","dicom","files","(","SimpleDicomReader","objects",")","that","belong","together",".","If","these","are","multiple","files",",","they","represent","the","slices","of","a","volume","(","like","for","CT","or","MRI",")","."]
docstr: Get (load) the data that this DicomSeries represents, and return
  it as a numpy array. If this serie contains multiple images, the
  resulting array is 3D, otherwise it's 2D.
docstr_tok: ["Get","(","load",")","the","data","that","this","DicomSeries","represents",",","and","return","it","as","a","numpy","array",".","If","this","serie","contains","multiple","images",",","the","resulting","array","is","3D",",","otherwise","it","'s","2D","."]
code: def get_numpy_array(self):
      """Get (load) the data that this DicomSeries represents, and return
      it as a numpy array. If this serie contains multiple images, the
      resulting array is 3D, otherwise it's 2D.
      """
  
      # It's easy if no file or if just a single file
      if len(self) == 0:
          raise ValueError("Serie does not contain any files.")
      elif len(self) == 1:
          return self[0].get_numpy_array()
  
      # Check info
      if self.info is None:
          raise RuntimeError(
              "Cannot return volume if series not finished."
          )
  
      # Init data (using what the dicom packaged produces as a reference)
      slice = self[0].get_numpy_array()
      vol = np.zeros(self.shape, dtype=slice.dtype)
      vol[0] = slice
  
      # Fill volume
      self._progressIndicator.start("loading data", "", len(self))
      for z in range(1, len(self)):
          vol[z] = self[z].get_numpy_array()
          self._progressIndicator.set_progress(z + 1)
      self._progressIndicator.finish()
  
      # Done
      import gc
  
      gc.collect()
      return vol
  
imports: import sys
  import os
  import struct
  import logging
  import numpy
label_desc: Use image node_id 11 for calling the DicomSeries obj's underlying member method code with example usage: obj.get_numpy_array() and returns: vol, self