6ffbbd0ca5e2c07ce1d13a5b517b71c6743ef1db,cellprofiler/modules/tests/test_injectimage.py,testInjectImage,test_01_01_get_from_image_set,#testInjectImage#,33

Before Change


        image_set_list = cellprofiler.cpimage.ImageSetList()
        ii = InjectImage("my_image", image)
        pipeline = cellprofiler.pipeline.Pipeline()
        workspace = cpw.Workspace(pipeline, ii, None, None,
                                  cpmeas.Measurements(), image_set_list)
        ii.prepare_run(workspace)
        ii.prepare_group(workspace, {}, [1])
        image_set = image_set_list.get_image_set(0)
        self.assertTrue(image_set,"No image set returned from ImageSetList.GetImageSet")

After Change


        image = numpy.zeros((10,10),dtype=float)
        ii = InjectImage("my_image", image)
        pipeline = cellprofiler.pipeline.Pipeline()
        measurements = cpmeas.Measurements()
        workspace = cpw.Workspace(pipeline, ii, measurements, None,
                                  measurements,
                                  cellprofiler.cpimage.ImageSetList())
        ii.prepare_run(workspace)
        ii.prepare_group(workspace, {}, [1])
        ii.run(workspace)
        image_set = workspace.image_set
        self.assertTrue(image_set,"No image set returned from ImageSetList.GetImageSet")
        my_image = image_set.get_image("my_image")
        self.assertTrue(my_image, "No image returned from ImageSet.GetImage")
        self.assertEqual(my_image.image.shape[0],10,"Wrong image shape")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: CellProfiler/CellProfiler
Commit Name: 6ffbbd0ca5e2c07ce1d13a5b517b71c6743ef1db
Time: 2012-07-10
Author: leek@broadinstitute.org
File Name: cellprofiler/modules/tests/test_injectimage.py
Class Name: testInjectImage
Method Name: test_01_01_get_from_image_set


Project Name: CellProfiler/CellProfiler
Commit Name: 2721e3537b151e4b1c7c15c025529f958a096913
Time: 2011-05-12
Author: leek@1fc53939-2000-0410-845c-e8453a809027
File Name: cellprofiler/modules/tests/test_measureobjectneighbors.py
Class Name: TestMeasureObjectNeighbors
Method Name: make_workspace


Project Name: CellProfiler/CellProfiler
Commit Name: bd869c38f0d3234b40d1aeaf19d9228aa3dd6aa6
Time: 2011-10-31
Author: leek@1fc53939-2000-0410-845c-e8453a809027
File Name: cellprofiler/modules/tests/test_relateobjects.py
Class Name: TestRelateObjects
Method Name: make_workspace


Project Name: CellProfiler/CellProfiler
Commit Name: ec265cba957ac90863c9651ab324d265c147fb9c
Time: 2011-08-04
Author: leek@1fc53939-2000-0410-845c-e8453a809027
File Name: cellprofiler/modules/tests/test_crop.py
Class Name: TestCrop
Method Name: make_workspace