Пример #1
0
def get_image(uuid):
    """ Return an uploaded image. These are handled separately from
    Neurosynth-generated images in order to prevent public access based on
    sequential IDs, as all access to uploads must be via UUIDs. """
    dec = Decoding.query.filter_by(uuid=uuid).first()
    if dec is None:
        abort(404)
    return send_nifti(join(settings.DECODED_IMAGE_DIR, dec.filename),
                      basename(dec.filename))
Пример #2
0
def get_image(uuid):
    """ Return an uploaded image. These are handled separately from
    Neurosynth-generated images in order to prevent public access based on
    sequential IDs, as all access to uploads must be via UUIDs. """
    dec = Decoding.query.filter_by(uuid=uuid).first()
    if dec is None:
        abort(404)
    return send_nifti(join(settings.DECODED_IMAGE_DIR, dec.filename),
                      basename(dec.filename))
Пример #3
0
def download(val, unthresholded=False):
    image = Image.query.get_or_404(val)
    if not image.download:
        abort(404)
    # Log the download request
    db.session.add(Download(image_id=val, ip=request.remote_addr))
    db.session.commit()
    # Send the file
    filename = image.image_file if not unthresholded \
        else image.uncorrected_image_file
    return send_nifti(filename)
Пример #4
0
def download(val, unthresholded=False):
    image = Image.query.get_or_404(val)
    if not image.download:
        abort(404)
    # Log the download request
    db.session.add(Download(image_id=val, ip=request.remote_addr))
    db.session.commit()
    # Send the file
    filename = image.image_file if not unthresholded \
        else image.uncorrected_image_file
    return send_nifti(filename)
Пример #5
0
def anatomical_underlay():
    return send_nifti(os.path.join(IMAGE_DIR, 'anatomical.nii.gz'),
                      'anatomical.nii.gz')
Пример #6
0
def anatomical_underlay():
    return send_nifti(os.path.join(IMAGE_DIR, 'anatomical.nii.gz'),
                      'anatomical.nii.gz')