Exemplo n.º 1
0
 def setUp(self):
     AbstractPlateAnalysisCtx.DEFAULT_ORIGINAL_FILE_PROVIDER = \
         FromFileOriginalFileProvider
     original_files = list()
     # Create our container images and an original file image map
     images = list()
     n_images = 0
     for row in range(16):
         for column in range(24):
             well = WellI(n_images, True)
             well.column = rint(column)
             well.row = rint(row)
             well_sample = WellSampleI(n_images, True)
             well_sample.well = well
             image = ImageI(n_images, True)
             image.addWellSample(well_sample)
             images.append(image)
     original_file_image_map = dict()
     # Our required original file format
     format = rstring('Companion/Flex')
     # Create original file representing the result file
     o = OriginalFileI(1, True)
     o.name = rstring(self.RESULT_FILE)
     o.path = rstring(os.path.join(self.ROOT, self.RESULT_FILE))
     o.mimetype = format
     original_files.append(o)  # [1] = o
     original_file_image_map[1] = images[0]
     sf = TestingServiceFactory()
     self.analysis_ctx = FlexPlateAnalysisCtx(images, original_files,
                                              original_file_image_map, 1,
                                              sf)
Exemplo n.º 2
0
class FlexParseRoiTest(unittest.TestCase):

    ROOT = "/Users/callan/testimages/"

    RESULT_FILE = "An_02_Me01_12132846(2009-06-17_11-56-17).res"

    def setUp(self):
        AbstractPlateAnalysisCtx.DEFAULT_ORIGINAL_FILE_PROVIDER = \
            FromFileOriginalFileProvider
        original_files = list()
        # Create our container images and an original file image map
        images = list()
        n_images = 0
        for row in range(16):
            for column in range(24):
                well = WellI(n_images, True)
                well.column = rint(column)
                well.row = rint(row)
                well_sample = WellSampleI(n_images, True)
                well_sample.well = well
                image = ImageI(n_images, True)
                image.addWellSample(well_sample)
                images.append(image)
        original_file_image_map = dict()
        # Our required original file format
        format = rstring('Companion/Flex')
        # Create original file representing the result file
        o = OriginalFileI(1, True)
        o.name = rstring(self.RESULT_FILE)
        o.path = rstring(os.path.join(self.ROOT, self.RESULT_FILE))
        o.mimetype = format
        original_files.append(o)  # [1] = o
        original_file_image_map[1] = images[0]
        sf = TestingServiceFactory()
        self.analysis_ctx = FlexPlateAnalysisCtx(images, original_files,
                                                 original_file_image_map, 1,
                                                 sf)

    def test_get_measurement_ctx(self):
        ctx = self.analysis_ctx.get_measurement_ctx(0)
        self.assertNotEqual(None, ctx)

    def test_get_columns(self):
        ctx = self.analysis_ctx.get_measurement_ctx(0)
        columns = ctx.parse()
        self.assertNotEqual(None, columns)
        self.assertEqual(50, len(columns))
        for column in columns:
            self.assertEqual(384, len(column.values))
class FlexParseRoiTest(unittest.TestCase):

    ROOT = "/Users/callan/testimages/"

    RESULT_FILE = "An_02_Me01_12132846(2009-06-17_11-56-17).res"

    def setUp(self):
        AbstractPlateAnalysisCtx.DEFAULT_ORIGINAL_FILE_PROVIDER = \
            FromFileOriginalFileProvider
        original_files = list()
        # Create our container images and an original file image map
        images = list()
        n_images = 0
        for row in range(16):
            for column in range(24):
                well = WellI(n_images, True)
                well.column = rint(column)
                well.row = rint(row)
                well_sample = WellSampleI(n_images, True)
                well_sample.well = well
                image = ImageI(n_images, True)
                image.addWellSample(well_sample)
                images.append(image)
        original_file_image_map = dict()
        # Our required original file format
        format = rstring('Companion/Flex')
        # Create original file representing the result file
        o = OriginalFileI(1L, True)
        o.name = rstring(self.RESULT_FILE)
        o.path = rstring(os.path.join(self.ROOT, self.RESULT_FILE))
        o.mimetype = format
        original_files.append(o)  # [1L] = o
        original_file_image_map[1L] = images[0]
        sf = TestingServiceFactory()
        self.analysis_ctx = FlexPlateAnalysisCtx(
            images, original_files, original_file_image_map, 1L, sf)

    def test_get_measurement_ctx(self):
        ctx = self.analysis_ctx.get_measurement_ctx(0)
        self.assertNotEqual(None, ctx)

    def test_get_columns(self):
        ctx = self.analysis_ctx.get_measurement_ctx(0)
        columns = ctx.parse()
        self.assertNotEqual(None, columns)
        self.assertEqual(50, len(columns))
        for column in columns:
            self.assertEqual(384, len(column.values))
 def setUp(self):
     AbstractPlateAnalysisCtx.DEFAULT_ORIGINAL_FILE_PROVIDER = \
         FromFileOriginalFileProvider
     original_files = list()
     # Create our container images and an original file image map
     images = list()
     n_images = 0
     for row in range(16):
         for column in range(24):
             well = WellI(n_images, True)
             well.column = rint(column)
             well.row = rint(row)
             well_sample = WellSampleI(n_images, True)
             well_sample.well = well
             image = ImageI(n_images, True)
             image.addWellSample(well_sample)
             images.append(image)
     original_file_image_map = dict()
     # Our required original file format
     format = rstring('Companion/Flex')
     # Create original file representing the result file
     o = OriginalFileI(1L, True)
     o.name = rstring(self.RESULT_FILE)
     o.path = rstring(os.path.join(self.ROOT, self.RESULT_FILE))
     o.mimetype = format
     original_files.append(o)  # [1L] = o
     original_file_image_map[1L] = images[0]
     sf = TestingServiceFactory()
     self.analysis_ctx = FlexPlateAnalysisCtx(
         images, original_files, original_file_image_map, 1L, sf)