Exemplo n.º 1
0
 def update(self):
     self._view.clear()
     left_mesh = self._viewport_model.observed_objects[
         IntraAnalysisParameterNames.LEFT_WHITE_SURFACE]
     right_mesh = self._viewport_model.observed_objects[
         IntraAnalysisParameterNames.RIGHT_WHITE_SURFACE]
     left_sulci = self._viewport_model.observed_objects[
         IntraAnalysisParameterNames.LEFT_SULCI]
     right_sulci = self._viewport_model.observed_objects[
         IntraAnalysisParameterNames.RIGHT_SULCI]
     left_labeled_sulci = self._viewport_model.observed_objects[
         IntraAnalysisParameterNames.LEFT_LABELED_SULCI]
     right_labeled_sulci = self._viewport_model.observed_objects[
         IntraAnalysisParameterNames.RIGHT_LABELED_SULCI]
     grey_color = [0.8, 0.8, 0.8, 1.]
     if self.view_type() == ViewType.THREE_D and left_mesh is not None:
         left_mesh.set_color(grey_color) 
         self._view.add_object(left_mesh)
     if self.view_type() == ViewType.THREE_D and right_mesh is not None:
         right_mesh.set_color(grey_color)
         self._view.add_object(right_mesh)
     if left_labeled_sulci is not None:
         self._view.add_object(left_labeled_sulci)
     elif left_sulci is not None:
         self._view.add_object(left_sulci)
     if right_labeled_sulci is not None:
         self._view.add_object(right_labeled_sulci)
     elif right_sulci is not None:
         self._view.add_object(right_sulci)
     if ((left_mesh is not None) or (right_mesh is not None) or
         (left_sulci is not None) or (right_sulci is not None) or
         (left_labeled_sulci is not None) or
         (right_labeled_sulci is not None)) \
             and self.view_type() != ViewType.THREE_D:
         mri = self._viewport_model.observed_objects[
             IntraAnalysisParameterNames.CORRECTED_MRI]
         if mri is not None:
             self._view.add_object(mri)
     self._temp_object = []
     gw_color = [1., 0.7, 0.7, 1.]
     if self.view_type() != ViewType.THREE_D and left_mesh is not None:
         print('add 2d mesh left')
         left_fus = Object3D.from_fusion(
             left_mesh, method='Fusion2DMeshMethod')
         left_fus.set_color(gw_color)
         print('left_fus:', left_fus)
         self._temp_object = [left_fus]
         self._view.add_object(left_fus)
     if self.view_type() != ViewType.THREE_D and right_mesh is not None:
         right_fus = Object3D.from_fusion(
             right_mesh, method='Fusion2DMeshMethod')
         right_fus.set_color(gw_color)
         self._temp_object.append(right_fus)
         self._view.add_object(right_fus)
Exemplo n.º 2
0
 def update(self):
     self._view.clear()
     left_mesh = self._viewport_model.observed_objects[
         IntraAnalysisParameterNames.LEFT_GREY_SURFACE]
     right_mesh = self._viewport_model.observed_objects[
         IntraAnalysisParameterNames.RIGHT_GREY_SURFACE]
     yellow_color = [0.9, 0.7, 0.0, 1]
     gw_color = [1., 0.7, 0.7, 1.]
     if left_mesh is not None or right_mesh is not None:
         mri = self._viewport_model.observed_objects[
             IntraAnalysisParameterNames.CORRECTED_MRI]
         if mri is not None:
             self._view.add_object(mri)
     if self.view_type() == ViewType.THREE_D:
         if left_mesh is not None:
             left_mesh.set_color(yellow_color)
             self._view.add_object(left_mesh)
         if right_mesh is not None:
             right_mesh.set_color(yellow_color)
             self._view.add_object(right_mesh)
     else: # 2D mode
         self._temp_object = []
         if left_mesh is not None:
             left_fus = Object3D.from_fusion(
                 left_mesh, method='Fusion2DMeshMethod')
             left_fus.set_color(yellow_color)
             self._temp_object = [left_fus]
             self._view.add_object(left_fus)
         if right_mesh is not None:
             right_fus = Object3D.from_fusion(
                 right_mesh, method='Fusion2DMeshMethod')
             right_fus.set_color(yellow_color)
             self._temp_object.append(right_fus)
             self._view.add_object(right_fus)
         left_gw_mesh = self._viewport_model.observed_objects[
             IntraAnalysisParameterNames.LEFT_WHITE_SURFACE]
         right_gw_mesh = self._viewport_model.observed_objects[
             IntraAnalysisParameterNames.RIGHT_WHITE_SURFACE]
         if left_gw_mesh is not None:
             left_gw_fus = Object3D.from_fusion(
                 left_gw_mesh, method='Fusion2DMeshMethod')
             left_gw_fus.set_color(gw_color)
             self._temp_object.append(left_gw_fus)
             self._view.add_object(left_gw_fus)
         if right_gw_mesh is not None:
             right_gw_fus = Object3D.from_fusion(
                 right_gw_mesh, method='Fusion2DMeshMethod')
             right_gw_fus.set_color(gw_color)
             self._temp_object.append(right_gw_fus)
             self._view.add_object(right_gw_fus)
Exemplo n.º 3
0
 def update(self):
     self._view.clear()
     left_mask = self._viewport_model.observed_objects[
         IntraAnalysisParameterNames.LEFT_GREY_WHITE]
     right_mask = self._viewport_model.observed_objects[
         IntraAnalysisParameterNames.RIGHT_GREY_WHITE]
     if left_mask is not None and right_mask is not None:
         left_mask.set_color_map(ColorMap.RAINBOW_MASK)
         right_mask.set_color_map(ColorMap.RAINBOW_MASK)
         mask_fusion = Object3D.from_fusion(
             left_mask, right_mask, mode='max_channel', rate=0.5)
         mri = self._viewport_model.observed_objects[
             IntraAnalysisParameterNames.CORRECTED_MRI]
         if mri is not None:
             fusion = Object3D.from_fusion(
                 mri, mask_fusion, mode='linear', rate=0.7)
             self._temp_object = fusion
             self._view.add_object(fusion)
         else:
             self._temp_object = mask_fusion
             self._view.add_object(mask_fusion)
Exemplo n.º 4
0
 def update(self):
     self._view.clear()
     mask = self._viewport_model.observed_objects[IntraAnalysisParameterNames.SPLIT_MASK]
     if mask is not None:
         mask.set_color_map(ColorMap.RAINBOW_MASK)
         mri = self._viewport_model.observed_objects[IntraAnalysisParameterNames.CORRECTED_MRI]
         if mri is not None:
             fusion = Object3D.from_fusion(mri, mask, mode='linear', rate=0.7)
             self._temp_object = fusion
             self._view.add_object(fusion)
         else:
             self._view.add_object(mask)