def queryNIFTI ( tmpfile, ch, db, proj ):

  try:

    # get the header in a fileobj
    try:

      nmodel = NIFTIHeader.objects.get(channel_id=ch.getChannelModel().id)

      naffine = pickle.loads(nmodel.affine)
      nheader = pickle.loads(nmodel.header)

    except:

      # when there's no header info, insert a blank header
      naffine = None
      nheader = None

    # retrieve the data
    cuboid = db.cutout ( ch, (0,0,0), proj.datasetcfg.imagesz[0], 0 ) 

    # transpose to nii's xyz format
    niidata = cuboid.data.transpose()

    # work on nifti 3d only for now
    # coerce the data type 
    if ch.getDataType() in DTYPE_uint16:   
      niidata = np.array(niidata, dtype='<i2')

    # assemble the header and the data
    # create a nii file
    nii = nibabel.Nifti1Image(niidata, affine=naffine, header=nheader ) 

    # this adds a suffix
    # save to the tmpfile
    nibabel.save ( nii, tmpfile.name )

  except Exception, e:
    logger.error("Failed to build nii file.  Error {}".format(e))
    raise
Get float adjust option.
dataset/ETHPy150Open neurodata/ndstore/ocpca/ocpcanifti.py/queryNIFTI--crossover with--dataset/ETHPy150Open disqus/playa/playa/lib/vlc.py/libvlc_video_get_adjust_float