示例#1
0
 def test_projection_surface_eeg(self):
     dt = projections.ProjectionSurfaceEEG()
     assert dt.sources is None
     assert dt.skin_air is None
     assert dt.skull_skin is None
     assert dt.sensors is None
     assert dt.projection_data is None
示例#2
0
 def test_projection_surface_eeg(self):
     dt = projections.ProjectionSurfaceEEG(sensors=SensorsEEG(),projection_data=numpy.array([]), sources=CorticalSurface())
     assert dt.sources is not None
     assert dt.skin_air is None
     assert dt.skull_skin is None
     assert dt.sensors is not None
     assert dt.projection_data is not None
示例#3
0
 def test_projectionsurfaceeeg(self):
     dt = projections.ProjectionSurfaceEEG()
     self.assertTrue(dt.sources is None)
     self.assertTrue(dt.skin_air is None)
     self.assertTrue(dt.skull_skin is None)
     self.assertTrue(dt.sensors is None)
     self.assertTrue(dt.projection_data is None)
示例#4
0
def cdata2eeg_mapping(eeg_mapping_data, meta, storage_path, expected_shape=0):
    """
    Currently not used
    """
    tmpdir = os.path.join(gettempdir(),
                          eeg_mapping_data.parent_cfile.get_unique_cff_name())
    LOG.debug("Using temporary folder for EEG_Mapping import: " + tmpdir)
    _zipfile = ZipFile(eeg_mapping_data.parent_cfile.src, 'r', ZIP_DEFLATED)
    eeg_projection_path = _zipfile.extract(eeg_mapping_data.src, tmpdir)
    eeg_projection_data = read_matlab_data(eeg_projection_path,
                                           constants.DATA_NAME_PROJECTION)
    if eeg_projection_data.shape[1] < expected_shape:
        padding = numpy.zeros((eeg_projection_data.shape[0],
                               expected_shape - eeg_projection_data.shape[1]))
        eeg_projection_data = numpy.hstack((eeg_projection_data, padding))

    gid = dao.get_last_data_with_uid(meta[constants.KEY_SURFACE_UID],
                                     surfaces.CorticalSurface)
    surface_data = ABCAdapter.load_entity_by_gid(gid)

    projection_matrix = projections.ProjectionSurfaceEEG(
        storage_path=storage_path)
    projection_matrix.projection_data = eeg_projection_data
    projection_matrix.sources = surface_data
    projection_matrix.sensors = None
    ### TODO if we decide to use this method, we will need to find a manner to fill the sensors.
    return projection_matrix
示例#5
0
 def test_projection_surface_eeg(self):
     dt = projections.ProjectionSurfaceEEG(
     )  #load_file='projection_eeg_65_surface_16k.npy')
     assert dt.sources is None
     assert dt.skin_air is None
     assert dt.skull_skin is None
     assert dt.sensors is None
     assert dt.projection_data is None