Пример #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())
Пример #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())
Пример #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())
Пример #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())
Пример #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)
Пример #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())
Пример #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)
Пример #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())
Пример #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()
Пример #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())
Пример #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()
 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())
Пример #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())
Пример #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())
Пример #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())
Пример #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())
Пример #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())
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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])
Пример #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)
Пример #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)
Пример #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()
Пример #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"))
Пример #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"))
Пример #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)
Пример #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)
Пример #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"))
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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)
Пример #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"))
Пример #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())
Пример #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()
Пример #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)
Пример #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)
Пример #44
0
 def test_01_05_set_temp_current_image(self):
     ip = I.load_imageplus(self.file_name)
     W.set_temp_current_image(ip)
Пример #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])
Пример #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())
Пример #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)
Пример #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())
Пример #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()
Пример #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"))
 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())
Пример #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)
Пример #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)
 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())