original_docstring: 
      Splits a 4D dicom image into a list of 3D sitk images, copy alldicom metadata
      Parameters
      ----------
      img_4d_sitk :
      mask_4d_sitk :
      slice_treshhold :
  
      Returns list of 3D-sitk objects
      -------
      
docstring: Splits a 4D dicom image into a list of 3D sitk images, copy alldicom metadata
  Parameters
  
  
  
  Returns list of 3D-sitk objects
docstring_tokens: Splits a 4D dicom image into a list of 3D sitk images copy alldicom metadata Parameters Returns list of 3D - sitk objects
code: def split_one_4d_sitk_in_list_of_3d_sitk(img_4d_sitk, HIST_MATCHING=False, ref=None):
      """
      Splits a 4D dicom image into a list of 3D sitk images, copy alldicom metadata
      Parameters
      ----------
      img_4d_sitk :
      mask_4d_sitk :
      slice_treshhold :
  
      Returns list of 3D-sitk objects
      -------
      """
  
      img_4d_nda = sitk.GetArrayFromImage(img_4d_sitk)
  
      # histogram matching - apply only on 50% of the files
      if HIST_MATCHING and random.randint(0, 100) < 50:
          img_4d_nda = match_hist(img_4d_nda, ref)
  
      # create t 3d volumes
      list_of_3dsitk = [
          copy_meta_and_save(new_image=img_3d, reference_sitk_img=img_4d_sitk, full_filename=None, override_spacing=None,
                             copy_direction=True) for img_3d in img_4d_nda]
  
      return list_of_3dsitk
code_tokens: def split_one_4d_sitk_in_list_of_3d_sitk ( img_4d_sitk , HIST_MATCHING = False , ref = None ) : img_4d_nda = sitk . GetArrayFromImage ( img_4d_sitk ) if HIST_MATCHING and random . randint ( 0 , 100 ) < 50 : img_4d_nda = match_hist ( img_4d_nda , ref ) list_of_3dsitk = [ copy_meta_and_save ( new_image = img_3d , reference_sitk_img = img_4d_sitk , full_filename = None , override_spacing = None , copy_direction = True ) for img_3d in img_4d_nda ] return list_of_3dsitk
short_docstring: Splits a 4D dicom image into a list of 3D sitk images, copy alldicom metadata
  Parameters
short_docstring_tokens: Splits a 4D dicom image into a list of 3D sitk images copy alldicom metadata Parameters
comment: """
      Splits a 4D dicom image into a list of 3D sitk images, copy alldicom metadata
      Parameters
      ----------
      img_4d_sitk :
      mask_4d_sitk :
      slice_treshhold :
  
      Returns list of 3D-sitk objects
      -------
      """$SEP$# histogram matching - apply only on 50% of the files$SEP$# create t 3d volumes