You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement a file upload feature within the project page that handles file drop events. This feature should support both TSV and individual image/mask/annotation files, with appropriate async handling, error logging, and condition-based processing for existing files. Uploaded data should be reflected in the UI grid.
Feature Details
The file drop event will process each file individually using an async processFile(filename, file) method, which will determine the specific upload method based on file type.
File Processing Logic
TSV Files:
processFile() will invoke uploadRemote() once for each row in the TSV file.
Image Files:
processFile() will select an upload method based on file suffix:
Standard Image Upload: UploadImage()
Tissue Mask Upload: UploadTissueMask()
Annotations Upload: UploadAnnotations()
Upload Methods and API Calls
Four methods will need to be implemented to interact with the API. Sequences of API calls are listed for each method.
uploadRemote()
GETimage/search:
If empty: proceed to upload (image does not exist).
If non-empty: log “skipping [image name], file already exists.”
POSTimage:
On 500 error: log error and exit method.
POSTimage/tissue_mask (if available):
On 404 error: log error.
POSTimage/annotation (if available):
On 404 error: log error.
GETimage after each upload to update the slickgrid.
UploadImage()
GETimage/search:
If empty: upload image, then retrieve and update slickgrid.
If non-empty: log “skipping [image name], file already exists.”
POSTimage:
On 500 error: log error and exit.
GETimage after each upload to update the slickgrid.
UploadTissueMask()
GETimage/search:
If empty: log error and return (image not found).
POSTimage/tissue_mask:
On 200: retrieve and update slickgrid.
On 500: log error.
UploadAnnotations()
GETimage/search:
If empty: log error and return (image not found).
POSTimage/annotation:
On 200: retrieve and update slickgrid.
On 500: log error.
Re-Upload Behavior
If a user deletes an image from the project and later re-uploads it using the drag-and-drop method, the backend should allow the image to upload again, even if it already exists in the file system.
Acceptance Criteria
File drop event correctly processes and uploads TSV and image/mask/annotation files.
For each uploaded file, the UI grid accurately reflects updates.
Image re-upload after deletion is supported by the backend.
Error logging is implemented as specified for each upload method.
Duplicate image files are identified, and redundant uploads are logged accordingly.
References:
N/A
The text was updated successfully, but these errors were encountered:
Description
Implement a file upload feature within the project page that handles file drop events. This feature should support both TSV and individual image/mask/annotation files, with appropriate async handling, error logging, and condition-based processing for existing files. Uploaded data should be reflected in the UI grid.
Feature Details
The file drop event will process each file individually using an async
processFile(filename, file)
method, which will determine the specific upload method based on file type.File Processing Logic
TSV Files:
processFile()
will invokeuploadRemote()
once for each row in the TSV file.Image Files:
processFile()
will select an upload method based on file suffix:UploadImage()
UploadTissueMask()
UploadAnnotations()
Upload Methods and API Calls
Four methods will need to be implemented to interact with the API. Sequences of API calls are listed for each method.
uploadRemote()
image/search
:image
:image/tissue_mask
(if available):image/annotation
(if available):image
after each upload to update the slickgrid.UploadImage()
image/search
:image
:image
after each upload to update the slickgrid.UploadTissueMask()
image/search
:image/tissue_mask
:UploadAnnotations()
image/search
:image/annotation
:Re-Upload Behavior
If a user deletes an image from the project and later re-uploads it using the drag-and-drop method, the backend should allow the image to upload again, even if it already exists in the file system.
Acceptance Criteria
References:
N/A
The text was updated successfully, but these errors were encountered: