예제 #1
0
 def configure(self):
     """
     setup two configurations:
     --> MAX_OFFSET_VALUE 
     --> FILL_VALUE 
     
     """
     EDPluginExec.configure(self)
     if not self.__class__.CONFIGURED:
         with self.__class__._clsLock:
             if not self.__class__.CONFIGURED:
                 self.DEBUG("EDPluginExecShiftImagev1_1.configure")
                 xsPluginItem = self.getConfiguration()
                 if (xsPluginItem == None):
                     self.WARNING(
                         "EDPluginExecShiftImagev1_1.configure: No plugin item defined."
                     )
                     xsPluginItem = XSPluginItem()
                 strFill = EDConfiguration.getStringParamValue(
                     xsPluginItem, self.__class__.FILL_KEY)
                 if (strFill == None):
                     self.WARNING("EDPluginExecShiftImagev1_1.configure: No configuration parameter found for: %s using default value: %s\n%s"\
                                 % (self.FILL_KEY, self.FILL_VALUE, xsPluginItem.marshal()))
                 else:
                     strFill = strFill.strip().lower()
                     if strFill in ["min", "max", "mean"]:
                         self.__class__.FILL_VALUE = strFill
                     else:
                         try:
                             self.__class__.FILL_VALUE = float(strFill)
                         except ValueError, error:
                             self.ERROR(
                                 "unable to convert %s to float: %s" %
                                 (strFill, error))
                 strMaxOffset = EDConfiguration.getStringParamValue(
                     xsPluginItem, self.__class__.MAX_OFFSET_KEY)
                 if (strMaxOffset == None):
                     self.WARNING("EDPluginExecShiftImagev1_1.configure: No configuration parameter found for: %s using default value: %s\n%s"\
                                 % (self.MAX_OFFSET_KEY, self.MAX_OFFSET_VALUE, xsPluginItem.marshal()))
                 else:
                     if strMaxOffset.isdigit():
                         try:
                             self.__class__.MAX_OFFSET_VALUE = int(
                                 strMaxOffset)
                         except ValueError, error:
                             self.ERROR("unable to convert %s to int: %s" %
                                        (strMaxOffset, error))
                     else:
                         self.WARNING("EDPluginExecShiftImagev1_1.configure: No configuration parameter found for: %s using default value: %s\n%s"\
                                 % (self.MAX_OFFSET_KEY, self.MAX_OFFSET_VALUE, xsPluginItem.marshal()))
예제 #2
0
 def configure(self):
     """
     setup two configurations:
     --> MAX_OFFSET_VALUE 
     --> FILL_VALUE 
     
     """
     EDPluginExec.configure(self)
     if not self.__class__.CONFIGURED:
         with self.__class__._clsLock:
             if not self.__class__.CONFIGURED:
                 self.DEBUG("EDPluginExecShiftImagev1_1.configure")
                 xsPluginItem = self.getConfiguration()
                 if xsPluginItem == None:
                     self.WARNING("EDPluginExecShiftImagev1_1.configure: No plugin item defined.")
                     xsPluginItem = XSPluginItem()
                 strFill = EDConfiguration.getStringParamValue(xsPluginItem, self.__class__.FILL_KEY)
                 if strFill == None:
                     self.WARNING(
                         "EDPluginExecShiftImagev1_1.configure: No configuration parameter found for: %s using default value: %s\n%s"
                         % (self.FILL_KEY, self.FILL_VALUE, xsPluginItem.marshal())
                     )
                 else:
                     strFill = strFill.strip().lower()
                     if strFill in ["min", "max", "mean"]:
                         self.__class__.FILL_VALUE = strFill
                     else:
                         try:
                             self.__class__.FILL_VALUE = float(strFill)
                         except ValueError, error:
                             self.ERROR("unable to convert %s to float: %s" % (strFill, error))
                 strMaxOffset = EDConfiguration.getStringParamValue(xsPluginItem, self.__class__.MAX_OFFSET_KEY)
                 if strMaxOffset == None:
                     self.WARNING(
                         "EDPluginExecShiftImagev1_1.configure: No configuration parameter found for: %s using default value: %s\n%s"
                         % (self.MAX_OFFSET_KEY, self.MAX_OFFSET_VALUE, xsPluginItem.marshal())
                     )
                 else:
                     if strMaxOffset.isdigit():
                         try:
                             self.__class__.MAX_OFFSET_VALUE = int(strMaxOffset)
                         except ValueError, error:
                             self.ERROR("unable to convert %s to int: %s" % (strMaxOffset, error))
                     else:
                         self.WARNING(
                             "EDPluginExecShiftImagev1_1.configure: No configuration parameter found for: %s using default value: %s\n%s"
                             % (self.MAX_OFFSET_KEY, self.MAX_OFFSET_VALUE, xsPluginItem.marshal())
                         )
예제 #3
0
 def configure(self):
     """
     Add the dtype to the configuration file, probably "float32" or "float64"
     """
     EDPluginExec.configure(self)
     self.DEBUG("EDPluginExecNormalizeImagev1_1.configure")
     if self.__class__.dtype is None:
         with self.__class__.semaphore:
             xsPluginItem = self.getConfiguration()
             if (xsPluginItem == None):
                 self.WARNING("EDPluginExecNormalizeImagev1_1.configure: No plugin item defined.")
                 xsPluginItem = XSPluginItem()
             strDtype = EDConfiguration.getStringParamValue(xsPluginItem, self.CONF_DTYPE_KEY)
             if(strDtype == None):
                 self.WARNING("EDPluginExecNormalizeImagev1_1.configure: No configuration parameter found for: %s using default value: %s\n%s"\
                             % (self.CONF_DTYPE_KEY, self.CONF_DTYPE_DEFAULT, xsPluginItem.marshal()))
                 self.__class__.dtype = self.CONF_DTYPE_DEFAULT
             else:
                 self.__class__.dtype = str(strDtype.strip().lower())
 def configure(self):
     """
     Configures the plugin from the configuration file with the following parameters
      - The CONVOLUTION method
     """
     EDPluginExec.configure(self)
     if self.CONF_CONVOLUTION is None:
         self.synchronizeOn()
         self.DEBUG("EDPluginExecMeasureOffsetv1_0.configure")
         xsPluginItem = self.getConfiguration()
         if xsPluginItem == None:
             self.WARNING("EDPluginExecMeasureOffsetv1_0.configure: No plugin item defined.")
             xsPluginItem = XSPluginItem()
         strCONVOLUTION = EDConfiguration.getStringParamValue(xsPluginItem, self.CONF_CONVOLUTION_KEY)
         if strCONVOLUTION == None:
             self.WARNING(
                 "EDPluginExecMeasureOffsetv1_0.configure: No configuration parameter found for: %s using default value: %s\n%s"
                 % (self.CONF_CONVOLUTION_KEY, self.CONF_CONVOLUTION_DEFAULT, xsPluginItem.marshal())
             )
             self.CONF_CONVOLUTION = self.CONF_CONVOLUTION_DEFAULT
         else:
             self.CONF_CONVOLUTION = strCONVOLUTION.strip().lower()
         self.synchronizeOff()
예제 #5
0
 def configure(self):
     """
     Configures the plugin from the configuration file with the following parameters
      - The CONVOLUTION method
     """
     EDPluginExec.configure(self)
     if self.CONF_CONVOLUTION is None:
         with self.__class__.__sem:
             self.DEBUG("EDPluginExecMeasureOffsetv1_0.configure")
             xsPluginItem = self.getConfiguration()
             if xsPluginItem is None:
                 self.WARNING(
                     "EDPluginExecMeasureOffsetv1_0.configure: No plugin item defined."
                 )
                 xsPluginItem = XSPluginItem()
             strCONVOLUTION = EDConfiguration.getStringParamValue(
                 xsPluginItem, self.CONF_CONVOLUTION_KEY)
             if strCONVOLUTION is None:
                 self.WARNING("EDPluginExecMeasureOffsetv1_0.configure: No configuration parameter found for: %s using default value: %s\n%s"\
                             % (self.CONF_CONVOLUTION_KEY, self.CONF_CONVOLUTION_DEFAULT, xsPluginItem.marshal()))
                 self.__class__CONF_CONVOLUTION = self.CONF_CONVOLUTION_DEFAULT
             else:
                 self.__class__.CONF_CONVOLUTION = strCONVOLUTION.strip(
                 ).lower()