Пример #1
0
    def from_file_projection_array(source_file="projection_eeg_62_surface_16k.mat",
                                   matlab_data_name="ProjectionMatrix"):

        source_full_path = try_get_absolute_path("tvb_data.projectionMatrix", source_file)
        reader = FileReader(source_full_path)

        return reader.read_array(matlab_data_name=matlab_data_name)
Пример #2
0
    def from_file(source_file="regionMapping_16k_76.txt", instance=None):

        source_full_path = try_get_absolute_path("tvb_data.regionMapping",
                                                 source_file)
        reader = FileReader(source_full_path)

        mapping = reader.read_array(dtype=numpy.int32)
        return mapping
    def from_file(source_file="local_connectivity_16384.mat", instance=None):

        source_full_path = try_get_absolute_path("tvb_data.local_connectivity",
                                                 source_file)
        reader = FileReader(source_full_path)

        matrix = reader.read_array(matlab_data_name="LocalCoupling")
        return matrix
Пример #4
0
    def from_file(cls, source_file="meg_151.txt.bz2"):
        result = super(SensorsMEG, cls).from_file(source_file)

        source_full_path = try_get_absolute_path("tvb_data.sensors", source_file)
        reader = FileReader(source_full_path)
        result.orientations = reader.read_array(use_cols=(4, 5, 6))

        return result
Пример #5
0
    def from_file_region_mapping_array(source_file=os.path.join(
        "cortex_reg13", "all_regions_cortex_reg13.txt")):

        source_full_path = try_get_absolute_path("tvb_data.surfaceData",
                                                 source_file)
        reader = FileReader(source_full_path)

        return reader.read_array(dtype=numpy.int32)
Пример #6
0
    def from_file(source_file="regionMapping_16k_76.txt"):
        source_full_path = try_get_absolute_path("tvb_data.regionMapping",
                                                 source_file)
        reader = FileReader(source_full_path)

        result = RegionMapping()
        result.array_data = reader.read_array(dtype=numpy.int32)
        return result
Пример #7
0
    def from_file(cls, source_file="meg_151.txt.bz2", instance=None):
        #labels, locations = super(SensorsMEG, cls).from_file(source_file=source_file)

        source_full_path = try_get_absolute_path("tvb_data.sensors",
                                                 source_file)
        reader = FileReader(source_full_path)
        orientations = reader.read_array(use_cols=(4, 5, 6))

        return orientations
Пример #8
0
    def from_file(source_file="local_connectivity_16384.mat"):

        result = LocalConnectivity()

        source_full_path = try_get_absolute_path("tvb_data.local_connectivity", source_file)
        reader = FileReader(source_full_path)

        result.matrix = reader.read_array(matlab_data_name="LocalCoupling")
        return result
Пример #9
0
    def from_file(cls, source_file="eeg_brainstorm_65.txt"):

        result = cls()
        source_full_path = try_get_absolute_path("tvb_data.sensors", source_file)
        reader = FileReader(source_full_path)

        result.labels = reader.read_array(dtype=numpy.str, use_cols=(0,))
        result.locations = reader.read_array(use_cols=(1, 2, 3))
        return result
Пример #10
0
    def from_file(cls, source_file=None, matlab_data_name=None, is_brainstorm=False, instance=None):

        source_full_path = try_get_absolute_path("tvb_data.projectionMatrix", source_file)
        reader = FileReader(source_full_path)
        if is_brainstorm:
            projection_data = reader.read_gain_from_brainstorm()
        else:
            projection_data = reader.read_array(matlab_data_name=matlab_data_name)
        return projection_data
Пример #11
0
    def from_file(cls, source_file="eeg_brainstorm_65.txt", instance=None):

        source_full_path = try_get_absolute_path("tvb_data.sensors",
                                                 source_file)
        reader = FileReader(source_full_path)

        labels = reader.read_array(dtype="string", use_cols=(0, ))
        locations = reader.read_array(use_cols=(1, 2, 3))

        return labels, locations
Пример #12
0
    def from_file(source_file=os.path.join("cortex_reg13", "region_mapping", "o52r00_irp2008_hemisphere_both_subcortical_false_regions_74.txt.bz2"), instance=None):

        if instance is None:
            result = RegionMapping()
        else:
            result = instance

        source_full_path = try_get_absolute_path("tvb_data.surfaceData", source_file)
        reader = FileReader(source_full_path)

        result.array_data = reader.read_array(dtype=numpy.int32)
        return result
Пример #13
0
    def from_file(source_file=os.path.join("cortex_reg13", "local_connectivity_surface_cortex_reg13.mat"),
                  instance=None):

        if instance is None:
            result = LocalConnectivity()
        else:
            result = instance

        source_full_path = try_get_absolute_path("tvb_data.surfaceData", source_file)
        reader = FileReader(source_full_path)

        result.matrix = reader.read_array(matlab_data_name="LocalCoupling")
        return result
Пример #14
0
    def from_file(source_file="regionMapping_16k_76.txt", instance=None):

        if instance is None:
            result = RegionMapping()
        else:
            result = instance

        source_full_path = try_get_absolute_path("tvb_data.regionMapping",
                                                 source_file)
        reader = FileReader(source_full_path)

        result.array_data = reader.read_array(dtype=numpy.int32)
        return result
Пример #15
0
    def from_file(source_file=os.path.join("cortex_reg13",
                                           "all_regions_cortex_reg13.txt"),
                  instance=None):

        if instance is None:
            result = RegionMapping()
        else:
            result = instance

        source_full_path = try_get_absolute_path("tvb_data.surfaceData",
                                                 source_file)
        reader = FileReader(source_full_path)

        result.array_data = reader.read_array(dtype=numpy.int32)
        return result
Пример #16
0
    def from_file(cls, source_file="eeg_unitvector_62.txt.bz2", instance=None):

        if instance is None:
            result = cls()
        else:
            result = instance

        source_full_path = try_get_absolute_path("tvb_data.sensors",
                                                 source_file)
        reader = FileReader(source_full_path)

        result.labels = reader.read_array(dtype="string", use_cols=(0, ))
        result.locations = reader.read_array(use_cols=(1, 2, 3))

        return result
Пример #17
0
    K21=[0.15],
    sigma=[0.3],
    mu=[2.2],
    variables_of_interest=["xi", "alpha"])
oscilator.configure()

# for alpha series uncomment the below code
# oscilator = models.ReducedSetHindmarshRose(r=[0.006], a=[1.0], b=[3.0], c=[1.0], d=[5.0], s=[4.0], xo=[-1.6], K11=[4.0], K12=[1.6], K21=[0.15], sigma=[0.4], mu=[2.2], variables_of_interest=["xi","alpha"])
# oscilator.configure()

# set up the structural connectivity
mypath = ""  # insert the path to where all subjects connectivities are stored
subject = ""  # specify which subject to load

# load connectivity weights
reader = FileReader(file_path=mypath + '/' + subject + '/weights.txt')
w = reader.read_array(dtype=numpy.float64,
                      skip_rows=0,
                      use_cols=None,
                      matlab_data_name=None)

# load region centers
reader = FileReader(file_path=mypath + '/' + subject + '/centres.txt')
rl = reader.read_array(dtype="string",
                       skip_rows=0,
                       use_cols=(0, ),
                       matlab_data_name=None)
c = reader.read_array(dtype=numpy.float64,
                      skip_rows=0,
                      use_cols=(1, 2, 3),
                      matlab_data_name=None)