def StartFiltering(self, event): # When Filter is pressed, get the algorithm details. self.algorithm.SetInputFileName( self.inputFileNameEntry.GetValue() ) self.algorithm.SetOutputFileName( self.outputFileNameEntry.GetValue() ) self.algorithm.SetInputImageStack(self.inputImageStack) self.algorithm.SetOutputImageStack(self.outputImageStack) if self.inputImageStack or self.outputImageStack: self.algorithm.SetStartIndex( eval( self.startIndexEntry.GetValue() ) ) self.algorithm.SetEndIndex( eval( self.endIndexEntry.GetValue() ) ) self.algorithm.SetIncrementIndex( eval( self.incrementIndexEntry.GetValue() ) ) for num in range(self.algorithm.numberParameters): if not self.parameterEntries[num].GetValue(): print "Please enter all the parameters" return else: self.algorithm.AssignParameter( self.keys[num], self.parameterEntries[num].GetValue() ) self.algorithm.CheckParameterValidity() # Not implemented currently self.filterButton.Enable(False) xmlObject = FilterObjectXML.FilterObjectXML() XMLFileName = "parameters.xml" # XXX To be generalized xmlObject.UpdateDocument(self.algorithm, XMLFileName) ExecuteAlgorithmModule.defaultAlgorithmExecution(XMLFileName) self.filterButton.Enable(True)
def StartFiltering( self, event): # When Filter is pressed, get the algorithm details. self.algorithm.SetInputFileName(self.inputFileNameEntry.GetValue()) self.algorithm.SetOutputFileName(self.outputFileNameEntry.GetValue()) self.algorithm.SetInputImageStack(self.inputImageStack) self.algorithm.SetOutputImageStack(self.outputImageStack) if self.inputImageStack or self.outputImageStack: self.algorithm.SetStartIndex(eval(self.startIndexEntry.GetValue())) self.algorithm.SetEndIndex(eval(self.endIndexEntry.GetValue())) self.algorithm.SetIncrementIndex( eval(self.incrementIndexEntry.GetValue())) for num in range(self.algorithm.numberParameters): if not self.parameterEntries[num].GetValue(): print "Please enter all the parameters" return else: self.algorithm.AssignParameter( self.keys[num], self.parameterEntries[num].GetValue()) self.algorithm.CheckParameterValidity() # Not implemented currently self.filterButton.Enable(False) xmlObject = FilterObjectXML.FilterObjectXML() XMLFileName = "parameters.xml" # XXX To be generalized xmlObject.UpdateDocument(self.algorithm, XMLFileName) ExecuteAlgorithmModule.defaultAlgorithmExecution(XMLFileName) self.filterButton.Enable(True)
def main(argv = None): global XMLFileName global algorithmXMLObject if argv is None: argv = sys.argv if len(argv) < 1 or len(argv) > 4: usage() if len(argv) == 1: listOfAlgorithms = algorithmXMLObject.GetListOfAlgorithms() choiceOfAlgorithm = ListOfAlgorithmsWithURL.DisplayList(listOfAlgorithms) GetAlgorithmDetails(choiceOfAlgorithm, argv) else: if basic.CheckFileExtension(argv[1], ".xml"): # If XML file is passed as input. XMLFileName = argv[1] ExecuteAlgorithmModule.defaultAlgorithmExecution(XMLFileName) else: choiceOfAlgorithm = argv[1] GetAlgorithmDetails(choiceOfAlgorithm, argv) raw_input("Press a key to exit")
def main(argv=None): global XMLFileName global algorithmXMLObject if argv is None: argv = sys.argv if len(argv) < 1 or len(argv) > 4: usage() if len(argv) == 1: listOfAlgorithms = algorithmXMLObject.GetListOfAlgorithms() choiceOfAlgorithm = ListOfAlgorithmsWithURL.DisplayList( listOfAlgorithms) GetAlgorithmDetails(choiceOfAlgorithm, argv) else: if basic.CheckFileExtension(argv[1], ".xml"): # If XML file is passed as input. XMLFileName = argv[1] ExecuteAlgorithmModule.defaultAlgorithmExecution(XMLFileName) else: choiceOfAlgorithm = argv[1] GetAlgorithmDetails(choiceOfAlgorithm, argv) raw_input("Press a key to exit")