mirror of
https://github.com/chanzuckerberg/cellxgene.git
synced 2026-10-04 12:58:13 +08:00
Checkpoint
This commit is contained in:
@@ -4,6 +4,7 @@ import sys
|
||||
from http import HTTPStatus
|
||||
import zlib
|
||||
import json
|
||||
import numpy as np
|
||||
|
||||
from flask import make_response, jsonify, current_app, abort, send_file
|
||||
from werkzeug.urls import url_unquote
|
||||
@@ -419,7 +420,8 @@ def spatial_image_get(request, data_adaptor):
|
||||
return abort_and_log(HTTPStatus.BAD_REQUEST, f"spatial information does not contain requested resolution '{resolution}'")
|
||||
|
||||
response_image = io.BytesIO()
|
||||
matplotlib.pyplot.imsave(response_image, spatial[library_id]["images"][resolution])
|
||||
img = np.flipud(spatial[library_id]["images"][resolution])
|
||||
matplotlib.pyplot.imsave(response_image, img)
|
||||
response_image.seek(0)
|
||||
|
||||
try:
|
||||
|
||||
@@ -361,6 +361,8 @@ class DataAdaptor(metaclass=ABCMeta):
|
||||
translate = 0.5 - ((max - min) / scale / 2)
|
||||
normalized_layout = normalized_layout + translate
|
||||
|
||||
print(f"scale {scale}, translate {translate}")
|
||||
|
||||
normalized_layout = normalized_layout.astype(dtype=np.float32)
|
||||
return normalized_layout
|
||||
|
||||
@@ -388,6 +390,8 @@ class DataAdaptor(metaclass=ABCMeta):
|
||||
df = pd.concat(layout_data, axis=1, copy=False)
|
||||
else:
|
||||
df = pd.DataFrame()
|
||||
# print("##########DF")
|
||||
# print(df)
|
||||
fbs = encode_matrix_fbs(df, col_idx=df.columns, row_idx=None)
|
||||
|
||||
return fbs
|
||||
|
||||
Reference in New Issue
Block a user