Comments (33)
from nirstorm.
Thanks a lot for the report. I will have a look at this issue next week. I might need your help though to decide which solution to use, I am going to write a more detailed response to detail why we are calling such a slow function here.
from nirstorm.
Hello @ftadel,
Sorry for the very long delay. I have no idea how to remove this dependency. So the main ideas of these process are to generate the nirs montage; therefore there is no input to the process; however, in order to define the montage, the user needs to select the scout that they want to target.
See picture for exemple. (you can see how the different surface are used here: https://github.com/Nirstorm/nirstorm/blob/master/bst_plugin/OM/process_nst_OM_from_head.m#L146)
One the option i think would be:
-> Create a gui to call the process by right clicking on the cortical surface and then generate OM from cortex in this case; but i don't know how to do it; and it would need to have it integreted directly in brainstorm code which break the independency between brainstorm and nirstorm.
-> have a button in the process that then create a gui to select the ROI (again, i am not sure how to doi it). The advantage would be that this code is only executed when the user is executing the process.
Or would you have a better option ofr me ?
Edouard
from nirstorm.
Wow, I didn't realize that this issue was not fixed yet and that it was loading ALL the cortex surfaces 4x at startup...
This is insane, with hundreds of subjects, it would take hours to start Brainstorm.
If it were only for your users, the scope of the problem would be limited, but since Nirstorm is now part of the compiled distribution of Brainstorm, all the users of the compiled distribution of Brainstorm are now suffering from it.
This has to disappear ASAP, please. And I'll have to recompile Brainstorm immediately after.
If you need to do extra stuff when setting the options, use the option type editpref
together with a custom options panel panel_nirstorm
or panel_nirstorm_scouts
, or anything panel_nst_options
(anything that can't overlap with Brainstorm or other plugins).
A simple example is available in process_fem_tensor.m
/ panel_femcond.m
.
To add drop-down menus, example code in panel_process_select.m
, line 1064 (combobox).
from nirstorm.
And when you load the surfaces, at least read only the Atlas
field, instead of the entire file...
from nirstorm.
Wow, I didn't realize that this issue was not fixed yet and that it was loading ALL the cortex surfaces 4x at startup...
This is insane, with hundreds of subjects, it would take hours to start Brainstorm.
If it were only for your users, the scope of the problem would be limited, but since Nirstorm is now part of the compiled distribution of Brainstorm, all the users of the compiled distribution of Brainstorm are now suffering from it.
This has to disappear ASAP, please. And I'll have to recompile Brainstorm immediately after.If you need to do extra stuff when setting the options, use the option type
editpref
together with a custom options panelpanel_nirstorm
orpanel_nirstorm_scouts
, or anythingpanel_nst_options
(anything that can't overlap with Brainstorm or other plugins).A simple example is available in
process_fem_tensor.m
/panel_femcond.m
.
To add drop-down menus, example code inpanel_process_select.m
, line 1064 (combobox).
yes; it's a historical debt we got at the beginning of Nirstorm, and we never really had time to fix it... I'll look at the code you mentioned and will let you know if I make any progress. Currently, I am very busy with writing my QBIN scholarship application; so it might take few weeks.
from nirstorm.
Then I will recompile Brainstorm without Nirstorm in the meantime.
Let me know when you want it to be integrated again in the compiled distribution.
from nirstorm.
brainstorm-tools/brainstorm3@63d470c
from nirstorm.
Actually those process cannot be executed in the compiled version as they required respectively either Cplex (for optimal montage) or Mcxlab (for fluence). So the better option would be remove t’ajuste those process
from nirstorm.
Actually those process cannot be executed in the compiled version as they required respectively either Cplex (for optimal montage) or Mcxlab (for fluence). So the better option would be remove t’ajuste those process
If you want to have two versions of the plugin, one including the functions that work in compiled mode only, and one with all the functions, please set this up as two different packages to download, and/or two different repositories.
This will not solve the initial issue, which is that with tens (or hundreds) of subjects, the current process definition would make Brainstorm impossible to start, even not in compiled mode. This needs to be fixed, regardless of this other problem.
from nirstorm.
This will not solve the initial issue, which is that with tens (or hundreds) of subjects, the current process definition would make Brainstorm impossible to start, even not in compiled mode. This needs to be fixed, regardless of this other problem.
i totally agree. But again; i am not the one who designed those process so badly... and i am already struggling with my own work for my phd... so once i find some time, i'll do it.
from nirstorm.
Hello Francois,
I started working on that issue but i was wondering if you could help me with GUI details. I am trying to get something like this:
Right now, I have (https://github.com/Edouard2laire/nirstorm/tree/OM_1):
I therefore have two questions:
-> How do i know when the user change the selection from the list ? I tried to add a callback, but it doesn't seems to be called like for the button.
-> What would be the best way to show the different scout associated to the selected atlas ?
Regards,
Edouard
from nirstorm.
I am trying to get something like this:
I'm not sure I follow exactly what you're trying to do.
Do you want to have a list of process options, or an independent panel that is called from an option editpref
in the process?
In the second case, you need to write a lot more code, and define all the interactivity of all the components manually.
How do i know when the user change the selection from the list ? I tried to add a callback, but it doesn't seems to be called like for the button.
You can attach a callback function ItemStateChangedCallback
to a drop-down combobox directly from the call to gui_component
:
https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/gui/gui_component.m#L124
Or you can it manually with java_setcb
, as it is done for the option types scout
and scout_confirm
in the pipeline editor:
https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/process/panel_process_select.m#L1197
What would be the best way to show the different scout associated to the selected atlas ?
Using the pipeline editor option directly instead of a separate panel.
Or copy-paste code from the option type scout
in panel_process_select
.
Does it help?
from nirstorm.
Do you want to have a list of process options, or an independent panel that is called from an option editpref in the process?
In the second case, you need to write a lot more code, and define all the interactivity of all the components manually.
Unfortunately, as the process is not using any file as input, we cannot use the process options, and we need a separate panel. By the way, in this case, is it better to put all the options in the separate pannel or have a mix of some options in the process pannel and some in the additional pannel?
Using the pipeline editor option directly instead of a separate panel.Or copy-paste code from the option type scout in panel_process_select.
Thx; i'll have a look
from nirstorm.
Making some progress; now i only needs to define the proper callbacks :)
from nirstorm.
Hello @ftadel
I was wondering, how can i recover the options selected in the panel from the process function?
I am curently doiing '''sProcess.options.fluencesCond.Comment = {'panel_nst_fluences', 'Scout: '};
sProcess.options.fluencesCond.Type = 'editpref';''' like in process_fem_tensors however, if i try to do
OPTIONS = sProcess.options.fluencesCond.Value; like in process_fem_tensors i can't recover the user input.
Edit: i was having a typo in the name of the function GetPanelContents; it's working now :)
from nirstorm.
is it better to put all the options in the separate pannel or have a mix of some options in the process pannel and some in the additional pannel?
I'd tend to put as many things as possible in the process options, as it does not require any additional coding.
Both can make sense, do as you think it looks more natural for your users.
from nirstorm.
Hi Francois,
I have been to make the process work when using a cortical scout. However, i am struggling to put all the options in the panel. When i try to add a new input after the scout selection, the order is not respected
Additionally, i tried to duplicate the code for the scout selection to be able to see the scout define on the head and on the cortex; but they get mixed together
Note: The file can be found here: https://github.com/Edouard2laire/nirstorm/blob/OM_1/bst_plugin/forward/panel_nst_fluences.m
from nirstorm.
It looks like you need to learn a bit about Java/Swing layouts for being able to do what you want...
For this purpose, you should probably try using a GridBagLayout or a BoxLayout, instead of a RiverLayout.
Maybe read a tutorial about layouts and then search for the Brainstorm code for examples of one or the other.
from nirstorm.
ok. I'll have a look this weekend; however i am not sure i can spend too much time in learning Java/swing
from nirstorm.
GridBadLayouts are not so complicated, but they require some organization...
It's a matrix of cells, like an excel spreadsheet. For each component you want to add to the interface, you define the location of the cell you want it to be in (gridx
, gridy
), what width (or height) it has relative to the total width (or height) of all the cells (weightx
, weighty
), and how it should be fill the cell (GridBagConstraints.HORIZONTAL
, GridBagConstraints.VERTICAL
or GridBagConstraints.BOTH
).
If you set a width (or height) to 0, it uses the minimum size of the component (set with .setMinimumSize, or defined automatically based on the contents of the component).
Example:
https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/gui/panel_search_database.m#L54
from nirstorm.
Java is so hard...
from nirstorm.
Sorry for the response delay, I'm traveling a lot at the moment...
Do you still need help with this?
I can help you may it look like what you want: describe precisely how it is like at the moment and how you'd like it to be, and I'll try to make this happen.
Did you manage to make the panel work the way you wanted, in terms of options selection?
from nirstorm.
Hello;
Did you manage to make the panel work the way you wanted, in terms of options selection?
Right now, the combination of the panel to select the scout and the process for the other options is working. I have been using it for the past few weeks and it so much better. I think the update of the fluences and Optimal montage will be a great update for Nrstorm (so thanks for pushing us into that direction :) )
Here is a sketch of what I would like the panel to looks like:
Right now, it looks like this:
My main struggle is to move the options from the process panel to the new pane (also, you can see that on my mac there is some overlapping between texts)
The left part is done, but I am struggling with the right part. It should contain 4 blocks.
- The reference to MCXlab article
- the Forward Model options:
- Segmentation file: Droplist to select which segmentation to use
- Segmentation label: button to select how is segmented the MRI (1 corresponding to skin or WM); can be automatically selected if the segmentation file contains the label information. (note: I have old segmentations file in my DB where this information is not present)
- Wavelength: text box ( typical content '685, 830')
- Simulation options
-
Number of photons (millions): textbox ( typically between 20 and 200)
-
GPUID: this option is here to select which GPU use to compute the simulation. We have two options:
either, like currently a text box where user can enter "1,2" to use GPU 1 and 2; or have the list of the available GPU to select (the info about the about the vaialbles GPU can be obtained using info=mcxlab('gpuinfo') returning a list where info(i).name is the name of the GPU i) -
Use default optical properties: Checkbox. (For now, we only support default; so should always be checked). To be able to support the other options, we should have copy the Media setting panel from MXC studio (http://mcx.space/wiki/upload/mcxstudio_windows.png) to specify the value of mua; mus; g, and n for each tissue and each wavelength. Might not be necessary for now.
- Output
- Output folder : folder selection
- Set threshold for fluences (reduce file size) : checkbox
- Threshold for fluences : value (1e-6(1/mm2/s))
- Overwrite Fluences : checkbox
Regards,
Edouard
from nirstorm.
also, you can see that on my mac there is some overlapping between texts
Most likely because you are not forcing the size of the objects somewhere, instead of letting the size of the window drive the whole thing.
Here is a sketch of what I would like the panel to looks like:
Have you checked existing examples?
It looks a lot like the panel you get with the menu "Import MEG/EEG", defined in panel_import_data.m:
https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/gui/panel_import_data.m
The main parent panel has a BorderLayout, the left side in BorderLayout.EAST (not adjusting with the window size, based on MinimumSize or PreferredSize - not sure), the right is BorderLayout.CENTER (size adjusted when resizing the window, default size based on PreferredSize).
In this file, both left and right panels are RiverLayouts, but could be written with BoxLayout (Vertical) or GridBagLayout.
from nirstorm.
Java interfaces are not easy to assemble programmatically, I understand the pain you're going through...
If you're really stuck and need help, post your code somewhere (a separate PR?) so I can have a look at it.
from nirstorm.
Hi;
Indeed, a little bit of help would be very welcome :) However, i am not sure about what you mean by a separate PR ? This one (#170) is not good ?
from nirstorm.
Indeed, I can get everything from there.
I'll push a commit for you to get this panel:
from nirstorm.
Oops, I can't push the code there.
Here are my updates:
panel_nst_fluences.zip
from nirstorm.
Thanks a lot ! I'll try to have a look assap :)
from nirstorm.
Will push the change of #170 today.
from nirstorm.
Hello @ftadel,
I made the change asked, so I am closing the issue :)
from nirstorm.
Looks great!
I restored the compilation of the nirstorm plugin in the compiled distriubtion of Brainstorm:
brainstorm-tools/brainstorm3@0428eb6
Could you try running the last compiled version of Brainstorm and make sure all the nirstorm basic functions and your recent changes work correctly?
Thanks
from nirstorm.
Related Issues (20)
- Check for negative values in process_nst_mbll.m is done on NIRS and AUX data HOT 2
- Scale of the sensitivity model HOT 1
- Merging two files from left and right hemisphere of the type cMEM sources - HbO | avg(5.000s,20.000s)
- Move to the Brainstorm plugin manager? HOT 17
- Issue with Import from Database - epoch time and baseline
- NIRSTORM Mini Course 2020 HOT 2
- Cat12 segmentation 5 tissue values HOT 3
- Brainstorm compilation issue HOT 1
- glm for different task duration HOT 2
- cplex error HOT 5
- How to cite NIRSTORM HOT 2
- image recon stats HOT 1
- Compute Voronoi volume-to-cortex interpolator (Again) HOT 1
- figure HOT 8
- Unable to download Colin27_4NIRS.zip HOT 1
- Saving Voronoi in the database is relatively slow HOT 1
- Unit test are not working
- [Smoothing] Compute head model from fluence
- Can't download cplex HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nirstorm.