def setupProtocol(self): 
        if self.regProtocol:
            # FIXME: if a regProtocol is specified, it must currently specify ALL
            # registration options as the defaults are not used in this case.
            # It might make sense just to set default params anyway before doing this
            #
            # For now, we will only set the memoryRequired by default. This will 
            # maintain backwards compatibility with older versions, because 
            # original non linear protocols can still be used:
            # (this definitely still is a FIXME :-))
            self.memoryRequired = [0.177, 1.385e-7, 2.1e-7]
            try:
                self.setParams()
            except:
                try:
                    self.blurs = self.regProtocol.blurs
                    self.gradient = self.regProtocol.gradient
                    self.similarityMetric = self.regProtocol.similarityMetric
                    self.weight = self.regProtocol.weight
                    self.radiusHisto = self.regProtocol.radiusHisto
                    self.transformationModel = self.regProtocol.transformationModel
                    self.regularization = self.regProtocol.regularization
                    self.iterations = self.regProtocol.iterations
                    self.useMask = self.regProtocol.useMask
                    self.memoryRequired = self.regProtocol.memoryRequired
                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()
        self.generations = self.getGenerations()
dataset/ETHPy150Open Mouse-Imaging-Centre/pydpiper/atoms_and_modules/minc_parameters.py/setMincANTSParams.setupProtocol/original