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

Update FOCUSR object to make parameters callable #5

Open
gattia opened this issue Feb 28, 2022 · 1 comment
Open

Update FOCUSR object to make parameters callable #5

gattia opened this issue Feb 28, 2022 · 1 comment

Comments

@gattia
Copy link
Owner

gattia commented Feb 28, 2022

class Focusr(object):

Update paramaeters like:

  • icp_register_first
  • icp_registration_mode
  • etc.

to be dynamically updateable by using:

focusr.icp_register_first = True

And the same for retrieving information:

print(focusr.icp_register_first)

but use proper @property instead of directly accessing that information from the object.

@gattia
Copy link
Owner Author

gattia commented Feb 28, 2022

Same for other things:

pyfocusr/pyfocusr/focusr.py

Lines 497 to 517 in 9cd8669

def get_source_mesh_transformed_weighted_avg(self):
"""
Create new mesh same as source mesh. Get source points. Move source points to transformed location(s) on
target mesh using weighted average locations.
:return:
"""
self.weighted_avg_transformed_mesh = vtk_deep_copy(self.graph_source.vtk_mesh)
points = self.weighted_avg_transformed_mesh.GetPoints()
for src_pt_idx in range(self.graph_source.n_points):
points.SetPoint(src_pt_idx, self.weighted_avg_transformed_points[src_pt_idx])
def get_source_mesh_transformed_nearest_neighbour(self):
"""
Create new mesh same as source mesh. Get source points. Move source points to transformed location(s) on
target mesh using nearest neighbour locations.
:return:
"""
self.nearest_neighbour_transformed_mesh = vtk_deep_copy(self.graph_source.vtk_mesh)
points = self.nearest_neighbour_transformed_mesh.GetPoints()
for src_pt_idx in range(self.graph_source.n_points):
points.SetPoint(src_pt_idx, self.nearest_neighbor_transformed_points[src_pt_idx])

The above shows how we are setting / updating certain parametres - should consolidate.
Should also change objects like self.weighted_avg_transformed_mesh to be self._weighted_avg_transformed_mesh so that we arent messing with it directly. Also, self.weighted_avg_transformed_mesh & self.nearest_neighbour_transformed_mesh should probably just be the same thing and not be accessing different object/things.

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

No branches or pull requests

1 participant