Beispiel #1
0
    def _init_deid(self, deid=None, base=False, default_base="dicom"):
        """initalize the recipe with one or more deids, optionally including 
           the default. This function is called at init time. If you need to add
           or work with already loaded configurations, use add/remove 
    
           Parameters
           ==========
           deid: the deid recipe (or recipes) files to use. If more than one
                 is provided, should be done in order of preference for load
                 (later in the list overrides earlier loaded).
           default_base: load the default base before the user customizations. 

        """
        if deid is None:
            deid = []

        if not isinstance(deid, list):
            deid = [deid]

        if base is True:
            deid.append(default_base)

        self._files = deid

        if len(deid) == 0:
            bot.info("You can add custom deid files with .load().")
        self.deid = load_combined_deid(deid)
Beispiel #2
0
    def load(self, deid):
        """load a deid recipe into the object. If a deid configuration is
           already defined, append to that. 
        """
        deid = get_deid(deid)
        if deid is not None:

            # Update our list of files
            self._files.append(deid)
            self.files = list(set(self.files))

            # Priority here goes to additional deid
            self.deid = load_combined_deid([self.deid, deid])