This toolbox contains all the functions required to run the whole project pipeline from one command
The toolbox is composed of 4 libraries:
- func_for_clustering.py : This file contains the main pipeline
- Visualization.py : This file has the necessary functions to visualise the results
- Clustering.py : This file contains the algorithms employed in the pipeline and is programmed to show the results of the selected algorithm
- Processing.py : This file has smoothing functions as well as filtering algorithms to clean the data
The required arguments for this functions are:
- The data directory
- The mask directory
Optional arguments are:
- Processing: this argument can take the values of 'double', 'RSS', 'thr' or 'window'
- finger_tapping: this argument can take the values of 'No' or 'Yes'. If 'Yes', the directory of the timings and TR ought to be specified
- window_size: necessary argument if Processing takes the value of 'window'
- near: necessary argument if Processing takes the value of 'RSS'
- thr: necessary argument if Processing takes the value of 'thr'
- contrast: contrast for the correlation maps
- dir_path: directory for the finger_tapping timings
- repetition_time: Repetition Time (TR) of the data, only necessary in finger_tapping events
- Algorithm: the possible values are 'infomap' or 'KMeans'
- thr_infomap: necessary argument if the selected algorithm is infomap
- n_clusters: necessary argument if the selected algorithm is KMeans
- save_maps: can take values of 'No' or 'Yes'
- saving_dir: the results and plot will be saved onto the current directory if no other are specified
By default this library executes the pipeline with no processing and applies the infomap algorithm with a threshold of the 90th percentile
This library is composed of several functions for visualization.
- display_table: displays an html table
- plot_labels: plots the time_series of the found clusters
- RSS_peaks: plots the RSS of the data and the selected peaks. It return the indexes of the selected peaks
- show_table: employs display_table to show a table with the clusters, the number of time-points per cluster and the relative importance of each cluster
- plot_two_maps: plots the comparison of the original correlation map vs the one after preprocessing
- Dyn: saves a DyNeuSR html of the results
This library contains the necessary functions to carry out the clustering operations:
- save_maps: saves the results of the clustering into an specified directory
- findCommunities: internal algorithm of infomap
- K_Means: KMeans algorithm with display of results
- Info_Map: InfoMap algorithm with display of results
This library is employed by the main pipeline to apply filters in the data:
- thr_index: employs a threshold based on percentile and removes those points below the threshold
- correlation_with_window: calculates the correlation of the data using a sliding window of the specified length
- preprocess: depending on the settings employed in the main pipeline, it will return a processed correlation map
Hello world