Ejemplo n.º 1
0
 def test_01_06_get_temp_current_image(self):
     file_name = os.path.join(example_images_directory(), 
                              "ExampleSBSImages", "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     W.set_temp_current_image(ip)
     ip_other = W.get_temp_current_image()
     self.assertEqual(ip.getID(), ip_other.getID())
Ejemplo n.º 2
0
 def test_01_08_get_current_image(self):
     file_name = os.path.join(self.root_dir, "ExampleSBSImages",
                              "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     W.set_current_image(ip)
     ip_out = W.get_current_image()
     self.assertEqual(ip.getID(), ip_out.getID())
Ejemplo n.º 3
0
 def test_01_08_get_current_image(self):
     file_name = os.path.join(self.root_dir, 
                              "ExampleSBSImages", "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     W.set_current_image(ip)
     ip_out = W.get_current_image()
     self.assertEqual(ip.getID(), ip_out.getID())
Ejemplo n.º 4
0
 def test_01_06_get_temp_current_image(self):
     file_name = os.path.join(example_images_directory(),
                              "ExampleSBSImages", "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     W.set_temp_current_image(ip)
     ip_other = W.get_temp_current_image()
     self.assertEqual(ip.getID(), ip_other.getID())
Ejemplo n.º 5
0
 def test_01_02_get_id_list(self):
     file_name = os.path.join(self.root_dir, 
                              "ExampleSBSImages", "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     W.set_current_image(ip)
     id_list = W.get_id_list()
     self.assertTrue(ip.getID() in id_list)
Ejemplo n.º 6
0
 def test_01_03_get_image_by_id(self):
     file_name = os.path.join(self.root_dir, 
                              "ExampleSBSImages", "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     ip.show()
     ip_other = W.get_image_by_id(ip.getID())
     self.assertEqual(ip_other.getID(), ip.getID())
Ejemplo n.º 7
0
 def test_01_02_get_id_list(self):
     file_name = os.path.join(self.root_dir, "ExampleSBSImages",
                              "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     W.set_current_image(ip)
     id_list = W.get_id_list()
     self.assertTrue(ip.getID() in id_list)
Ejemplo n.º 8
0
 def test_01_03_get_image_by_id(self):
     file_name = os.path.join(self.root_dir, "ExampleSBSImages",
                              "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     ip.show()
     ip_other = W.get_image_by_id(ip.getID())
     self.assertEqual(ip_other.getID(), ip.getID())
Ejemplo n.º 9
0
 def test_02_01_show_get_and_hide(self):
     file_name = os.path.join(sbs_dir, "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     ip.show()
     window = ip.getWindow()
     self.assertTrue(J.to_string(window).startswith("Channel1-01-A-01.tif"))
     ip.hide()
Ejemplo n.º 10
0
 def test_01_04_get_image_by_name(self):
     ip = I.load_imageplus(self.file_name)
     title = W.make_unique_name("Whatever")
     ip.setTitle(title)
     self.assertEqual(ip.getTitle(), title)
     ip.show()
     ip_other = W.get_image_by_name(title)
     self.assertEqual(ip_other.getID(), ip.getID())
Ejemplo n.º 11
0
 def test_01_03_lock_and_unlock(self):
     file_name = os.path.join(sbs_dir, "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     self.assertTrue(ip.lockSilently())
     try:
         self.assertFalse(ip.lockSilently())
     finally:
         ip.unlock()
Ejemplo n.º 12
0
 def test_01_04_get_image_by_name(self):
     ip = I.load_imageplus(self.file_name)
     title = W.make_unique_name("Whatever")
     ip.setTitle(title)
     self.assertEqual(ip.getTitle(), title)
     ip.show()
     ip_other = W.get_image_by_name(title)
     self.assertEqual(ip_other.getID(), ip.getID())
Ejemplo n.º 13
0
 def test_01_12_get_dimensions(self):
     file_name = os.path.join(sbs_dir, "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     width, height, nChannels, nSlices, nFrames = ip.getDimensions()
     self.assertEqual(width, ip.getWidth())
     self.assertEqual(height, ip.getHeight())
     self.assertEqual(nChannels, ip.getNChannels())
     self.assertEqual(nSlices, ip.getNSlices())
     self.assertEqual(nFrames, ip.getNFrames())
Ejemplo n.º 14
0
    def test_01_01_get_image(self):
        from cellprofiler.modules.tests import maybe_download_example_image

        folder = "ExampleCometAssay"
        fn = "CometTails.tif"
        file_name = maybe_download_example_image([folder], fn)
        imageplus_obj = I.load_imageplus(file_name)
        pixels = IP.get_image(imageplus_obj.getProcessor())
        pass
 def test_01_04_get_image_by_name(self):
     file_name = os.path.join(example_images_directory(), "ExampleSBSImages", "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     title = W.make_unique_name("Whatever")
     ip.setTitle(title)
     self.assertEqual(ip.getTitle(), title)
     ip.show()
     ip_other = W.get_image_by_name(title)
     self.assertEqual(ip_other.getID(), ip.getID())
Ejemplo n.º 16
0
 def test_01_04_get_image_by_name(self):
     file_name = os.path.join(self.root_dir, "ExampleSBSImages",
                              "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     title = W.make_unique_name("Whatever")
     ip.setTitle(title)
     self.assertEqual(ip.getTitle(), title)
     ip.show()
     ip_other = W.get_image_by_name(title)
     self.assertEqual(ip_other.getID(), ip.getID())
Ejemplo n.º 17
0
 def test_01_12_get_dimensions(self):
     file_name = os.path.join(
             self.root_dir, "ExampleSBSImages", "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     dims = J.get_env().get_int_array_elements(ip.getDimensions())
     width, height, nChannels, nSlices, nFrames = dims
     self.assertEqual(width, ip.getWidth())
     self.assertEqual(height, ip.getHeight())
     self.assertEqual(nChannels, ip.getNChannels())
     self.assertEqual(nSlices, ip.getNSlices())
     self.assertEqual(nFrames, ip.getNFrames())
Ejemplo n.º 18
0
 def test_01_12_get_dimensions(self):
     file_name = os.path.join(self.root_dir, "ExampleSBSImages",
                              "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     dims = J.get_env().get_int_array_elements(ip.getDimensions())
     width, height, nChannels, nSlices, nFrames = dims
     self.assertEqual(width, ip.getWidth())
     self.assertEqual(height, ip.getHeight())
     self.assertEqual(nChannels, ip.getNChannels())
     self.assertEqual(nSlices, ip.getNSlices())
     self.assertEqual(nFrames, ip.getNFrames())
Ejemplo n.º 19
0
 def test_01_09_get_nframes(self):
     file_name = os.path.join(
             self.root_dir, "ExampleSBSImages", "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     self.assertEqual(ip.getNFrames(), 1)
Ejemplo n.º 20
0
 def test_01_07_get_current_slice(self):
     file_name = os.path.join(
             self.root_dir, "ExampleSBSImages", "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     self.assertEqual(ip.getCurrentSlice(), 1)
Ejemplo n.º 21
0
 def test_01_04_get_bit_depth(self):
     file_name = os.path.join(
             self.root_dir, "ExampleSBSImages", "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     self.assertEqual(ip.getBitDepth(), 8)
Ejemplo n.º 22
0
 def test_01_01_load_imageplus(self):
     file_name = os.path.join(
             self.root_dir, "ExampleSBSImages", "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     self.assertTrue(ip.getHeight() > 0)
Ejemplo n.º 23
0
 def test_01_05_set_temp_current_image(self):
     file_name = os.path.join(self.root_dir, 
                              "ExampleSBSImages", "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     W.set_temp_current_image(ip)
Ejemplo n.º 24
0
 def test_01_07_get_current_slice(self):
     file_name = os.path.join(self.root_dir, "ExampleSBSImages",
                              "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     self.assertEqual(ip.getCurrentSlice(), 1)
Ejemplo n.º 25
0
 def test_01_08_get_height(self):
     file_name = os.path.join(self.root_dir, "ExampleSBSImages",
                              "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     target = load_image(file_name)
     self.assertEqual(ip.getHeight(), target.shape[0])
Ejemplo n.º 26
0
 def test_01_04_get_bit_depth(self):
     file_name = os.path.join(self.root_dir, "ExampleSBSImages",
                              "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     self.assertEqual(ip.getBitDepth(), 8)
Ejemplo n.º 27
0
 def test_01_05_get_bytes_per_pixel(self):
     file_name = os.path.join(self.root_dir, "ExampleSBSImages",
                              "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     self.assertEqual(ip.getBytesPerPixel(), 1)
Ejemplo n.º 28
0
 def test_01_02_get_id(self):
     file_name = os.path.join(self.root_dir, "ExampleSBSImages",
                              "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     ip.getID()
Ejemplo n.º 29
0
 def test_01_01_load_imageplus(self):
     file_name = os.path.join(self.root_dir, "ExampleSBSImages",
                              "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     self.assertTrue(J.to_string(ip.o).startswith("imp"))
Ejemplo n.º 30
0
 def test_01_14_get_processor(self):
     file_name = os.path.join(self.root_dir, "ExampleSBSImages",
                              "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     p = ip.getProcessor()
     self.assertTrue(J.to_string(p).startswith("ip"))
Ejemplo n.º 31
0
 def test_01_06_get_channel(self):
     file_name = os.path.join(sbs_dir, "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     self.assertEqual(ip.getChannel(), 1)
Ejemplo n.º 32
0
 def test_01_09_get_nframes(self):
     file_name = os.path.join(self.root_dir, "ExampleSBSImages",
                              "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     self.assertEqual(ip.getNFrames(), 1)
Ejemplo n.º 33
0
 def test_01_01_load_imageplus(self):
     file_name = os.path.join(sbs_dir, "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     self.assertTrue(J.to_string(ip.o).startswith("imp"))
Ejemplo n.º 34
0
 def test_01_01_set_current_image(self):
     file_name = os.path.join(example_images_directory(), 
                              "ExampleSBSImages", "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     W.set_current_image(ip)
Ejemplo n.º 35
0
 def test_01_10_get_nslices(self):
     file_name = os.path.join(sbs_dir, "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     self.assertEqual(ip.getNSlices(), 1)
Ejemplo n.º 36
0
 def test_01_05_set_temp_current_image(self):
     file_name = os.path.join(self.root_dir, "ExampleSBSImages",
                              "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     W.set_temp_current_image(ip)
Ejemplo n.º 37
0
 def test_01_08_get_height(self):
     file_name = os.path.join(sbs_dir, "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     self.assertEqual(ip.getHeight(), 640)
Ejemplo n.º 38
0
 def test_01_01_load_imageplus(self):
     file_name = os.path.join(self.root_dir, "ExampleSBSImages",
                              "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     self.assertTrue(ip.getHeight() > 0)
Ejemplo n.º 39
0
 def test_01_14_get_processor(self):
     file_name = os.path.join(
             self.root_dir, "ExampleSBSImages", "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     p = ip.getProcessor()
     self.assertTrue(J.to_string(p).startswith("ip"))
Ejemplo n.º 40
0
 def test_01_03_get_image_by_id(self):
     ip = I.load_imageplus(self.file_name)
     ip.show()
     ip_other = W.get_image_by_id(ip.getID())
     self.assertEqual(ip_other.getID(), ip.getID())
Ejemplo n.º 41
0
 def test_01_02_get_id(self):
     file_name = os.path.join(
             self.root_dir, "ExampleSBSImages", "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     ip.getID()
Ejemplo n.º 42
0
 def test_01_01_set_current_image(self):
     file_name = os.path.join(example_images_directory(),
                              "ExampleSBSImages", "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     W.set_current_image(ip)
Ejemplo n.º 43
0
 def test_01_05_get_bytes_per_pixel(self):
     file_name = os.path.join(
             self.root_dir, "ExampleSBSImages", "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     self.assertEqual(ip.getBytesPerPixel(), 1)
Ejemplo n.º 44
0
 def test_01_05_set_temp_current_image(self):
     ip = I.load_imageplus(self.file_name)
     W.set_temp_current_image(ip)
Ejemplo n.º 45
0
 def test_01_08_get_height(self):
     file_name = os.path.join(
             self.root_dir, "ExampleSBSImages", "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     target = load_image(file_name)
     self.assertEqual(ip.getHeight(), target.shape[0])
Ejemplo n.º 46
0
 def test_01_06_get_temp_current_image(self):
     ip = I.load_imageplus(self.file_name)
     W.set_temp_current_image(ip)
     ip_other = W.get_temp_current_image()
     self.assertEqual(ip.getID(), ip_other.getID())
Ejemplo n.º 47
0
 def test_01_11_get_n_dimensions(self):
     file_name = os.path.join(
             self.root_dir, "ExampleSBSImages", "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     self.assertEqual(ip.getNDimensions(), 2)
Ejemplo n.º 48
0
 def test_01_08_get_current_image(self):
     ip = I.load_imageplus(self.file_name)
     W.set_current_image(ip)
     ip_out = W.get_current_image()
     self.assertEqual(ip.getID(), ip_out.getID())
Ejemplo n.º 49
0
 def test_01_02_get_id(self):
     file_name = os.path.join(sbs_dir, "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     ip.getID()
Ejemplo n.º 50
0
 def test_01_13_get_channel_processor(self):
     file_name = os.path.join(sbs_dir, "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     p = ip.getChannelProcessor()
     self.assertTrue(J.to_string(p).startswith("ip"))
Ejemplo n.º 51
0
 def test_01_06_get_temp_current_image(self):
     ip = I.load_imageplus(self.file_name)
     W.set_temp_current_image(ip)
     ip_other = W.get_temp_current_image()
     self.assertEqual(ip.getID(), ip_other.getID())
Ejemplo n.º 52
0
 def test_01_11_get_n_dimensions(self):
     file_name = os.path.join(self.root_dir, "ExampleSBSImages",
                              "Channel1-01-A-01.tif")
     ip = I.load_imageplus(file_name)
     self.assertEqual(ip.getNDimensions(), 2)
Ejemplo n.º 53
0
 def test_01_02_get_id_list(self):
     ip = I.load_imageplus(self.file_name)
     W.set_current_image(ip)
     id_list = W.get_id_list()
     self.assertTrue(ip.getID() in id_list)
Ejemplo n.º 54
0
 def test_01_08_get_current_image(self):
     ip = I.load_imageplus(self.file_name)
     W.set_current_image(ip)
     ip_out = W.get_current_image()
     self.assertEqual(ip.getID(), ip_out.getID())