-
Notifications
You must be signed in to change notification settings - Fork 302
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
Streamlined head surface creation #877
base: master
Are you sure you want to change the base?
Streamlined head surface creation #877
Conversation
…ation with mask and threshold selection
…en a new surface from the largest contigous region
… if the plugin is installed
… head surface creation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for the PR @henrikkauppi! Very nice and useful. I made some suggestions.
|
||
# Remove non-visible faces from a surface without using the plugin GUI. | ||
# Defaults to the last surface in surface_dict which is generally the newest surface | ||
def remove_non_visible_faces_no_gui(self, surface_idx: int = -1) -> None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The remove_non_visible_faces_no_gui function, instead of being a plugin, could be in surface.py, similar to OnLargestSurface. However, instead of being added to task_surface, it could be placed in frame.py under the surface menu.
method = {"algorithm": algorithm, "options": options} | ||
srf_options = { | ||
"index": mask_index, | ||
"name": "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of the surface can be explicitly specified, rather than using the default. Like, brain or scalp
proj = prj.Project() | ||
surface_idx = len(proj.surface_dict) - 1 | ||
scalp_colour = [255, 235, 255] | ||
transparency = 0.25 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im not sure that the tranparency should be add to the scalp. Doesnt look that good.
@@ -342,6 +341,12 @@ def __init__(self, parent): | |||
self.SetSizerAndFit(sizer) | |||
self.__bind_events() | |||
|
|||
# Show the navigation panel in navigation mode; otherwise, show the imports panel | |||
if mode == const.MODE_NAVIGATOR: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When Invesalius is opened without an image loaded, it directly takes you to the Navigation section. I kind of miss the 'Load Data' tab. It might be counterintuitive to have to go back to the Imports section and then return to the Navigation section. Of course, it's also possible to use the upper menus to load images. However, I would recommend either having a copy of the 'Load Data' tab in the Navigation section or setting it up so that, if no image is loaded, the Load section is displayed first. After loading, it could then automatically switch to the Navigation section
self.SelectLargestSurface() | ||
|
||
if self.remove_non_visible_checkbox.IsChecked(): | ||
self.RemoveNonVisibleFaces() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When both 'Select Largest Surface' and 'Remove Non-visible Faces' are selected, it creates three surfaces for the scalp. Only one surface is needed, meaning the previously created scalp surfaces should be overwritten.
"name": "", | ||
"quality": _("Optimal *"), | ||
"fill": False, | ||
"keep_largest": False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
keep_largest could be True for the brain surface
Adds a new "Head" page in the coregistration panel to simplify the process of creating head and brain surfaces from a mask.
Streamlines the process of creating a 3D surface of the head and brain by combining multiple steps of head surface creation and brain segmentation into one button.
Clicking the Create head surface-button creates a 3D surface of the head and refines it according to selected options in the checkboxes. There is also an option for brain segmentation which segments the brain and also creates a brain surface.
Adds progress dialog windows for selecting largest region and removing non-visible faces since those didn't already exist.