Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web GUI for tvb-recon #68

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open

Conversation

PUNITBATRA
Copy link

@PUNITBATRA PUNITBATRA commented May 16, 2020

This will focus on constructing a Web GUI for Reconstruction pipeline. The reconstruction pipeline takes RMN images as input and processes them, then produces files that are compatible with TVB. We Integrated the Web GUI with workflow engine (Pegasus) in order to provide job status and job execution statistics.

Copy link
Collaborator

@popaula937 popaula937 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have left comments on the places where I see possible code improvements.
The general idea is that we should aim for generic React components and server endpoints/functions, so we would have code that is clean, easier to read, and easier to maintain/modify.
We will discuss more about these at our weekly call.

<input type="number" name="openmp.threads" className="field" value={this.state["openmp.threads"]} onChange={this.handleChangeAll} />
<i class="fa fa-info-circle fa-1x" title="Default values is 4.Determine no of threads in multi-processing." ></i>

</label>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This set of tags (label + input + i) can be moved to a generic component called InputField that receives as arguments the label ('openmp.threads'), the value ({this.state["openmp.threads"]}) and the title description.
Once we have such a method, we could transform all the code from lines 52-106 into a loop that iterates over the state and generates an InputField component with the proper label and title.

web/src/components/Configuration/Configuration.js Outdated Show resolved Hide resolved
web/src/components/Input/Patient1/InputFiles.js Outdated Show resolved Hide resolved
web/src/components/Input/Patient2/InputFiles.js Outdated Show resolved Hide resolved
web/src/components/Input/Patient3/InputFiles.js Outdated Show resolved Hide resolved
web/src/components/Input/Patient4/InputFiles.js Outdated Show resolved Hide resolved
//For Patient 1
var storage = multer.diskStorage({
destination: function (req, file, cb) {
const path='TVB_patients/TVB1/raw/mri'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of having this hardcoded string, you could define another function that generates the proper path by receiving as argument the current patient.


//For Patient 1
var storage = multer.diskStorage({
destination: function (req, file, cb) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of defining 4 endpoints in the server, one for each patient, you could define a single one that receives as argument the current patient and does all the computation generically.
As a result, you will not have duplicated code here, there will be fewer lines of code and this file would be easier to read. Thus, it will also be easier to maintain: if you need to do a change, you will not have to do it 4 times, in each of the endpoints, but a single time in the generic endpoint.

fs.mkdirSync(path1, { recursive: true })
var file1=path1+'/patient_flow.properties'
app.post("/input1",function(req,res){
const data={
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This endpoint could also be generic and receive the current patient as an argument.

@popaula937 popaula937 changed the title Adding home page Web GUI for tvb-recon Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants