コード例 #1
0
ファイル: surface.py プロジェクト: rubenkar/invesalius3
 def OnDuplicate(self, pubsub_evt):
     selected_items = pubsub_evt.data
     proj = prj.Project()
     surface_dict = proj.surface_dict
     for index in selected_items:
         original_surface = surface_dict[index]
         # compute copy name
         name = original_surface.name
         names_list = [surface_dict[i].name for i in surface_dict.keys()]
         new_name = utl.next_copy_name(name, names_list) 
         # create new mask
         self.CreateSurfaceFromPolydata(polydata = original_surface.polydata,
                                        overwrite = False,
                                        name = new_name,
                                        colour = original_surface.colour,
                                        transparency = original_surface.transparency,
                                        volume = original_surface.volume)
コード例 #2
0
ファイル: surface.py プロジェクト: biomaglab/invesalius3
 def OnDuplicate(self, pubsub_evt):
     selected_items = pubsub_evt.data
     proj = prj.Project()
     surface_dict = proj.surface_dict
     for index in selected_items:
         original_surface = surface_dict[index]
         # compute copy name
         name = original_surface.name
         names_list = [surface_dict[i].name for i in surface_dict.keys()]
         new_name = utl.next_copy_name(name, names_list)
         # create new mask
         self.CreateSurfaceFromPolydata(
             polydata=original_surface.polydata,
             overwrite=False,
             name=new_name,
             colour=original_surface.colour,
             transparency=original_surface.transparency,
             volume=original_surface.volume)
コード例 #3
0
ファイル: slice_.py プロジェクト: 151706061/invesalius
 def OnDuplicateMasks(self, pubsub_evt):
     selected_items = pubsub_evt.data
     proj = Project()
     mask_dict = proj.mask_dict
     for index in selected_items:
         original_mask = mask_dict[index]
         # compute copy name
         name = original_mask.name
         names_list = [mask_dict[i].name for i in mask_dict.keys()]
         new_name = utils.next_copy_name(name, names_list)
         # create new mask
         self.CreateMask(imagedata = original_mask.imagedata,
                         name = new_name,
                         colour = original_mask.colour,
                         opacity = original_mask.opacity,
                         threshold_range = original_mask.threshold_range,
                         edition_threshold_range = original_mask.edition_threshold_range,
                         edited_points = original_mask.edited_points)