Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
2272c1f
branch cleaned
Spectre-ak Aug 30, 2022
da46c7c
Update README.md
Spectre-ak Aug 30, 2022
db9b750
initial app files
Spectre-ak Aug 30, 2022
bb0fc74
added homepage
Spectre-ak Aug 30, 2022
87a65f1
Update App.js
Spectre-ak Aug 30, 2022
41ab0e8
Update App.js
Spectre-ak Aug 30, 2022
42a6e84
Update README.md
Spectre-ak Aug 30, 2022
d0db122
Create node.js.yml
Spectre-ak Aug 30, 2022
3aa5a87
added working-directory
Spectre-ak Aug 30, 2022
bb90cec
Update package.json
Spectre-ak Aug 30, 2022
a8bd3f4
Update App.js
Spectre-ak Aug 30, 2022
a8023b0
Update index.js
Spectre-ak Aug 31, 2022
c7507e3
Update index.js
Spectre-ak Aug 31, 2022
9a8a4a0
updated workflow and env vars
Spectre-ak Aug 31, 2022
41ccd4e
workflow update
Spectre-ak Aug 31, 2022
9fc662b
Update index.js
Spectre-ak Aug 31, 2022
54c308b
Update index.js
Spectre-ak Aug 31, 2022
52ec299
added app layout
Spectre-ak Aug 31, 2022
232087d
hreffix
Spectre-ak Aug 31, 2022
64da60c
main branch files
Spectre-ak Aug 31, 2022
2a536e3
removing old files
Spectre-ak Aug 31, 2022
5cacd3d
Update index.html
Spectre-ak Aug 31, 2022
42ebbf3
added collect stats utils
Spectre-ak Sep 1, 2022
3522fc1
Update node.js.yml
Spectre-ak Sep 1, 2022
381c531
added echo
Spectre-ak Sep 1, 2022
9571698
updated code, removed console logs
Spectre-ak Sep 1, 2022
a90cf3c
added components
Spectre-ak Sep 1, 2022
42e6f01
Update App.js
Spectre-ak Sep 1, 2022
2d765f0
Update App.css
Spectre-ak Sep 1, 2022
c9c48ff
updated links top-navbar
Spectre-ak Sep 7, 2022
e5581e0
added milestones content
Spectre-ak Sep 7, 2022
1dea757
Update content.js
Spectre-ak Sep 7, 2022
4494010
Update App.css
Spectre-ak Sep 7, 2022
29e9b44
Added gsoc later achieved milestones
Spectre-ak Sep 7, 2022
43d911c
Update App.css
Spectre-ak Sep 7, 2022
f056eed
Update content.js
Spectre-ak Sep 7, 2022
7b7899f
sidebar links
Spectre-ak Sep 7, 2022
57da225
Create icons.js
Spectre-ak Sep 7, 2022
233b20c
added scrollbar style
Spectre-ak Sep 7, 2022
073eae0
added usEffect
Spectre-ak Sep 7, 2022
69f4e9a
doc and links
Spectre-ak Sep 7, 2022
a7f7946
added gsoc, incf links and try catch
Spectre-ak Sep 7, 2022
f645ab1
added target links
Spectre-ak Sep 7, 2022
4cb106e
doc update
Spectre-ak Sep 7, 2022
7cab54f
Update App.js
Spectre-ak Sep 7, 2022
b16d12a
added unit tests info
Spectre-ak Sep 10, 2022
93acd51
Update README.md
Spectre-ak Nov 5, 2022
3874130
Create blog.md
Spectre-ak Jan 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: build and deploy react app for gsoc doc

on:
push:
branches: [ "gsoc" ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
working-directory: ./gsoc-doc
run: npm install

- name: Create env file
working-directory: ./gsoc-doc
run: |
touch .env
echo REACT_APP_GEO_LOC_KEY="${{ secrets.REACT_APP_GEO_LOC_KEY }}" >> .env
echo REACT_APP_SHEET_SCRIPT_URL="${{ secrets.REACT_APP_SHEET_SCRIPT_URL }}" >> .env

- name: Build
working-directory: ./gsoc-doc
run: npm run build

- name: Deploy
working-directory: ./gsoc-doc
run: |
git config --global user.name $user_name
git config --global user.email $user_email
git remote set-url origin https://${github_token}@github.com/${repository}
npm run deploy
env:
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
github_token: ${{ secrets.ACTIONS_DEPLOY_ACCESS_TOKEN }}
repository: ${{ github.repository }}


2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

gsoc-doc/.env
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Contains webpages of the repo
# GSoC 2022 INCF The Virtual Brain, TVB Data Importer Blog
69 changes: 69 additions & 0 deletions blog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
Date: 8th Sep 2022

Contributor: @Akash Upadhyay

Mentors: @Paula Popa & @Lia Domide


Project Description
The Virtual Brain (TVB) is a brain stimulation platform. It offers tools for computing, simulating and analyzing functional and structural data of human brains. TVB provides a graphical user interface (GUI) for using its tools for studying human brains. The platform supports importing data into TVB like projects, data structures etc. Since TVB provides various tools for studying human brains the platform is also accessible through REST APIs. Goal of this project is to create a new package which will consume TVB REST services and perform operations on it. The new python client will have features like uploading data into a TVB, data encryption and validation, build BIDS datasets, monitor directories etc. Users will be able to use this python client to interact with a remote TVB server without using an active GUI.

Milestone 1 - Update BIDS Importer
In this phase we started working on updating the BIDS Importer. BIDS importer is used to import bids datasets into TVB projects. Goal was to modify the bids importer so that it will also support bids datasets with only single datatype (ts, net, coords, spatial). We're able to achieve this and we also tested the updated bids importer with BIDS datasets containing only time series or connectivity datatypes.

To use this custom bids importer, you can refer to the sample code which is also added here: View File/Commit

Milestone 2 - Creating BIDS data builder
In the second phase the goal was to build a module which can create datasets from a BIDS directory. The need was to design a builder which will create datasets with only required files and no other files. This will also reduce the size of the datasets.

Few challenges we faced

How do we find all the dependencies from json files? There are cases when a json file contains a path to another json file and so on.
So we came up with an approach similar to BFS traversal, since the connection(of dependencies paths) among json files was forming a graph-like structure. View get_connected_dependencies_paths
Finding a way to write files into a zip file with all the directories/sub-directories being preserved.
To resolve this we used ZipFile which is already in use in TVB importers. View create_archive
Final Outcome: A class named BIDSDataBuilder which takes BIDS root directory and datatype of which dataset is to be built. BIDSDataBuilder can also build a dataset from a set of initial json files. And the result is a zip file containing the built dataset.

View BIDSDataBuilder

Milestone 3 - Creating BIDS Directory monitor
After building BIDSDataBuilder our next goal was to write a separate module for observing or monitoring a BIDS directory for new files and whenever new files are added then consume BIDSDataBuilder to build a dataset for those files and import them into the TVB project.

So we splitted this this module into two parts

Watcher - Responsible for monitoring the directories and triggering uploader on new files
Uploader - Responsible for building the dataset for new files and importing the dataset into TVB project
Challenges:

Which library to be used for monitoring directory
We used watchdog npm library for monitoring directories and we configured it to detect json files changes only.
Running background processes
We needed the watcher to run in the background and not block other processes and similarly we needed the uploader to also run in the background. To resolve this we created two parallel threads namely watcher_thread and uploader_thread.
Final Outcome: BIDSDirWatcher class which takes BIDS directory as argument and monitors that directory for new files. It also takes additional arguments such as tvb project id in which data will be imported.

Milestone 4 - Testing
Now that we have BIDSDirWatcher and BIDSDataBuilder as a next step we need to test the module properly. During this phase we also added unit tests for bids data builder and dir watcher.

TestBIDSDataBuilder
TestBIDSDirWatcher
Challenges

While testing BIDSDirWatcher we found a bug in the BIDSImporter and because of this the import was not successful. The BIDSImporter was not able to extract the subject folders from the file paths present in a bids zip file. To resolve this we splitted the path in different manner and checked again if it's a subject directory.
Final Outcome: By this part we have our BIDSDirWatcher and BIDSDataBuilder ready and tested. Also added a sample file launch_bids_monitor.py for demonstrating how to consume the module. This file can also be used to run BIDSDirWatcher on a directory by passing it as command line arguments.

Milestone 5 - Packaging the code
This is the last stage of the project which includes packaging the whole code with all dependencies so that it can be installed easily.

So added following things

setup_bids_monitor.py
MANIFEST
README Readme
PRs and code repositories
Pull Request: (GSoC 2022, 8.2) TVB BIDS data builder and dir monitor module #589
TVB main repo: the-virtual-brain/tvb-root
Forked repo: Spectre-ak/tvb-root, tvb-bids-monitoring-gsoc
Code documentation: README.md
Project page: Separate tool to upload data into TVB
GSoC INCF page: INCF
GSoC home page: summerofcode.withgoogle.com
21 changes: 0 additions & 21 deletions build/asset-manifest.json

This file was deleted.

Binary file removed build/assets/images/17520.jpg
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
22 changes: 0 additions & 22 deletions build/firebaseHandle.js

This file was deleted.

1 change: 0 additions & 1 deletion build/index.html

This file was deleted.

2 changes: 0 additions & 2 deletions build/static/css/main.0cc182db.chunk.css

This file was deleted.

1 change: 0 additions & 1 deletion build/static/css/main.0cc182db.chunk.css.map

This file was deleted.

3 changes: 0 additions & 3 deletions build/static/js/2.0b487018.chunk.js

This file was deleted.

Loading