Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
dfsp-spirit committed Mar 27, 2021
2 parents f469172 + 4455fa2 commit f2ddaba
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
fsbrain Changes
===============

Version 0.4.2
-------------
- Fix bug in makecmap_options 'range' handling, see #19 and #20
- Improve documentation for makecmap_options 'range' handling: new entry in fsbrain FAQ vignette
- Expose 'grid_like' parameter in vis.export.from.coloredmeshes to allow plotting a horizontal strip of images


Version 0.4.1
-------------
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: fsbrain
Type: Package
Title: Managing and Visualizing Brain Surface Data
Version: 0.4.1
Version: 0.4.2
Authors@R: person("Tim", "Schäfer", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0002-3683-8070"))
Maintainer: Tim Schäfer <[email protected]>
Description: Provides high-level access to neuroimaging data from standard software packages like 'FreeSurfer' <http://freesurfer.net/> on the level of subjects and groups. Load morphometry data, surfaces and brain parcellations based on atlases. Mask data using labels, load data for specific atlas regions only, and visualize data and statistical results directly in 'R'.
Expand Down
27 changes: 25 additions & 2 deletions vignettes/fsbrain_faq.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ vis.subject.morph.native('~/mysubjects_dir', 'subject1', 'curv', rglactions=rgla

Yes, this can be achieved in different ways:

Option 1: Use `rglactions` in combination with `limit_fun`:
The first option is to use `rglactions` in combination with `limit_fun`:

```{r, eval = FALSE}
rgla = list('trans_fun'=limit_fun(2,3));
Expand All @@ -137,13 +137,21 @@ This will limit your data to the range 2 to 3.

If you want the data values outside the given range to be plotted as background (in the color for `NA` values), use `limit_fun_na` instead of `limit_fun`.

Option 2: If you want more flexibility, e.g., you also need support for a larger data range than the real data range of your subject, e.g., when plotting group data to ensure that all subjects use the same colors for identical values, you should use the 'range' entry in 'makecmap_options' instead:
See the answer to the next question for a second option.


### How can I enforce fixed colorbar settings (i.e., one color should represent the same value) across several images?


This typically means that you want a colorbar that shows a larger data range than the real data range of your subject, for some of the subjects. In this case you should use the 'range' entry in 'makecmap_options':

```{r, eval = FALSE}
makecmap_options = list('range'=c(0,6));
vis.subject.morph.native('~/mysubjects_dir', 'subject1', 'thickness', makecmap_options = makecmap_options);
```

This is useful when plotting group data to ensure that all subjects use the same colors for identical values, or when comparing statistical results.


### How can I change the colormap for the plots?

Expand Down Expand Up @@ -299,6 +307,21 @@ vis.subject.morph.native(sjd, sj, 'thickness', rglactions = list('shift_hemis_ap

If you need more customization options, have a look at the `shift.hemis.apart` function. If you pass a named list in the rglactions for 'shift_hemis_apart' (like in the previous example), the entries are passed on to that function.

### When plotting several views, can I have the subplots arranged in a horizontal strip (rather than 2x2 tiles)?

There is no 'view' setting for that yet (like 't4' for 4 tiles), but you can set the 'grid_like' to false to get a horizontal strip of images. Here is an example:

```{r, eval = FALSE}
subjects_dir = fsbrain::get_optional_data_filepath("subjects_dir");
view_angles = get.view.angle.names(angle_set = "t4");
coloredmeshes = vis.subject.morph.native(subjects_dir, "subject1", "thickness", views=NULL);
vislayout.from.coloredmeshes(coloredmeshes, view_angles = view_angles, grid_like=FALSE, output_img="~/fsbrain_horizontal.png");
```

If you want a colorbar, you can use `vis.export.from.coloredmeshes` instead of `vislayout.from.coloredmeshes`.

## Various topics

### Can I integrate the plots produced by *fsbrain* into an R Markdown document (the R equivalent of a Python Jupyter notebook)?
Expand Down

0 comments on commit f2ddaba

Please sign in to comment.