The Virtual Brain Project

Table Of Contents

Previous topic

simulator Package

Next topic

brco Package

This Page

uploaders Package

Define a list with all Python modules in which the introspect mechanism should search for Import Adapters.

brco_importer

class tvb.adapters.uploaders.brco_importer.BRCOImporter[source]

Bases: tvb.core.adapters.abcuploader.ABCUploader

Import connectivity data stored in the networkx gpickle format

get_form_class()[source]
get_output()[source]
launch(data_file, connectivity)[source]
class tvb.adapters.uploaders.brco_importer.BRCOImporterForm(prefix='', project_id=None)[source]

Bases: tvb.core.adapters.abcuploader.ABCUploaderForm

connectivity_measure_importer

class tvb.adapters.uploaders.connectivity_measure_importer.ConnectivityMeasureImporter[source]

Bases: tvb.core.adapters.abcuploader.ABCUploader

This imports a searies of conectivity measures from a .mat file

get_form_class()[source]
get_output()[source]
launch(data_file, dataset_name, connectivity)[source]

Execute import operations:

class tvb.adapters.uploaders.connectivity_measure_importer.ConnectivityMeasureImporterForm(prefix='', project_id=None)[source]

Bases: tvb.core.adapters.abcuploader.ABCUploaderForm

csv_connectivity_importer

class tvb.adapters.uploaders.csv_connectivity_importer.CSVConnectivityImporter[source]

Bases: tvb.core.adapters.abcuploader.ABCUploader

Handler for uploading a Connectivity csv from the dti pipeline

TRACT_FILE = 'tract_lengths.txt'
WEIGHTS_FILE = 'weights.txt'
get_form_class()[source]
get_output()[source]
launch(weights, weights_delimiter, tracts, tracts_delimiter, input_data)[source]

Execute import operations: process the weights and tracts csv files, then use the reference connectivity passed as input_data for the rest of the attributes.

Parameters:
  • weights – csv file containing the weights measures
  • tracts – csv file containing the tracts measures
  • input_data – a reference connectivity with the additional attributes
Raises LaunchException:
 

when the number of nodes in CSV files doesn’t match the one in the connectivity

class tvb.adapters.uploaders.csv_connectivity_importer.CSVConnectivityImporterForm(prefix='', project_id=None)[source]

Bases: tvb.core.adapters.abcuploader.ABCUploaderForm

class tvb.adapters.uploaders.csv_connectivity_importer.CSVConnectivityParser(csv_file, delimiter=', ')[source]

Bases: builtins.object

Parser for a connectivity csv file Such a file may begin with a optional header of ordinal integers The body of the file is a square matrix of floats -1 is interpreted as 0 If a header is present the matrices columns and rows are permuted so that the header ordinals would be in ascending order

permutation = None

A permutation represented as a list index -> new_index. Defaults to the identity permutation

gifti_surface_importer

class tvb.adapters.uploaders.gifti_surface_importer.GIFTISurfaceImporter[source]

Bases: tvb.core.adapters.abcuploader.ABCUploader

This importer is responsible for import of surface from GIFTI format (XML file) and store them in TVB as Surface.

get_form_class()[source]
get_output()[source]
launch(file_type, data_file, data_file_part2, should_center=False)[source]

Execute import operations:

class tvb.adapters.uploaders.gifti_surface_importer.GIFTISurfaceImporterForm(prefix='', project_id=None)[source]

Bases: tvb.core.adapters.abcuploader.ABCUploaderForm

gifti_timeseries_importer

class tvb.adapters.uploaders.gifti_timeseries_importer.GIFTITimeSeriesImporter[source]

Bases: tvb.core.adapters.abcuploader.ABCUploader

This importer is responsible for import of a TimeSeries from GIFTI format (XML file) and store them in TVB.

get_form_class()[source]
get_output()[source]
launch(data_file, surface=None)[source]

Execute import operations:

class tvb.adapters.uploaders.gifti_timeseries_importer.GIFTITimeSeriesImporterForm(prefix='', project_id=None)[source]

Bases: tvb.core.adapters.abcuploader.ABCUploaderForm

mat_timeseries_eeg_importer

class tvb.adapters.uploaders.mat_timeseries_eeg_importer.EEGMatTimeSeriesImporter[source]

Bases: tvb.adapters.uploaders.mat_timeseries_importer.MatTimeSeriesImporter

get_form_class()[source]
tstype = 'EEG'
class tvb.adapters.uploaders.mat_timeseries_eeg_importer.EEGMatTimeSeriesImporterForm(prefix='', project_id=None)[source]

Bases: tvb.adapters.uploaders.mat_timeseries_importer.MatTimeSeriesImporterForm

mat_timeseries_importer

class tvb.adapters.uploaders.mat_timeseries_importer.MatTimeSeriesImporter[source]

Bases: tvb.core.adapters.abcuploader.ABCUploader

Import time series from a .mat file.

create_eeg_ts(data_shape, sensors)[source]
create_region_ts(data_shape, connectivity)[source]
get_form_class()[source]
get_output()[source]
launch(data_file, dataset_name, structure_path='', transpose=False, slice=None, sampling_rate=1000, start_time=0, tstype_parameters=None)[source]
ts_builder = {'Region': <function MatTimeSeriesImporter.create_region_ts at 0x7f718ba0e680>, 'EEG': <function MatTimeSeriesImporter.create_eeg_ts at 0x7f718ba0e710>}
tstype = 'Region'
class tvb.adapters.uploaders.mat_timeseries_importer.MatTimeSeriesImporterForm(prefix='', project_id=None)[source]

Bases: tvb.core.adapters.abcuploader.ABCUploaderForm

class tvb.adapters.uploaders.mat_timeseries_importer.RegionMatTimeSeriesImporterForm(prefix='', project_id=None)[source]

Bases: tvb.adapters.uploaders.mat_timeseries_importer.MatTimeSeriesImporterForm

networkx_importer

class tvb.adapters.uploaders.networkx_importer.NetworkxCFFCommonImporterForm(prefix='', project_id=None, label_prefix='')[source]

Bases: tvb.core.adapters.abcuploader.ABCUploaderForm

class tvb.adapters.uploaders.networkx_importer.NetworkxConnectivityImporter[source]

Bases: tvb.core.adapters.abcuploader.ABCUploader

Import connectivity data stored in the networkx gpickle format

get_form_class()[source]
get_output()[source]
launch(data_file, **kwargs)[source]
class tvb.adapters.uploaders.networkx_importer.NetworkxConnectivityImporterForm(prefix='', project_id=None)[source]

Bases: tvb.adapters.uploaders.networkx_importer.NetworkxCFFCommonImporterForm

nifti_importer

class tvb.adapters.uploaders.nifti_importer.NIFTIImporter[source]

Bases: tvb.core.adapters.abcuploader.ABCUploader

This importer is responsible for loading of data from NIFTI format (nii or nii.gz files) and store them in TVB as TimeSeriesVolume or RegionVolumeMapping.

get_form_class()[source]
get_output()[source]
launch(data_file, apply_corrections=False, mappings_file=None, connectivity=None)[source]

Execute import operations:

class tvb.adapters.uploaders.nifti_importer.NIFTIImporterForm(prefix='', project_id=None)[source]

Bases: tvb.core.adapters.abcuploader.ABCUploaderForm

obj_importer

class tvb.adapters.uploaders.obj_importer.ObjSurfaceImporter[source]

Bases: tvb.core.adapters.abcuploader.ABCUploader

This imports geometry data stored in wavefront obj format

get_form_class()[source]
get_output()[source]
launch(surface_type, data_file, should_center=False)[source]

Execute import operations:

class tvb.adapters.uploaders.obj_importer.ObjSurfaceImporterForm(prefix='', project_id=None)[source]

Bases: tvb.core.adapters.abcuploader.ABCUploaderForm

projection_matrix_importer

class tvb.adapters.uploaders.projection_matrix_importer.ProjectionMatrixImporterForm(prefix='', project_id=None)[source]

Bases: tvb.core.adapters.abcuploader.ABCUploaderForm

class tvb.adapters.uploaders.projection_matrix_importer.ProjectionMatrixSurfaceEEGImporter[source]

Bases: tvb.core.adapters.abcuploader.ABCUploader

Upload ProjectionMatrix Cortical Surface -> EEG/MEG/SEEG Sensors from a MAT or NPY file.

get_form_class()[source]
get_output()[source]
launch(projection_file, surface, sensors, dataset_name='ProjectionMatrix')[source]

Creates ProjectionMatrix entity from uploaded data.

Raises LaunchException:
 when * no projection_file or sensors are specified * the dataset is invalid * number of sensors is different from the one in dataset
logger = <Logger tvb.adapters.uploaders.projection_matrix_importer (INFO)>
tvb.adapters.uploaders.projection_matrix_importer.determine_projection_type(sensors_idx)[source]

region_mapping_importer

class tvb.adapters.uploaders.region_mapping_importer.RegionMappingImporter[source]

Bases: tvb.core.adapters.abcuploader.ABCUploader

Upload RegionMapping from a TXT, ZIP or BZ2 file.

get_form_class()[source]
get_output()[source]
launch(mapping_file, surface, connectivity)[source]

Creates region mapping from uploaded data.

Parameters:mapping_file – an archive containing data for mapping surface to connectivity
Raises LaunchException:
 when * a parameter is None or missing * archive has more than one file * uploaded files are empty * number of vertices in imported file is different to the number of surface vertices * imported file has negative values * imported file has regions which are not in connectivity
logger = <Logger tvb.adapters.uploaders.region_mapping_importer (INFO)>
class tvb.adapters.uploaders.region_mapping_importer.RegionMappingImporterForm(prefix='', project_id=None)[source]

Bases: tvb.core.adapters.abcuploader.ABCUploaderForm

sensors_importer

class tvb.adapters.uploaders.sensors_importer.SensorsImporter[source]

Bases: tvb.core.adapters.abcuploader.ABCUploader

Upload Sensors from a TXT file.

get_form_class()[source]
get_output()[source]
launch(sensors_file, sensors_type)[source]

Creates required sensors from the uploaded file.

Parameters:
  • sensors_file – the file containing sensor data
  • sensors_type – a string from “EEG Sensors”, “MEG sensors”, “Internal Sensors”
Returns:

a list of sensors instances of the specified type

Raises LaunchException:
 

when * no sensors_file specified * sensors_type is invalid (not one of the mentioned options) * sensors_type is “MEG sensors” and no orientation is specified

logger = <Logger tvb.adapters.uploaders.sensors_importer (INFO)>
class tvb.adapters.uploaders.sensors_importer.SensorsImporterForm(prefix='', project_id=None)[source]

Bases: tvb.core.adapters.abcuploader.ABCUploaderForm

options = {'EEG Sensors': 'EEG', 'MEG Sensors': 'MEG', 'Internal Sensors': 'Internal'}

tract_importer

class tvb.adapters.uploaders.tract_importer.TrackImporterForm(prefix='', project_id=None)[source]

Bases: tvb.core.adapters.abcuploader.ABCUploaderForm

class tvb.adapters.uploaders.tract_importer.TrackZipImporterForm(prefix='', project_id=None)[source]

Bases: tvb.adapters.uploaders.tract_importer.TrackImporterForm

class tvb.adapters.uploaders.tract_importer.TrackvizTractsImporter[source]

Bases: tvb.adapters.uploaders.tract_importer._TrackImporterBase

This imports tracts from the trackviz format

launch(data_file, region_volume=None)[source]
class tvb.adapters.uploaders.tract_importer.ZipTxtTractsImporter[source]

Bases: tvb.adapters.uploaders.tract_importer._TrackImporterBase

This imports tracts from a zip containing txt files. One txt file for a tract.

get_form_class()[source]
launch(data_file, region_volume=None)[source]
tvb.adapters.uploaders.tract_importer.chunk_iter(iterable, n)[source]

Reads a generator in chunks. Yields lists. Last one may be smaller than n.

tvb_importer

class tvb.adapters.uploaders.tvb_importer.TVBImporter[source]

Bases: tvb.core.adapters.abcuploader.ABCUploader

This importer is responsible for loading of data types exported from other systems in TVB format (simple H5 file or ZIP file containing multiple H5 files)

get_form_class()[source]
get_output()[source]
launch(data_file)[source]

Execute import operations: unpack ZIP, build and store generic DataType objects.

Parameters:data_file – an archive (ZIP / HDF5) containing the DataType
Raises LaunchException:
 when data_file is None, nonexistent, or invalid (e.g. incomplete meta-data, not in ZIP / HDF5 format etc. )
class tvb.adapters.uploaders.tvb_importer.TVBImporterForm(prefix='', project_id=None)[source]

Bases: tvb.core.adapters.abcuploader.ABCUploaderForm

upload_algorithm_category_config

zip_connectivity_importer

class tvb.adapters.uploaders.zip_connectivity_importer.ZIPConnectivityImporter[source]

Bases: tvb.core.adapters.abcuploader.ABCUploader

Handler for uploading a Connectivity archive, with files holding text export of connectivity data from Numpy arrays.

AREA_TOKEN = 'area'
CENTRES_TOKEN = 'centres'
CENTRES_TOKEN2 = 'centers'
CORTICAL_INFO = 'cortical'
HEMISPHERE_INFO = 'hemisphere'
ORIENTATION_TOKEN = 'orientation'
TRACT_TOKEN = 'tract'
WEIGHT_TOKEN = 'weight'
get_form_class()[source]
get_output()[source]
launch(uploaded, normalization=None)[source]

Execute import operations: unpack ZIP and build Connectivity object as result.

Parameters:

uploaded – an archive containing the Connectivity data to be imported

Returns:

Connectivity

Raises:
  • LaunchException – when uploaded is empty or nonexistent
  • Exception – when * weights or tracts matrix is invalid (negative values, wrong shape) * any of the vector orientation, areas, cortical or hemisphere is different from the expected number of nodes
class tvb.adapters.uploaders.zip_connectivity_importer.ZIPConnectivityImporterForm(prefix='', project_id=None)[source]

Bases: tvb.core.adapters.abcuploader.ABCUploaderForm

zip_surface_importer

class tvb.adapters.uploaders.zip_surface_importer.ZIPSurfaceImporter[source]

Bases: tvb.core.adapters.abcuploader.ABCUploader

Handler for uploading a Surface Data archive, with files holding vertices, normals and triangles to represent a surface data.

get_form_class()[source]
get_output()[source]
launch(uploaded, surface_type, zero_based_triangles=False, should_center=False)[source]

Execute import operations: unpack ZIP and build Surface object as result.

Parameters:
  • uploaded – an archive containing the Surface data to be imported
  • surface_type – a string from the following:

“Skin Air”, “Skull Skin”, “Brain Skull”, “Cortical Surface”, “EEG Cap”, “Face”

Returns:

a subclass of Surface DataType

Raises:
  • LaunchException – when * uploaded is missing * surface_type is invalid
  • RuntimeError – when triangles contain an invalid vertex index
logger = <Logger tvb.adapters.uploaders.zip_surface_importer (INFO)>
class tvb.adapters.uploaders.zip_surface_importer.ZIPSurfaceImporterForm(prefix='', project_id=None)[source]

Bases: tvb.core.adapters.abcuploader.ABCUploaderForm