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