-
Notifications
You must be signed in to change notification settings - Fork 358
Include peeled brain as a regular surface and persist in projects #920
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
base: master
Are you sure you want to change the base?
Include peeled brain as a regular surface and persist in projects #920
Conversation
@vhosouza @rmatsuda @henrikkauppi |
Hi @AksharaSBhat! Thanks for the PR. I tested the changes, and the peel surface looks weird. I think the transformations are incorrect. Please check brainmesh_handler.py. Here are the steps to create the peel surface:
Note: You should have Transcranial Magnetic Stimulation mode enabled. You can find it under Mode -> Navigation Mode. |
Fixes: Now the user can freely adjust the peeling depth and brain opacity, without creating a new surface The peeled surface is handled separately in AddSurface so that it is rendered properly
Hi @rmatsuda Thanks for the feedback. I have fixed the issues now. The user can freely adjust the peeling depth and brain opacity. It won't create a new 3D surface but rather overlap the existing one. ChangesModified This is the peeled surface in after the latest commit in this branch And this is the peeled surface in the master branch of Invesalius3 I am using the InVesaliuus MRI T1 file given the Downloads section of the Invesalius website. If the issue persists, could you give the file you are using and segmentation parameters (overlap, level of certainity etc...) So that I can reproduce it. Note: Unchecking the Peel surface check box no longer disappears the peeled surface as it is being treated as regular surface now. |
Regarding performance, it takes a while to change the peeling depth. I also noticed that the peel blinks twice. Could you try to optimize it, please? |
Hi, could you guide me as to how can I get a mask file for creating a peel surface. Regarding the opacity, due to a bug in my code, opacity is treated as transparency, I will fix it. Could you please check and verify if reducing opacity(reducing transparency) removes the blurriness. I will also look into blinking of surface while changing depth, I believe it is being re-rendered twice |
I have fixed the issue with opacity and added back face culling for peeled surfaces to remove the blurriness. Also, it no longer re-renders twice, so it only blinks once and it is relatively quick. I extracted a mask_1.plist from the inv3 file and used it to generate a peel surface and it perfectly overlapped with existing 3D surface. Could you tell me how can I reproduce the issues you are facing? |
Could you please look into this again and if issues persist, tell me how to reproduce the issue @rmatsuda @paulojamorim. extracted a mask_1.plist from the inv3 file and used it to generate a peel surface and it perfectly overlapped with existing 3D surface. I have fixed the blurriness and blinking issue. |
What does this PR do?
This PR ensures that the peeled brain is treated as a regular surface but restricts color changes.
It also fixes an issue where the peeled brain was not saved and restored when reopening a project.
Changes made
Added peel attribute to Surface to track peeled surfaces.
Updated CreateSurfaceFromPolydata to properly assign peel=True.
Modified SavePlist and OpenPlist to persist peel state.
Disabled "Change Color" button for peeled surfaces in the UI.
Disabled
button_colour
for peel intask_surface.py
How to test
Create a peeled brain surface.
Save and close InVesalius.
Reopen the project and check if the peeled brain is restored.
Right-click on the peeled brain → "Change Color" should be disabled.
Closes #796