dfsp-spirit / fsbrain

R library for structural neuroimaging. Provides high-level functions to access (read and write) and visualize surface-based brain morphometry data for individuals and groups.
Other
65 stars 13 forks source link

I have a question about lh_region_value_list & rh_region_value_list #29

Closed wjddyd66 closed 3 years ago

wjddyd66 commented 3 years ago

My code Like This...

subjects_dir = fsbrain::get_optional_data_filepath("subjects_dir");
subjects_list = c("subject1", "subject2");
subject_id = 'subject1';

root_path = '/home/'

surface = 'white';
atlas = 'aparc';
colmap = colorRampPalette(rev(RColorBrewer::brewer.pal(9, name="Reds")))

## Visualization
file_path = paste(root_path,'result.png')
lh_region_value_list = list("unknown"=1);
rh_region_value_list = list("lateraloccipital"=0);
vis.region.values.on.subject(subjects_dir, subject_id, atlas, lh_region_value_list, rh_region_value_list,
                             draw_colorbar=FALSE, makecmap_options = list('colFn'=colmap,'range'=c(0, 0.05)), views = 't9');

How can I avoid putting any values ​​in lh_region_value_list?

lh_region_value_list = list();

Or if i don't put "lh_region_value_list" it won't work.

I couldn't find it in the manual, so I left it as an Issue....

dfsp-spirit commented 3 years ago

What is your intention? Do you want the left hemi to disappear, or do you want it to be completely white, or something else?

If you do not want the left hemisphere to be rendered at all, you can use lh_region_value_list=NULL.

If you want it all white, use lh_region_value_list = rep(NA, 36); (aparc atlas has 36 regions).

wjddyd66 commented 3 years ago

Thanks for reply...

But have a question of your answer.

I tried lh_region_value_list=NULL But, Result is below. image

There is no picture of left-hemi....

And lh_region_value_list = rep(NA, 36); Like this... image

left-hemi is black...

I simply want the result to be left-hemi white, with no surface painted. Is it possible as a package of fsbrain currently provided?

dfsp-spirit commented 3 years ago

The first picture you show works as intended: setting the list to NULL disables drawing of the mesh.

The color in the second picture is the default background color, which is black for fsbrain <= 0.4.3.

The background color can be configured in the current dev version of fsbrain, and it defaults to white there. So if you install the dev version and simply re-run the second command, you will get what you want:

fsbrain_white

To install the dev version, you will have to do 3 things:

1) start a fresh R session in which fsbrain is NOT loaded 2) install like this:

install.packages("devtools");
devtools::install_github("dfsp-spirit/fsbrain", ref="geodesic");

3) start a fresh R session (just to be sure) and load fsbrain. To verify that you have the proper version, run packageVersion("fsbrain"), which should print 0.5.0.

wjddyd66 commented 3 years ago

Thank you it works!!!!

dfsp-spirit commented 3 years ago

Great to hear that!