def fullReconstruction(self): from xicam.Tomography.widgets.volumeviewer import VolumeViewer volumeviewer = VolumeViewer() self.recontabs.addTab(volumeviewer, '????') currentitem = self.headermodel.item(self.rawtabview.currentIndex()) if not currentitem: msg.showMessage('Error: You must open files before reconstructing.') try: msg.showBusy() msg.showMessage('Running slice reconstruction...', level=msg.INFO) currentheader = self.headermodel.item(self.rawtabview.currentIndex()).header readprocess = self.workflow.processes[0] # hopefully! TODO: require a readprocess first readprocess.path.value = currentheader.startdoc['path'] numofsinograms = currentheader.meta_array('primary').shape[1] executor = DaskExecutor() client = distributed.Client() def chunkiterator(workflow): for i in range(0, int(numofsinograms), int(readprocess.chunksize.value)): readprocess.sinoindex.value = i yield executor.execute(workflow) _reconthread = QThreadFutureIterator(chunkiterator, self.workflow, callback_slot=partial(self.showReconstruction, mode=self.fullrecon), except_slot=self.exceptionCallback) _reconthread.start() except Exception as ex: msg.logError(ex) msg.showReady() msg.clearMessage()
def fullReconstruction(self): from .widgets.volumeviewer import VolumeViewer volumeviewer = VolumeViewer() self.recontabs.addTab(volumeviewer, '????') currentitem = self.headermodel.item(self.rawtabview.currentIndex()) if not currentitem: msg.showMessage( 'Error: You must open files before reconstructing.') try: msg.showBusy() msg.showMessage('Running slice reconstruction...', level=msg.INFO) currentheader = self.headermodel.item( self.rawtabview.currentIndex()).header readprocess = self.workflow.processes[ 0] # hopefully! TODO: require a readprocess first readprocess.path.value = currentheader.startdoc['path'] numofsinograms = currentheader.meta_array('primary').shape[1] self.workflow.execute_all(None, readprocess=range( 0, int(numofsinograms), int(readprocess.chunksize.value))) except Exception as ex: msg.logError(ex) msg.showReady() msg.clearMessage()
def sliceReconstruct(self): currentitem = self.headermodel.item(self.rawtabview.currentIndex()) if not currentitem: msg.showMessage('Error: You must open files before reconstructing.') try: msg.showBusy() msg.showMessage('Running slice reconstruction...', level=msg.INFO) paths = self.headermodel.item(self.rawtabview.currentIndex()).header.startdoc['paths'] self.workflow.execute(None, paths=paths, threadkey='slicereconstruct', callback_slot=partial(self.showReconstruction, mode=self.slice), except_slot=self.exceptionCallback) except Exception as ex: msg.logError(ex) msg.showReady() msg.clearMessage()