-
Notifications
You must be signed in to change notification settings - Fork 21
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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> |
There was a problem hiding this comment.
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.
//For Patient 1 | ||
var storage = multer.diskStorage({ | ||
destination: function (req, file, cb) { | ||
const path='TVB_patients/TVB1/raw/mri' |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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={ |
There was a problem hiding this comment.
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.
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.