viz_utils/eoas_viz_3d.py
def plot_surface_np(self, ctr_np, title='', file_name=''):
        """
        Makes a 3D surface using Ploty from a 3D Volume. It expects a binary mask
        :param ctr_np:
        :param title:
        :param file_name:
        :return:
        """
        # Computes marching cubes to obtain a mesh
        print('\tMarching cubes...')
        vertices, simplices, normals, values = measure.marching_cubes_lewiner(ctr_np,.8)
        print('\tDone!')

        print('\t3D Surface...')
        x, y, z = zip(*vertices)
        camera = dict(up=dict(x=1, y=0, z=0),
                      center=dict(x=0, y=0, z=0),
                      eye=dict(x=2, y=2, z=0.1))

        fig = ff.create_trisurf(x=y,
                                y=z,
                                z=x,
                                plot_edges=True,
                                color_func=None,
                                gridcolor='rgb(0,0,0)',
                                simplices=simplices,
                                show_colorbar=False,
                                title=title)

        fig['layout'].update(
            scene=dict(camera=camera),
            title=title)

        plotly.offline.plot(fig, filename=join(self.output_folder,self._check_file_name(file_name)), auto_open=self.open_browser)

        Makes a 3D surface using Ploty from a 3D Volume. It expects a binary mask
        :param ctr_np:
        :param title:
        :param file_name:
        :return:
        
Makes a 3D surface using Ploty from a 3D Volume. It expects a binary mask
Makes a 3D surface using Ploty from a 3D Volume . It expects a binary mask
def plot_surface_np(self, ctr_np, title='', file_name=''):
        print('\tMarching cubes...')
        vertices, simplices, normals, values = measure.marching_cubes_lewiner(ctr_np,.8)
        print('\tDone!')
        print('\t3D Surface...')
        x, y, z = zip(*vertices)
        camera = dict(up=dict(x=1, y=0, z=0),
                      center=dict(x=0, y=0, z=0),
                      eye=dict(x=2, y=2, z=0.1))
        fig = ff.create_trisurf(x=y,
                                y=z,
                                z=x,
                                plot_edges=True,
                                color_func=None,
                                gridcolor='rgb(0,0,0)',
                                simplices=simplices,
                                show_colorbar=False,
                                title=title)
        fig['layout'].update(
            scene=dict(camera=camera),
            title=title)
        plotly.offline.plot(fig, filename=join(self.output_folder,self._check_file_name(file_name)), auto_open=self.open_browser)
def plot_surface_np ( self , ctr_np , title = '' , file_name = '' ) : print ( '\tMarching cubes...' ) vertices , simplices , normals , values = measure . marching_cubes_lewiner ( ctr_np , .8 ) print ( '\tDone!' ) print ( '\t3D Surface...' ) x , y , z = zip ( * vertices ) camera = dict ( up = dict ( x = 1 , y = 0 , z = 0 ) , center = dict ( x = 0 , y = 0 , z = 0 ) , eye = dict ( x = 2 , y = 2 , z = 0.1 ) ) fig = ff . create_trisurf ( x = y , y = z , z = x , plot_edges = True , color_func = None , gridcolor = 'rgb(0,0,0)' , simplices = simplices , show_colorbar = False , title = title ) fig [ 'layout' ] . update ( scene = dict ( camera = camera ) , title = title ) plotly . offline . plot ( fig , filename = join ( self . output_folder , self . _check_file_name ( file_name ) ) , auto_open = self . open_browser )
Makes a 3D surface using Ploty from a 3D Volume.
Makes a 3D surface using Ploty from a 3D Volume .
"""
        Makes a 3D surface using Ploty from a 3D Volume. It expects a binary mask
        :param ctr_np:
        :param title:
        :param file_name:
        :return:
        """ # Computes marching cubes to obtain a mesh
None
self
ctr_np
None
title
None
file_name
None