Esempio n. 1
0
 def _validateInputSize(self, inputParam, inputLabel, mandatory, md, errors):
     """ Validate, if the mask value is non-empty,
     that the mask file exists and have the same 
     dimensions than the input images. 
     """
     inputValue = getattr(self, inputParam, '')
     errMsg = "Param <%s> file should exists" % inputLabel
     if not mandatory:
         errMsg += " if not empty"
         
     if mandatory or inputValue.strip():
         if not xmippExists(inputValue):
             errors.append(errMsg)
         else:
             validateInputSize([inputValue], self.ImgMd, md, errors, inputLabel)
Esempio n. 2
0
    def validate(self):
        errors = []
        
        md = mdFirstRow(self.ImgMd)
        if md.containsLabel(MDL_IMAGE):
            # If using reference check that have same size as images:
            if not self.DoGenerateReferences:
                from protlib_xmipp import validateInputSize
                mdRef = MetaData(self.RefMd)
                references = mdRef.getColumnValues(MDL_IMAGE)
                validateInputSize(references, self.ImgMd, errors)
        else:
            errors.append("Input metadata <%s> doesn't contains image label" % self.ImgMd)

        if self.acquisionInfo is None:
            errors.append("Acquisition info was not found relative to image location")
        if (self.NumberOfThreads > 1  and self.DoMlf):
            errors.append("""WARNING: Threads are not implemented for MLF, 
set number of threads to 1 and consider to  
increment the number of MPI processes """)     
        return errors