Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add roi edit #106

Merged
merged 51 commits into from
Dec 25, 2023
Merged

Feature/add roi edit #106

merged 51 commits into from
Dec 25, 2023

Conversation

sanglevinh
Copy link
Collaborator

No description provided.

# Conflicts:
#	frontend/src/components/Workspace/Visualize/Plot/ImagePlot.tsx
#	frontend/src/const/Mode.ts
sanglevinh and others added 3 commits November 1, 2023 13:59
# Conflicts:
#	frontend/src/api/outputs/Outputs.ts
#	frontend/src/components/Workspace/Visualize/Plot/ImagePlot.tsx
@sanglevinh sanglevinh marked this pull request as ready for review November 27, 2023 09:04
@sanglevinh
Copy link
Collaborator Author

@ReiHashimoto @itutu-tienday
I changed the loading, pls check it again

Screen.Recording.2023-12-07.at.13.53.21.mov

if (!edit)
return (
<LinkDiv sx={{ width: "fit-content" }} onClick={editRoi}>
Edit ROI
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sanglevinh
CC: @ReiHashimoto

Whenever I execute an Edit ROI on a RECORD executed in another branch (such as develop-main at this time), the Roi Edit-related API always seems to respond with a 400 error.
*If the RECORD was generated in this branch, it seems to work fine.

Is this a known issue? (Is backward compatibility of outnput data lost?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@itutu-tienday As far as I can see, it seems that in the develop-main request Url has not added the workspace_id param, so that's why it happens

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sanglevinh
Thank you.

request Url has not added the workspace_id param

Which request is this?
Since the pkl file doesn't seem to be read well by BE (I get a 400 error), is this a request that affects the generation of the pkl file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@itutu-tienday
As far as I see the api, it requires the workspace_id param
Screenshot 2023-12-07 at 15 34 56

Copy link
Collaborator

@itutu-tienday itutu-tienday Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sanglevinh
Even without calling add_roi, the following operation seems to generate a 400 error.

Example)

  1. RUN Workflow in develop-main
  2. Switch branch to add_ROI_edit+improve-edit-roi
  3. Visualize→Select Roi→select cell_roi
  4. Select Edit ROI and 400 error
    • The API for the error is POST /outputs/image/*/status?workspace_id=1.

If you don't mind, could you please share the above with BE's?

@ReiHashimoto
Can you reproduce it in your environment?

Copy link
Collaborator Author

@sanglevinh sanglevinh Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@itutu-tienday
I talked to BE,
The ROI editing data of develop and improve-edit-roi are not the same, causing error 400

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@itutu-tienday @sanglevinh

Even without calling add_roi, the following operation seems to generate a 400 error.

It reproduces in my environment, too.
On selecting roi data, it calls /image/{filepath:path}/status endpoint.

The ROI editing data of develop and improve-edit-roi are not the same, causing error 400

Yes, in improve-edit-roi branch, "edit_roi_data" was added to output dict.
e.g. studio/app/optinist/wrappers/suite2p/roi.py

info = {
    "ops": Suite2pData(ops),
    ...
    "edit_roi_data": EditRoiData(images=ImageData(ops["filelist"]).data, im=im),
    "nwbfile": nwbfile,
}

I think the cause is the following BE code.

studio/app/optinist/core/edit_ROI/edit_ROI.py

self.data = self.output_info.get("edit_roi_data", {})
self.tmp_data: EditRoiData = self.tmp_output_info.get(
    "edit_roi_data", self.data  
)

if not isinstance(self.tmp_data, EditRoiData):
    raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST)

at self.tmp_data: EditRoiData ...,
if we can't get data with "edit_roi_data" key, maybe we need to assign new EditRoiData instance.

@ReiHashimoto ReiHashimoto merged commit df8f768 into develop-main Dec 25, 2023
2 checks passed
@ReiHashimoto ReiHashimoto deleted the feature/add_ROI_edit branch December 25, 2023 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[No.15]ROIのマニュアルでの削除/追加機能の改善(ROI Edit モード機能の追加)
3 participants