
from dv3dPlaneWidgets import *

def initial_planes_setup(the_parent_frame):
        data_vol = the_parent_frame.my_loaded_volumes[0][0].volume_data.GetOutput()
        
        x,y,z = the_parent_frame.my_loaded_volumes[0][0].x_slice_pos, \
                the_parent_frame.my_loaded_volumes[0][0].y_slice_pos, \
                the_parent_frame.my_loaded_volumes[0][0].z_slice_pos
        
        slice_pos = [x,y,z]
        labels = ['Sagittal plane','Coronal plane','Axial plane']
        
        for i in range(3):
            planeWidgetX = create_new_planewidget(the_parent_frame.widget,                              \
                                                data_vol,                                   \
                                                slice_pos[i],   \
                                                i,the_parent_frame.picker,0)
            # hard coded for now - TODO - load dynamically
            planeWidgetX.SetWindowLevel(4000,8000)
            #planeWidgetX.On()
            AddVTKObjectWithAttributes(planeWidgetX,\
                                the_parent_frame,\
                                'base_imageplane',\
                                labels[i],\
                                'Base volume',\
                                1,\
                                -1,\
                                -1,\
                                'structural',\
                                data_vol,\
                                0,\
                                None,\
                                None)

        #create a property frame for the object
        
        #
        
        
        self.planeWidget1 = planewidget_group(planeWidgetX,planeWidgetY,planeWidgetZ)
        AddVTKObjectWithAttributes(planeWidgetY,\
                                self,\
                                'base_imageplanegroup',\
                                'Base volume',\
                                None,\
                                1,\
                                -1,\
                                -1,\
                                'structural',\
                                base_vol,\
                                1,\
                                None,\
                                None)
