Skip to content
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

visualising group difference maps #40

Open
MaLiUHH opened this issue Jun 29, 2022 · 8 comments
Open

visualising group difference maps #40

MaLiUHH opened this issue Jun 29, 2022 · 8 comments
Assignees
Labels
question Usage question.

Comments

@MaLiUHH
Copy link

MaLiUHH commented Jun 29, 2022

Dear Mr. Schäfer,
first of all, thanks for the amazing package!
I am currently using group.morph.agg.standard.vertex to calculate group difference maps (i.e. agg.data.group1 - agg.data.group2) and display it using vis.data.on.fsaverage. I played around with RColorBrewer::brewer.pal(5, name = "RdBu")) as a diverging colour palette.
CC-SCavg_01

  1. The colour bar doesn't seem centred around 0 = white. The scale takes slightly off to the right/positive side. Is there a way to centre it manually?
    Edit: I managed this by adding the symm argument to makecmap_option = list('colFn'=RdBu,'symm'=TRUE)

  2. As you may also see, the differences are actually quite small. Do you have any recommendations on how to improve visibility? Can one for example increase the colour intervalls (small difference = stronger colour)?

  3. I tried using surface = inflated, which resulted in a overlay of both hemispheres. Do you have any suggestions on how to fix that?
    CC-SCavg_02

Thank you!

@dfsp-spirit
Copy link
Owner

dfsp-spirit commented Jul 1, 2022

Hi @MaLiUHH,

sorry for the rather late reply,

  • Point 1: seems done already (in the way I would recommend)
  • Point 2: I think there is an option somewhere to limit the data being displayed to a certain range of values. That would give better colors. It's described in the FAQ, see question Can I limit the data range, including the min and max values displayed on the color bar?.
  • Point 3: there is an easy fix, see Views other than t4 garbled for inflated and vis.x.on.subject #7. In short, pass rglactions = list('shift_hemis_apart'=TRUE) as an additional parameter to vis functions to have them shift the hemispheres apart. The coordinates in the mesh files really overlap, causing this behavior.

Some more details on Point 2: This happens because you have (very few) points with higher values in your data, look at a histogram, or at the area very close to medial wall to see them.

Please let me know whether that was helpful, or if you need more help.

Best,

Tim

@dfsp-spirit dfsp-spirit self-assigned this Jul 1, 2022
@dfsp-spirit dfsp-spirit added the question Usage question. label Jul 1, 2022
@dfsp-spirit
Copy link
Owner

Did you get it to work, @MaLiUHH ?

@MaLiUHH
Copy link
Author

MaLiUHH commented Jul 5, 2022

Dear Tim, I am sorry for the late reply. I did not yet had the chance to try your suggestions. Sorry also about the redundance for point 3, I forgot to check the closed issues. I will let you know as soon as possible.

@MaLiUHH
Copy link
Author

MaLiUHH commented Jul 7, 2022

Dear Tim,

  • fix 3 worked like a charm.
  • your hint towards 'limit_fun' worked as well, but I ended up using 'range' instead to adapt the scale for multiple images equally

resulting in the outcome as hoped for
Thanks a lot!!!

@MaLiUHH
Copy link
Author

MaLiUHH commented Jul 7, 2022

One more question - probably also a really simple one:
I would like to display an atlas annotation on top of my group difference maps. I managed to display fsaverage with the annot on its own (vis.subject.annot(subjects_dir , "fsaverage" , 'HCP-MMP1', views = c("si"), outline = TRUE)), but I just can't figure out how to combine both functions. I promise, I checked the FAQ and previous issues this time ;)

Also, I was unsure if I should have opened a new issue for this question. My apologies if its inconvenient.

@dfsp-spirit
Copy link
Owner

I think due to a bug, this is currently limited to displaying the atlas outine in black/white, but if that is fine for you, see #28 for a solution.

No worries about not finding stuff in the FAQ, it's rather hidden and I don't expect people to read it (I just hope it shows up in searches). It's not like I would read FAQs myself. ;)

@MaLiUHH
Copy link
Author

MaLiUHH commented Jul 8, 2022

hmmm ok, I've actually read this one...phew...
I was able to follow the code AndrewLawrence posted and adapted it so that morph_data_both loads my pre-calculated difference map:
vis.symmetric.data.on.subject(subjects_dir, "fsaverage", morph_data_both = aggdata_group1-group2, surface = "inflated", views = "t4", bg=aparc_outline)

But the problem is in fact, that my difference maps are whole-brain and each vertex has a value. So basically there is no annot outline left to see. So I guess my question remains. Is there a way to display the annot on top of the map instead of having it as the background.

Out of curiosity I did try just to just switch up the input:
vis.symmetric.data.on.subject(subjects_dir, "fsaverage", morph_data_lh = aparc_outline$lh, morph_data_rh = aparc_outline$rh, surface = "inflated", views = "t4", bg=aggdata_group1-group2)
receiving "error in file(fillepath, "rb") : invalid 'description' argument" + a few warnings which I interpreted by now as not supporting my map as 'bg' file format??

Best

@MaLiUHH
Copy link
Author

MaLiUHH commented Oct 10, 2022

Dear Tim, I just got reminded of my last issue. Would you mind taking another look?
Best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usage question.
Projects
None yet
Development

No branches or pull requests

2 participants