def test_axis_ording_cvdb_channels(self): data_xyz = array( "bossdb://wildenberg2021/VTA_dat12a_saline_control_Dendrites_6nm_aligned/image", axis_order="XYZ", ) data_zyx = array( "bossdb://wildenberg2021/VTA_dat12a_saline_control_Dendrites_6nm_aligned/image", axis_order="ZYX", ) self.assertTupleEqual( data_xyz.shape, (data_zyx.shape[2], data_zyx.shape[1], data_zyx.shape[0]))
def test_get_data_cvdb_channels(self): data_boss = array( "bossdb://wildenberg2021/VTA_dat12a_saline_control_Dendrites_6nm_aligned/image", volume_provider=_BossDBVolumeProvider(), ) data_cv = array( "bossdb://wildenberg2021/VTA_dat12a_saline_control_Dendrites_6nm_aligned/image", ) excerpt_boss = data_boss[40:50, 40:50, 40:50] excerpt_cv = data_cv[40:50, 40:50, 40:50] self.assertTrue(np.array_equal(excerpt_boss, excerpt_cv))
def test_get_data_cvdb_channels_rollaxes(self): data_xyz = array( "bossdb://wildenberg2021/VTA_dat12a_saline_control_Dendrites_6nm_aligned/image", axis_order="XYZ", ) data_zyx = array( "bossdb://wildenberg2021/VTA_dat12a_saline_control_Dendrites_6nm_aligned/image", axis_order="ZYX", ) excerpt_xyz = data_xyz[40:50, 40:50, 40:50] excerpt_zyx = data_zyx[40:50, 40:50, 40:50] self.assertTrue( np.array_equal(excerpt_xyz, np.rollaxis(excerpt_zyx, 0, 2)))
def test_array_instantiation_with_channel(self): """ Array can be instantiated. . """ boss = BossRemote(_DEFAULT_BOSS_OPTIONS) _ = array(boss.get_channel("cc", "kasthuri2015", "em"))
def test_array_instantiation_dtype(self): """ Array can be instantiated with type. . """ boss = BossRemote(_DEFAULT_BOSS_OPTIONS) test_array = array(boss.get_channel("cc", "kasthuri2015", "em")) self.assertEqual(test_array.dtype, "uint8")
def test_can_retrieve_correct_u64_data(self): data = array("bossdb://kasthuri2015/em/3cylneuron_v1") boss = BossRemote(_DEFAULT_BOSS_OPTIONS) get_cutout_data = boss.get_cutout( boss.get_channel("3cylneuron_v1", "kasthuri2015", "em"), 0, [6000, 6200], [12000, 12500], [923, 924], ) self.assertTrue( (get_cutout_data == data[923:924, 12000:12500, 6000:6200]).all() )
def test_get_remote_type(self): data = array("bossdb://kasthuri2015/em/3cylneuron_v1") self.assertEqual(data.remote, "BossDB")
def test_can_guess_cvdb_channels(self): data = array( "bossdb://wildenberg2021/VTA_dat12a_saline_control_Dendrites_6nm_aligned/image" ) self.assertEqual(data.remote, "CloudVolumeOpenData")
def test_precompute_inference_cvdb(self): data = array( "precomputed://s3://bossdb-open-data/wildenberg2021/VTA_dat12a_saline_control_Dendrites_6nm_aligned/image" ) self.assertEqual(data.remote, "CloudVolumeOpenData")
def test_can_retrieve_data_with_XYZ_order_of_correct_shape(self): data = array("bossdb://Kasthuri/em/images", resolution=1, axis_order="XYZ") array_cutout = data[10000:10012, 10000:10011, 1000:1010] self.assertEqual(array_cutout.shape, (12, 11, 10))
def test_can_retrieve_data_of_correct_shape(self): data = array("bossdb://Kasthuri/em/images", resolution=1) array_cutout = data[1000:1010, 10000:10011, 10000:10012] self.assertEqual(array_cutout.shape, (10, 11, 12))
def test_can_get_shape_of_array_with_resolution(self): res = 1 data = array("bossdb://Kasthuri/em/images", resolution=res) self.assertEqual(data.shape, (1850, 26624 / (2 ** res), 21504 / (2 ** res)))
def test_can_get_shape_of_array(self): data = array("bossdb://Kasthuri/em/images") self.assertEqual(data.shape, (1850, 26624, 21504))
def test_can_initialize_array_without_checks(self): array("bossdb://Kasthuri/em/images")
def __init__(self, cloud_path): _check_intern_importable() self._data = array(cloud_path)