def setupProtocol(self):
        #If a registration protocol exists, use it to setup parameters. Assume it is a csv. If this fails,
        #the except clause assumes it is an object of type(self). 
        if self.regProtocol:
            try:
                self.setParams()
            except:
                try:
                    self.blurs = self.regProtocol.blurs
                    self.stepSize = self.regProtocol.stepSize
                    self.iterations = self.regProtocol.iterations
                    self.simplex = self.regProtocol.simplex
                    self.useGradient = self.regProtocol.useGradient
                    self.optimization = self.regProtocol.optimization
                    self.w_translations = self.regProtocol.w_translations
                    self.similarity = self.regProtocol.similarity
                    self.weight = self.regProtocol.weight
                    self.stiffness = self.regProtocol.stiffness
                except:
                    print("The non-linear protocol you have specified is in an unrecognized form: \n%s\n Exiting..." % self.regProtocol)
                    sys.exit()
        else:
            if self.fileRes:
                self.defaultParams()
            else:
                print("Unable to set default registration parameters due to lack of file resolution.")
                print("Try specifying a non-linear protocol, or investigate why this is happening.")
                sys.exit()
dataset/ETHPy150Open Mouse-Imaging-Centre/pydpiper/atoms_and_modules/minc_parameters.py/setNlinMinctraccParams.setupProtocol/original