File size: 1,433 Bytes
b831e6f |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
from fastapi import APIRouter, Request, Response
from fastapi.responses import HTMLResponse
import main as libMain
from lib import utils as libUtils
m_kstrFile = __file__
m_blnTraceOn = True
m_kstrPath_templ = libUtils.pth_templ
rteWsi = APIRouter()
#---
@rteWsi.get('/')
def api_wsi():
return {
"message": "wsi api endpoint - welcome to the endpoint for wsi image processing"
}
#---
@rteWsi.get('/upload')
def api_wsiUpload():
'''
process a single uploaded WSI image (from external app path)
- cleanup all old WSI images in /data/wsi/raw
- save upload to /data/wsi/raw
- create wsi class obj; capture file path, size, zoomMagnif, etc
- return(s) json
- ack wsi upload with info/attribs
'''
return {
"message": "wsiUpload endpoint - file processing of one uploaded wsi image"
}
#---
@rteWsi.get('/chunk')
def api_wsiChunk():
'''
process a single WSI image (from internal app path)
- create wsi class obj; capture file path, size, zoomMagnif, etc
- kick off tile chunking process;
- save tiles to /data/tiles/raw
- return(s) json
- ack wsi upload with info/attribs
- ack of tiles created: total count; names, paths, attribs (dimensions)
'''
return {
"message": "wsiLoad endpoint - for chunking of wsi image to one or more tiles"
}
|