Skip to content

Boss Project Setup Tutorial

Tim Gion edited this page Jan 25, 2017 · 13 revisions

Creating Your Data Hierarchy

The Boss Data Model and intern Resources

intern has resource classes that map directly to the objects in the Boss data model. The Boss specific resources are defined in the submodule intern.resource.boss.resource.

  • CollectionResource
  • ExperimentResource
  • CoordinateFrameResource
  • ChannelResource

Creation Example

Let's setup the initial data hierarchy with a collection and one experiment with a coordinate frame, channel, and layer. For clarity, we'll use the names of most of the positional arguments when creating resource instances.

Note only users with either the resource-manager or admin roles can actually create resources.

from intern.remote.boss import BossRemote
from intern.resource.boss.resource import *

rmt = BossRemote()

collection = CollectionResource('JHUAPL', description='JHUAPL Data')
rmt.create_project(collection)

Let's create the coordinate frame and experiment, now. Keep in mind that coordinate frames do not allow negative numbers. Also notice that the experiment is linked to the coordinate frame by name.

coord_frame = CoordinateFrameResource(
    'JHUAPLFrame', description='JHUAPL Standard Coordinate Frame',
    x_start=0, x_stop=100,
    y_start=0, y_stop=100,
    z_start=0, z_stop=50,
    x_voxel_size=1, y_voxel_size=1, z_voxel_size=1,
    voxel_unit='nanometers')
coord_frame = rmt.create_project(coord_frame)

experiment = ExperimentResource(
    'Mouse17', 'JHUAPL',
    description='First viable mouse', coord_frame=coord_frame.name,
    num_hierarchy_levels=1, hierarchy_method='near_iso')
rmt.create_project(experiment)

Now let's create two channels. The EM channel will contain raw image data, and the channel named Algorithm1 will contain annotations of the data in the EM channel. Note that when creating an annotation channel, at least one source channel must be provided (the sources argument). Also, annotation channels must be uint64.

channel = ChannelResource(
    'EM', 'JHUAPL', 'Mouse17', type='image', description='EM data channel',
    datatype='uint16')
channel = rmt.create_project(channel)

ann_chan = ChannelResource(
    'Algorithm1', 'JHUAPL', 'Mouse17', type='annotation',
    description='1st experimental classifier',
    datatype='uint64', sources=[channel.name])
rmt.create_project(ann_chan)

At this point, your data hierarchy should be created.