How to use the ndlib.ndtype.IMAGE function in ndlib

To help you get started, we’ve selected a few ndlib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github neurodata / ndstore / test / test_probability.py View on Github external
# 1 - test_npz
# 2 - test_npz_incorrect_region
# 3 - test_npz_incorrect_datatype
# 4 - test_hdf5
# 5 - test_hdf5_incorrect_region
# 6 - test_hdf5_incorrect_datatype
# 7 - test_npz_incorrect_channel
# 8 - test_hdf5_incorrect_channel


p = Params()
p.token = 'unittest'
p.resolution = 0
p.channels = ['CHAN1', 'CHAN2']
p.window = [0,500]
p.channel_type = IMAGE
p.datatype = FLOAT32
#p.args = (3000,3100,4000,4100,500,510)


class Test_Probability_Slice:

  def setup_class(self):

    makeunitdb.createTestDB(p.token, channel_list=p.channels, channel_type=p.channel_type, channel_datatype=p.datatype)

  def teardown_class(self):
    makeunitdb.deleteTestDB(p.token)

  def test_xy (self):
    """Test the xy slice cutout"""
github neurodata / ndstore / test / test_blosc.py View on Github external
import makeunitdb
from ndlib.ndtype import IMAGE, UINT8, UINT16
from params import Params
from postmethods import postNPZ, getNPZ, getHDF5, postHDF5, getURL, postBlosc, getBlosc
from test_settings import *

# Test_Blosc
# 1 - test_get_blosc
# 2 - test_post_blosc

p = Params()
p.token = 'unittest'
p.resolution = 0
p.channels = ['IMAGE1', 'IMAGE2']
p.window = [0,500]
p.channel_type = IMAGE
p.datatype = UINT8
p.voxel = [4.0,4.0,3.0]

class Test_Blosc:

  def setup_class(self):

    makeunitdb.createTestDB(p.token, channel_list=p.channels, channel_type=p.channel_type, channel_datatype=p.datatype)

  def teardown_class(self):
    makeunitdb.deleteTestDB(p.token)


  def test_get_blosc (self):
    """Test the xy slice cutout"""
github neurodata / ndstore / test / test_raw.py View on Github external
import numpy as np
import makeunitdb
from ndlib.ndtype import IMAGE, UINT8, UINT16
from params import Params
from postmethods import postNPZ, getRAW
from test_settings import *

# Test_RAW
# 1 - test_get_raw

p = Params()
p.token = 'unittest'
p.resolution = 0
p.channels = ['IMAGE1', 'IMAGE2']
p.window = [0,500]
p.channel_type = IMAGE
p.datatype = UINT8
p.voxel = [4.0,4.0,3.0]


class Test_Raw:

  def setup_class(self):

    makeunitdb.createTestDB(p.token, channel_list=p.channels, channel_type=p.channel_type, channel_datatype=p.datatype)

  def teardown_class(self):
    makeunitdb.deleteTestDB(p.token)


  def test_get_raw (self):
    """Test the xyz cube cutout"""
github neurodata / ndstore / test / test_image.py View on Github external
# 1 - test_npz
# 2 - test_npz_incorrect_region
# 3 - test_npz_incorrect_datatype
# 4 - test_hdf5
# 5 - test_hdf5_incorrect_region
# 6 - test_hdf5_incorrect_datatype
# 7 - test_npz_incorrect_channel
# 8 - test_hdf5_incorrect_channel


p = Params()
p.token = 'unittest'
p.resolution = 0
p.channels = ['IMAGE1', 'IMAGE2']
p.window = [0,500]
p.channel_type = IMAGE
p.datatype = UINT8
p.voxel = [4.0,4.0,3.0]
#p.args = (3000,3100,4000,4100,500,510)


class Test_Image_Slice:

  def setup_class(self):
    """Setup class parameters"""
    makeunitdb.createTestDB(p.token, channel_list=p.channels, channel_type=p.channel_type, channel_datatype=p.datatype)

  def teardown_class(self):
    """Cleanup class parameters"""
    makeunitdb.deleteTestDB(p.token)

  def test_xy (self):
github neurodata / ndstore / test / test_jpeg.py View on Github external
import cStringIO
import makeunitdb
from ndlib.ndtype import IMAGE, UINT8, UINT16
from params import Params
from postmethods import postNPZ, getNPZ, getHDF5, postHDF5, getURL, postBlosc, getBlosc
from test_settings import *

# Test_Jpeg
# 1 - test_get_jpeg

p = Params()
p.token = 'unittest'
p.resolution = 0
p.channels = ['IMAGE1', 'IMAGE2']
p.window = [0,500]
p.channel_type = IMAGE
p.datatype = UINT8
p.voxel = [4.0,4.0,3.0]
#p.args = (3000,3100,4000,4100,500,510)


class Test_Jpeg:

  def setup_class(self):

    makeunitdb.createTestDB(p.token, channel_list=p.channels, channel_type=p.channel_type, channel_datatype=p.datatype)

  def teardown_class(self):
    makeunitdb.deleteTestDB(p.token)


  def test_get_jpeg (self):
github neurodata / ndstore / test / test_autoingest.py View on Github external
import ND.settings
os.environ['DJANGO_SETTINGS_MODULE'] = 'ND.settings'
from ingest.core.config import Configuration
from ndlib.ndtype import IMAGE, UINT8, MYSQL
from params import Params
from postmethods import getJSON, postJSON, deleteJSON, postURL
import makeunitdb
import site_to_test
SITE_HOST = site_to_test.site

p = Params()
p.token = 'unittest'
p.project = 'unittest'
p.resolution = 0
p.channels = ['CHAN1', 'CHAN2']
p.channel_type = IMAGE
p.datatype = UINT8
p.dataset = 'unittest'


class Test_AutoIngest():

  def setup_class(self):
    """Setup Parameters"""
    makeunitdb.createTestDB(p.project, channel_list=p.channels, ximagesize=2000, yimagesize=2000, zimagesize=1000, xvoxelres=1.0, yvoxelres=1.0, zvoxelres=5.0, token_name=p.token)
  
  def teardown_class(self):
    """Teardown Parameters"""
    makeunitdb.deleteTestDB(p.project, token_name=p.token)
  
  def test_post_config(self):
github neurodata / ndstore / test / test_autoingest.py View on Github external
import makeunitdb
sys.path += [os.path.abspath('../django')]
import ND.settings
os.environ['DJANGO_SETTINGS_MODULE'] = 'ND.settings'
from ingest.core.config import Configuration
from ndlib.ndtype import IMAGE, UINT8, MYSQL
from params import Params
from ndlib.restutil import getJson, postJson, deleteJson, postURL
from test_settings import *

p = Params()
p.token = 'unittest'
p.project = 'unittest'
p.resolution = 0
p.channels = ['CHAN1', 'CHAN2']
p.channel_type = IMAGE
p.datatype = UINT8
p.dataset = 'unittest'


@pytest.mark.skipif(True, reason='Test not necessary for dev mode')
class Test_AutoIngest():

  def setup_class(self):
    """Setup Parameters"""
    makeunitdb.createTestDB(p.project, channel_list=p.channels, ximagesize=2000, yimagesize=2000, zimagesize=1000, xvoxelres=1.0, yvoxelres=1.0, zvoxelres=5.0, token_name=p.token)
    self.job_id = 0
  
  def teardown_class(self):
    """Teardown Parameters"""
    makeunitdb.deleteTestDB(p.project, token_name=p.token)