Skip to main content

# PyCTRSA

[![PyPI version](https://img.shields.io/pypi/v/pyctrsa?style=flat-square)](https://pypi.org/project/pyctrsa/) [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

#### A Python toolbox for Cross-Temporal Representation Similarity Analysis (RSA)-based Decoding on EEG/MEG data

## Download > pip install pyctrsa

## Required Dependencies

  • [Numpy](https://www.numpy.org): a fundamental package for scientific computing.

  • [SciPy](https://www.scipy.org/scipylib/index.html): a package that provides many user-friendly and efficient numerical routines.

  • [Matplotlib](https://matplotlib.org): a Python 2D plotting library.

  • [NeuroRA](https://zitonglu1996.github.io/NeuroRA/): a Python toolbox for multimode neural data Representation Analysis.

## Hightlight In traditional RSA, we can only use a coding model RDM to fit the RDMs from neural data time by time. So, can we do cross-temporal decoding based on RSA?

CTRSA-based decoding is a new algorithm for cross-temporal E/MEG decoding by RSA. We use the neural data from two different time-points to establish a Cross-Temporal Representatonal Dissimilarity Matrix (RDM) corrsponding to time i and time j. By this train of thought, we can obtain Number_of_Times by Number_of_Times Cross-Temporal RDMs. Then we can establish a Coding Model RDM by the experimental hypothesis. Finally, we can calculate the similarity between this Coding Model RDM and the Number_of_Times by Number_of_Times Cross-Temporal RDMs and obtain the cross-temporal decoding results.

## Notes In PyCTRSA, you can not only calculate the cross-temporal similarities based on this novel methods to realize decoding, but also calculate the cross-temporal similarities based on neural data under two different conditions to see the similar data patterns between two conditions and calculate the cross-temporal similarities based on normal RDMs to see the similar representational patterns between different time-points.

## Features

1. Calculate the Cross-Temporal RDM (Novel here!)

> calculate CTRDMs for a single channel/subject > calculate CTRDMs for multi-channels&subejcts

2. Calculate the similarity between two CTRDMs (Novel here!)

> by Pearson Correlation/Spearman Correlation/Kendall tau Correlation/Cosine Similarity/Euclidean Distance

3. Calculate the Cross-Temporal Similarities

> calculate CTSimilarities between neural data under two conditions > calculate CTSimilarities based on normal RDMs > calculate CTSimilarities between CTRDMs and a Coding Model RDM (Novel here!)

4. Plot the Results

> plot the CTRDM > plot the CTSimilarities > plot the time-by-time similarities

## How to use PyCTRSA

## Efficiency of using PyCTRSA

Here, we use a tutorial to compare the traditional classification-based decoding and novel cross-temporal RSA-based decoding below:

## About PyCTRSA

This work should be affilliated with [NeuroRA](https:/zitonglu1996.github.io/NeuroRA/), but it is an independent part.

If you have any question, find some bugs or have some useful suggestions while using, you can email me and I will be happy and thankful to know.

>My email address: >zitonglu1996@gmail.com / zitonglu@outlook.com

>My personal homepage: >https://zitonglu1996.github.io

Metadata

Release files for pyctrsa 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyctrsa 0.1.0
File Size Uploaded
pyctrsa-0.1.0.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyctrsa 0.1.0
File Interpreter ABI Platform
pyctrsa-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 37.8 kB

Release files / pyctrsa-0.1.0.tar.gz

Download URL pyctrsa-0.1.0.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
df49d2391477c6d829ebf4c672eab0196e56a2d7178be91d651504f612fae671
BLAKE2b-256 checksum
How to use checksums
ca6b353ddda1a466fc812e630b9b714f072360a57ca4bb29ef2aaaa5c525b893
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.7.2

Release files / pyctrsa-0.1.0-py3-none-any.whl

Download URL pyctrsa-0.1.0-py3-none-any.whl
Size 24.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7a8ee1f00b7b840413e07a543e0728326db56d3d4dceed60236d3742f418ae3c
BLAKE2b-256 checksum
How to use checksums
308b419b0373ee5a26ee1b4d75a916f18cfaebe9486a56fbba37caea34582845
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.26.0 CPython/3.7.2

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page