def analyse(root, filename, output_folder):
  # input
  dx = 1
  dy = 1
  dz = 1 
  
  # loading
  print "opening",root,filename
  imp = Opener().openImage(root, filename)      

  # processing
  #imp.show()
  print "processing.."
  imp = af.convert_to_32bit(imp)
  imp = af.blur_3D_gauss(imp,dx,dy,dz)
  imp_max = af.project_z(imp, "max")
  imp_sum = af.project_z(imp, "sum")
  
  #imp_sum = af.project_z_sum(imp)
  #imp_max.show()
  
  # saving
  af.save_hyperstack_as_image_sequence(imp_max, output_folder)
  af.save_hyperstack_as_image_sequence(imp_sum, output_folder)
  
  return None
def analyze(path, nc, nz, nt):

  # load
  imp = af.load_image_sequence_from_path_to_hyperstack(path, nc, nz, nt)
  #imp.show()
  # analyze
  imp = af.project_z(imp, "sum")
  #imp2.show()
  # save
  path_out = os.path.join(path,"sum_projection")
  af.save_hyperstack_as_image_sequence(imp, path_out)
  asdfds
  return 0