-
Notifications
You must be signed in to change notification settings - Fork 189
[3/3] Fastgraph: Plot Fastgraphs #916
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
Draft
chinmaychinara91
wants to merge
60
commits into
brainstorm-tools:master
Choose a base branch
from
chinmaychinara91:plot-fastgraphs
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,224
−12
Draft
Changes from all commits
Commits
Show all changes
60 commits
Select commit
Hold shift + click to select a range
1c268bb
Add `subtightplot` external module
chinmaychinara91 81f6f3c
Add `ChanTable` to `export_channel_atlas` output
chinmaychinara91 2a135eb
Merge remote-tracking branch 'upstream/master' into plot-fastgraphs
chinmaychinara91 85ae038
Add `process_fastgraph` for plotting Fastgraph
chinmaychinara91 fe624c2
Add Fastgraph tutorial script
chinmaychinara91 1bbc413
Tutorial: Use `regexp` for getting stim site info
chinmaychinara91 62a0457
Tutorial: Add comments
chinmaychinara91 2e7b4e8
Merge remote-tracking branch 'upstream/master' into plot-fastgraphs
chinmaychinara91 0142d57
Move to subgroup `FAST graph`
chinmaychinara91 005acb6
Use type as `scout` instead of `atlas`
chinmaychinara91 8b3f628
Clean up
chinmaychinara91 f052c0f
Remove duplicate `process_channel_addloc` call
chinmaychinara91 46fbdf8
`channel_add_loc`: Explicitly check for channel type in the imported…
chinmaychinara91 e95a1da
Refactor tutorial script
chinmaychinara91 90d7342
Typo: Should be `Hz`
chinmaychinara91 7f05e98
Use `radio_label` for `SortMethod`
chinmaychinara91 7e55eea
Use `list_horizontal` type for regions list
chinmaychinara91 09a4617
Use `radio_linelabel` type for `colorscheme`
chinmaychinara91 e7d6085
Merge the consecutive labels
chinmaychinara91 e1a0f21
Bugfix: Handle region list
chinmaychinara91 78deddf
Use `FastGraph` capitalization in comments
chinmaychinara91 3cbdd5b
Merge remote-tracking branch 'upstream/master' into plot-fastgraphs
chinmaychinara91 d7ac485
Tutorial: Update to `process_cutstim`
chinmaychinara91 0943606
Tutorial: Update to `process_detrend_emd`
chinmaychinara91 8e4fe5f
Update header comments
chinmaychinara91 145e396
Validate all input files share the same channel file
chinmaychinara91 59ab031
Validate that all comments have valid bipolar channel names
chinmaychinara91 3056d8d
`5mm` radius for bipolar contacts
chinmaychinara91 39bf0dc
FG subplot grid: Keep it simple
chinmaychinara91 3ed0828
Clean
chinmaychinara91 c7a7dfe
Refine FastGraph axes and legend rendering
chinmaychinara91 7171dd5
Simplify cortex snapshot capture
chinmaychinara91 2eb5129
Add `Plot FastGraphs` to context menu
chinmaychinara91 ca0cdaa
Clean
chinmaychinara91 787ff28
Update GUI in `process_fastgraph.m`
rcassani 90ec8a7
Update `tutorial_fastgraph.m`
rcassani ec162ff
Merge remote-tracking branch 'brainstorm-tools/master' into plot-fast…
rcassani 162d8a3
GUI: Improve labels
rcassani 6a5f959
Bugfix: Left groups END with an apostrophe
rcassani 471cb40
Same output for `GroupSeegContacts` with or without locations
rcassani 077d56f
Clean up
rcassani 05d4723
Show figure when complete
rcassani 342c1d9
`GetOptions`, same order as in GUI process options
rcassani 8ba8ad4
Bugfix: Do not use hardcoded values to compute
rcassani 4f964e6
Bugfix: Check for regions only for `region` color scheme
rcassani 2f16fca
GUI: Input time windows in `[ms]`
rcassani 31f91d1
Merge remote-tracking branch 'upstream/master' into plot-fastgraphs
rcassani 0189ccb
Export channel atlas: Allow filtering which atlases to use
rcassani 7813043
Bugfix: Do not use hardcoded values to compute window samples (Part2)
rcassani 87aa6ae
Use Group name to sort SEEG contacts IFF for SEEG contacts w/o Loc
rcassani 3c1ba57
Clean up
rcassani aba0a53
Reorganize
rcassani 8ce75c3
Refactor
rcassani bffced1
Improve performance on linking axes
rcassani 39ceb53
Improve messages in the command window
rcassani d6adfbe
Remove unused input argument
rcassani 21a0d10
Simplify indexing and functions inputs
rcassani 5b02a5a
Process: Add `anatparcel` process option
rcassani 079c9de
Store SEEG contact Name and Scout together. Remove unnecessary indexing
rcassani cf102a2
Refactor to use Anatomical Atlas (volatlas) instead of Surf Atlas
rcassani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| Copyright (c) 2012, Felipe G. Nievinski | ||
| Copyright (c) 2010, Pekka Kumpulainen | ||
| Copyright (c) 2011, Nikolay S. | ||
| All rights reserved. | ||
|
|
||
| Redistribution and use in source and binary forms, with or without | ||
| modification, are permitted provided that the following conditions are | ||
| met: | ||
|
|
||
| * Redistributions of source code must retain the above copyright | ||
| notice, this list of conditions and the following disclaimer. | ||
| * Redistributions in binary form must reproduce the above copyright | ||
| notice, this list of conditions and the following disclaimer in | ||
| the documentation and/or other materials provided with the distribution | ||
|
|
||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
| AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
| ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
| LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
| CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
| SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
| INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
| CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
| POSSIBILITY OF SUCH DAMAGE. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| function h=subtightplot(m,n,p,gap,marg_h,marg_w,varargin) | ||
| %function h=subtightplot(m,n,p,gap,marg_h,marg_w,varargin) | ||
| % | ||
| % Functional purpose: A wrapper function for Matlab function subplot. Adds the ability to define the gap between | ||
| % neighbouring subplots. Unfotrtunately Matlab subplot function lacks this functionality, and the gap between | ||
| % subplots can reach 40% of figure area, which is pretty lavish. | ||
| % | ||
| % Input arguments (defaults exist): | ||
| % gap- two elements vector [vertical,horizontal] defining the gap between neighbouring axes. Default value | ||
| % is 0.01. Note this vale will cause titles legends and labels to collide with the subplots, while presenting | ||
| % relatively large axis. | ||
| % marg_h margins in height in normalized units (0...1) | ||
| % or [lower uppper] for different lower and upper margins | ||
| % marg_w margins in width in normalized units (0...1) | ||
| % or [left right] for different left and right margins | ||
| % | ||
| % Output arguments: same as subplot- none, or axes handle according to function call. | ||
| % | ||
| % Issues & Comments: Note that if additional elements are used in order to be passed to subplot, gap parameter must | ||
| % be defined. For default gap value use empty element- []. | ||
| % | ||
| % Usage example: h=subtightplot((2,3,1:2,[0.5,0.2]) | ||
|
|
||
| if (nargin<4) || isempty(gap), gap=0.01; end | ||
| if (nargin<5) || isempty(marg_h), marg_h=0.05; end | ||
| if (nargin<5) || isempty(marg_w), marg_w=marg_h; end | ||
| if isscalar(gap), gap(2)=gap; end | ||
| if isscalar(marg_h), marg_h(2)=marg_h; end | ||
| if isscalar(marg_w), marg_w(2)=marg_w; end | ||
| gap_vert = gap(1); | ||
| gap_horz = gap(2); | ||
| marg_lower = marg_h(1); | ||
| marg_upper = marg_h(2); | ||
| marg_left = marg_w(1); | ||
| marg_right = marg_w(2); | ||
|
|
||
| %note n and m are switched as Matlab indexing is column-wise, while subplot indexing is row-wise :( | ||
| [subplot_col,subplot_row]=ind2sub([n,m],p); | ||
|
|
||
| % note subplot suppors vector p inputs- so a merged subplot of higher dimentions will be created | ||
| subplot_cols=1+max(subplot_col)-min(subplot_col); % number of column elements in merged subplot | ||
| subplot_rows=1+max(subplot_row)-min(subplot_row); % number of row elements in merged subplot | ||
|
|
||
| % single subplot dimensions: | ||
| %height=(1-(m+1)*gap_vert)/m; | ||
| %axh = (1-sum(marg_h)-(Nh-1)*gap(1))/Nh; | ||
| height=(1-(marg_lower+marg_upper)-(m-1)*gap_vert)/m; | ||
| %width =(1-(n+1)*gap_horz)/n; | ||
| %axw = (1-sum(marg_w)-(Nw-1)*gap(2))/Nw; | ||
| width =(1-(marg_left+marg_right)-(n-1)*gap_horz)/n; | ||
|
|
||
| % merged subplot dimensions: | ||
| merged_height=subplot_rows*( height+gap_vert )- gap_vert; | ||
| merged_width= subplot_cols*( width +gap_horz )- gap_horz; | ||
|
|
||
| % merged subplot position: | ||
| merged_bottom=(m-max(subplot_row))*(height+gap_vert) +marg_lower; | ||
| merged_left=(min(subplot_col)-1)*(width+gap_horz) +marg_left; | ||
| pos_vec=[merged_left merged_bottom merged_width merged_height]; | ||
|
|
||
| % h_subplot=subplot(m,n,p,varargin{:},'Position',pos_vec); | ||
| % Above line doesn't work as subplot tends to ignore 'position' when same mnp is utilized | ||
| h=subplot('Position',pos_vec,varargin{:}); | ||
|
|
||
| if (nargout < 1), clear h; end | ||
|
|
||
| end |
|
rcassani marked this conversation as resolved.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
There is code to do this in Brainstorm. There is no need to add this external code.
See it in:
figure_timefreq('GetLayoutPositions'). This is called when TF maps for all channels.