Functions and Modules

Download Data

packages.cubeCutout.cubeCutout(token, channel, queryFile, outputFile, useSemaphore, objectType, serviceLocation)

cubeCutout function allows the user to retrieve raw cutout volumes (i.e. no meta data) of image or annotation volumes from NeuroData.

Inputs

token: (string)
  • OCP token name serving as the source for data
channel: (string)
  • OCP channel name for source data
queryFile: (string)
  • Fully formed OCP query saved to a .mat file
outFile (string)
  • Location of output file, saved as a matfile containing a RAMONVolume named ‘cube’. Contains result of applying classifier to input data.
useSemaphore: (int)(default=0)
  • throttles reading/writing client-side for large batch jobs. Not needed in single cutout mode.
objectType: (int)
  • Flag indicating data download type. 0=RAMONVolume saved to .mat; 1=HDF5 saved to .h5
serviceLocation: (string)
  • Location of OCP server hosting the data, typically openconnecto.me

Outputs

No explicit outputs. Output file is saved to disk rather than output as a variable to allow for downstream integration with LONI.
packages.cubeCutout.computeBlock(serverLocation, token, channel, resolution, xStart, xStop, yStart, yStop, zStart, zStop, xSpan, ySpan, zSpan, padX, padY, padZ, alignXY, alignZ, computeOptions, shuffleFilesFlag, cubeListFile, cubeOutputDir, mergeListFile, mergeOutputDir, print_flag)

computeBlock function allows the user to create a query and pull data from NeuroData easily while computing subvolumes from a larger volume of interest.

Inputs

server: (string)
  • OCP server name serving as the source for data
token: (string)
  • OCP token name serving as the source for data
channel: (string)
  • OCP channel name serving as the source for data
resolution: (int)
  • Resolution of data you wish to download
xStart, yStart, zStart: (int)
  • Lower bounds of cube to download
xStop, yStop, zStop: (int)
  • Upper bounds of cube to download
xSpan, ySpan, zSpan: (int)
  • Data range in each dimension
padX, padY, padZ: (int)
  • How much you wish to pad the data in each dimension
alignXY, alignZ: (int)
  • Flag for aligning cutout volumes with cubes
computeOptions: (string)
  • Additional processing options
shuffleFilesFlag: (int)
  • Flag for shuffling file ordering of cutouts
cubeListFile: (string)
  • Basename of output cubeList file
cubeOutputDir: (string)
  • Directory to which downloaded cubes are saved
mergeListFile: (int)
  • Flag for merging listfiles across instances
mergeOutputDir: (int)
  • Flag for merging output directories across instances
print_flag: (int)
  • Flag for verbose output or not

Outputs

No explicit outputs. Output cubes are saved to disk rather than output as a variable to allow for downstream integration with LONI.

Notes

Function definition must be one line for documentation to work (known bug in sphinx)

Upload Data

packages.cubeUpload.cubeUploadDense(server, token, channel, RAMONVol, protoRAMON, useSemaphore, varargin)

Inputs

server: (string)
  • OCP server name serving as the target for annotations
token: (string)
  • OCP token name serving as the target for annotations
channel: (string)
  • OCP channel name serving as the target for annotations
RAMONVol: (string)
  • Location of output file, saved as a matfile containing a RAMONVolume named ‘cube’
protoRAMON (string)
  • RAMONObject prototype to apply to all object types
useSemaphore: (int)(default=0)
  • throttles reading/writing client-side for large batch jobs. Not needed in single cutout mode
outputFile: (string)
  • optional file path to store output volume as a RAMONVolume named ‘cube’

Outputs

No explicit outputs. Output file is optionally saved to disk rather than output as a variable to allow for downstream integration with LONI.

Notes

Function to upload objects in a RAMON volume as a denseVolume Requires that all objects begin from a common prototype, and that RAMONVolume has appropriate fields (in particular resolution and XYZ offset). This only supports anno32 data for now - do not use for probability uploads. Centroids have been added to this function by popular request.

packages.cubeUpload.uploadLabels(server, token, channel, volume, idFile, probability, doRelabel, useSemaphore, varargin)

uploadLabels function allows the user to post raw annotation data (i.e. no meta data) in the form of either annotation labels or probabilities to OCP.

Inputs

server: (string)
  • OCP server name serving as the target for annotations
token: (string)
  • OCP token name serving as the target for annotations
channel: (string)
  • OCP channel name serving as the target for annotations
volume: (RAMONVolume, string)
  • RAMONVolume or path and filename of .mat file containing the RAMONVolume to be posted
idFile: (string)
  • path and filename which will store the posted id
probability: (float)(default=0)
  • flag indicating whether annotation is a probaility map
useSemaphore: (int)(default=0)
  • throttles reading/writing client-side for large batch jobs. Not needed in single cutout mode

Outputs

No explicit outputs. Output file is optionally saved to disk rather than output as a variable to allow for downstream integration with LONI.

Notes

Probabilities are uploaded as float32 data, and label annotations are uploaded as uint32.

packages.cubeUpload.uploadRAMON(server, token, channel, RAMONObj, useSemaphore, idFile, varargin)

uploadRAMON function allows the user to post complete RAMON objects (annotations and meta data), annotation metadata, or batch upload RAMON prototypes.

Inputs

server: (string)
  • OCP server name serving as the target for annotations
token: (string)
  • OCP token name serving as the target for annotations
channel: (string)
  • OCP channel name serving as the target for annotations
RAMONObj: (RAMON object cell array, string)
  • single RAMON object, cell array of RAMON objects, or path and filename of .mat file containing the RAMON object to be posted
useSemaphore: (int)(default=0)
  • throttles reading/writing client-side for large batch jobs. Not needed in single cutout mode
ids: (integer array)
  • optional ids if labels already exist or space has been reserved in the database

Outputs

No explicit outputs. Output file is optionally saved to disk rather than output as a variable to allow for downstream integration with LONI.

Notes

When uploading metadata for a single or multiple complete RAMON objects, you should stack the RAMON objects in a cell array and pass that either directly or through a file. When uploading a prototype RAMON object to one or more ids, pass a single RAMON object either directly or through a file. If no id is provided, both of these methods perform the same. If there are multiple ids and one RAMON object, then the RAMON prototype option will be selected. If there are an uneven (but greater than one) number of RAMON objects and ids, then an error will be raised.

For questions on these functions, please contact Will Gray Roncal at wgr@jhu.edu