Ejemplo n.º 1
0
 def test_get_temporary_name(self):
     '''test_get_temporary_name will test the generation of a temporary 
        file name.
     '''
     from deid.utils import get_temporary_name
     print("Testing utils.get_temporary_name...")
     tmpname = get_temporary_name()
     self.assertTrue(not os.path.exists(tmpname))
     self.assertTrue('deid' in tmpname)
     tmpname = get_temporary_name(prefix='clean')
     self.assertTrue('deid-clean' in tmpname)
     tmpname = get_temporary_name(ext='.dcm')
     self.assertTrue(tmpname.endswith('.dcm'))
Ejemplo n.º 2
0
    def test_get_temporary_name(self):
        """test_get_temporary_name will test the generation of a temporary 
           file name.
        """
        from deid.utils import get_temporary_name

        print("Testing utils.get_temporary_name...")
        tmpname = get_temporary_name()
        self.assertTrue(not os.path.exists(tmpname))
        self.assertTrue("deid" in tmpname)
        tmpname = get_temporary_name(prefix="clean")
        self.assertTrue("deid-clean" in tmpname)
        tmpname = get_temporary_name(ext=".dcm")
        self.assertTrue(tmpname.endswith(".dcm"))
Ejemplo n.º 3
0
    def __init__(self,
                 output_folder=None,
                 add_padding=False,
                 margin=3,
                 deid=None,
                 font=None,
                 force=True):

        if output_folder is None:
            output_folder = get_temporary_name(prefix="clean")

        if font is None:
            font = self.default_font()
        self.font = font
        self.cmap = 'gray'
        self.output_folder = output_folder
        self.recipe = DeidRecipe(deid)
        self.results = None
        self.force = force