def preProcess(self): """ Scans the command line. """ EDVerbose.DEBUG("EDTestLauncher.preProcess") edCommandLine = EDCommandLine(sys.argv) EDVerbose.log(self.getEdCommandLine().getCommandLine()) self.processCommandLineDebugVerboseLogFile() bContinue = True strTestName = edCommandLine.getArgument(EDTestLauncher.TEST_LABEL) EDVerbose.DEBUG("EDTestLauncher.preProcess: test name = %r" % strTestName) if (strTestName is None): EDVerbose.screen("ERROR - no --test argument found") bContinue = False else: self.__edTestCase = EDUtilsTest.getFactoryPluginTest().loadPlugin(strTestName) if (bContinue): # Determine the base directory if(self.getBaseDir() is None): self.processCommandLineBaseDirectory() # Create the application working directory strApplicationInstanceName = strTestName + "_" + time.strftime("%Y%m%d-%H%M%S", time.localtime()) if(self.getWorkingDir() is None): self.setWorkingDir(strApplicationInstanceName) self.createApplicationWorkingDirectory() # Set the name of the log file EDVerbose.setLogFileName(os.path.join(self.getBaseDir(), strApplicationInstanceName + ".log")) # The check for --quiet and --DEBUG should ideally be placed elsewhere, # for example in EDApplication. if (edCommandLine.existCommand(EDTestLauncher.QUIET_LABEL)): EDVerbose.setVerboseOff() EDVerbose.setTestOff() if (edCommandLine.existCommand(EDApplication.DEBUG_PARAM_LABEL_1) or \ edCommandLine.existCommand(EDApplication.DEBUG_PARAM_LABEL_2)): EDVerbose.setVerboseDebugOn() EDVerbose.DEBUG("EDTestLauncher.preProcess: Debug mode")
################################################################################ # AutoBuilder for Numpy, PIL and Fabio ################################################################################ architecture = EDUtilsPlatform.architecture fabioPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries", "FabIO-0.0.7", architecture) imagingPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries", "20091115-PIL-1.1.7", architecture) numpyPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries", "20090405-Numpy-1.3", architecture) Image = EDFactoryPluginStatic.preImport("Image", imagingPath) numpy = EDFactoryPluginStatic.preImport("numpy", numpyPath) fabio = EDFactoryPluginStatic.preImport("fabio", fabioPath) EDVerbose.setTestOff() class EDPluginControlAlignStackv1_0(EDPluginControl): """ This control plugin aligns a stack on images in a single HDF5 3D-structure """ __iRefFrame = None __dictRelShift = { } #key=frame number N, value= 2-tuple of shift relative to frame N-1 __dictAbsShift = { } #key=frame number N, value= 2-tuple of shift relative to frame iRefFrame __semaphore = Semaphore() MaxOffset = None def __init__(self):
EDFactoryPluginStatic.loadModule("EDPluginHDF5StackImagesv10") from EDPluginHDF5 import EDPluginHDF5 ################################################################################ # AutoBuilder for Numpy, PIL and Fabio ################################################################################ architecture = EDUtilsPlatform.architecture fabioPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries", "FabIO-0.0.7", architecture) imagingPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries", "20091115-PIL-1.1.7", architecture) numpyPath = os.path.join(EDUtilsPath.EDNA_HOME, "libraries", "20090405-Numpy-1.3", architecture) Image = EDFactoryPluginStatic.preImport("Image", imagingPath) numpy = EDFactoryPluginStatic.preImport("numpy", numpyPath) fabio = EDFactoryPluginStatic.preImport("fabio", fabioPath) EDVerbose.setTestOff() class EDPluginControlAlignStackv1_0(EDPluginControl): """ This control plugin aligns a stack on images in a single HDF5 3D-structure """ __iRefFrame = None __dictRelShift = {}#key=frame number N, value= 2-tuple of shift relative to frame N-1 __dictAbsShift = {}#key=frame number N, value= 2-tuple of shift relative to frame iRefFrame __semaphore = Semaphore() MaxOffset = None def __init__(self): """ """