def dropEvent(self, event):
     for url in event.mimeData().urls():
         path = url.toLocalFile().toLocal8Bit().data()
         if self.dataModel:
             self.dataModel.loadFromPath(path, prefetchSize = self.N_PREFETCH)
         else:
             self.setModel(DataModel.fromPath(path, prefetchSize = self.N_PREFETCH))
    def openFile(self,e):
        path = QtGui.QFileDialog.getOpenFileName(self, 'Open Tif File',
                                                     '.', selectedFilter='*.tif')

        
        path = str(path)
        print path
        if path:
            if self.glWidget.dataModel:
                self.glWidget.dataModel.loadFromPath(path,
                    prefetchSize = self.glWidget.N_PREFETCH)
            else:
                self.glWidget.setModel(DataModel.fromPath(path,
                    prefetchSize = self.glWidget.N_PREFETCH))
    def setModel(self,dataModel):
        self.glSliceWidget.setModel(dataModel)

    def wheelEvent(self, event):
        self.sliderSlice.wheelEvent(event)


if __name__ == '__main__':
    from data_model import DataModel, DemoData, SpimData

    app = QtGui.QApplication(sys.argv)

    # win = GLSliceWidget(size=QtCore.QSize(500,500))

    win = SliceWidget(size=QtCore.QSize(500,500))

    win.setModel(DataModel.fromPath("/Users/mweigert/Data/droso_test.tif",prefetchSize = 0))

    win.glSliceWidget.transform.setStackUnits(1.,1.,5.)


    # win.transform.setBox()
    # win.transform.setPerspective(True)

    win.show()

    win.raise_()

    sys.exit(app.exec_())