[Neuroimaging] [pysurfer] making background brain more transparent

vanessa sochat vsochat at stanford.edu
Fri Jul 31 19:09:01 CEST 2015


Can't you just save as an svg, and then edit the color / alpha of the path?
Like:

<svg>
<g id="icon-cart">
<path opacity=0.8 fill="red" d="M30.549 6.077c-1.062-0.303-2.169
0.312-2.473 1.374l-0.157
0.549h-18.654l-0.281-2.248c-0.125-1.001-0.976-1.752-1.985-1.752h-5c-1.105
0-2 0.895-2 2s0.895 2 2 2h3.234l1.781 14.248c0.125 1.001 0.976 1.752 1.985
1.752h17c0.893 0 1.678-0.592
1.923-1.451l4-14c0.303-1.062-0.312-2.169-1.374-2.473zM16 16v-2h4v2h-4zM20
18v2h-4v-2h4zM16 12v-2h4v2h-4zM9.516 10h4.484v2h-4.234l-0.25-2zM10.016
14h3.984v2h-3.734l-0.25-2zM10.516 18h3.484v2h-3.234l-0.25-2zM24.491
20h-2.491v-2h3.063l-0.571 2zM25.634 16h-3.634v-2h4.206l-0.571 2zM26.777
12h-4.777v-2h5.349l-0.571 2zM8 29c0-1.657 1.343-3 3-3s3 1.343 3 3c0
1.657-1.343 3-3 3-1.657 0-3-1.343-3-3zM20 29c0-1.657 1.343-3 3-3s3 1.343 3
3c0 1.657-1.343 3-3 3-1.657 0-3-1.343-3-3z"></path>
</g>
</svg>

Play around with it here:

http://codepen.io/vsoch/pen/JdwKNQ

On Fri, Jul 31, 2015 at 9:54 AM, Kirstie Whitaker <kw401 at cam.ac.uk> wrote:

> Sorry - Basically I want to just make the background brain stand out a
> little less in my figures so what I'd hoped was that it would be possible
> to simple "fade out" the background brain (not my ROI overlays) a little.
>
> If I were showing a slice in matplotlib I'd do something like this:
>
> import  numpy as np
> import matplotlib.pylab as plt
> a = np.random.rand(100,100)
> plt.imshow(a, alpha=0.5, cmap='gray')
> plt.show()
>
> (with maybe a being my brain slice rather than just random numbers)
>
> Sorry I wasn't clear - does that help??
>
> Kx
>
> On 31 July 2015 at 15:54, Michael Waskom <mwaskom at stanford.edu> wrote:
>
>> Hi Kristie,
>>
>> I think I'm a bit confused about your question. What do you mean make it
>> *more* transparent? As far as I know, the brain geometry is drawn at full
>> opacity so I might not understand what you are trying to do.
>>
>> Best,
>> Michael
>>
>> On Fri, Jul 31, 2015 at 3:00 AM, Kirstie Whitaker <kw401 at cam.ac.uk>
>> wrote:
>>
>>> Hi everyone,
>>>
>>> I'd like to make the background brain in pysurfer a little more
>>> transparent, so I'm looking for an "alpha" flag or something similar. I
>>> don't think this yet exists according to the documentation on changing
>>> the curvature color scheme
>>> <http://pysurfer.github.io/documentation/custom_viz.html#changing-the-curvature-color-scheme>
>>> but I wonder if anyone has a hack that I could implement?
>>>
>>> An alternative to the alpha parameter would be to create a fifth
>>> (personalised) color scheme perhaps?
>>>
>>> Thanks!
>>> (This is also a question on neurostars.org
>>> <http://neurostars.org/p/3315/> if anyone wants to answer there
>>> instead!)
>>>
>>> Kx
>>>
>>> --
>>> Kirstie Whitaker, PhD
>>> Research Associate
>>>
>>> Department of Psychiatry
>>> University of Cambridge
>>>
>>> *Mailing Address*
>>> Brain Mapping Unit
>>> Department of Psychiatry
>>> Sir William Hardy Building
>>> Downing Street
>>> Cambridge CB2 3EB
>>>
>>> *Phone: *+44 7583 535 307
>>> *Website:* www.kirstiewhitaker.com
>>>
>>>
>>> _______________________________________________
>>> Neuroimaging mailing list
>>> Neuroimaging at python.org
>>> https://mail.python.org/mailman/listinfo/neuroimaging
>>>
>>>
>>
>> _______________________________________________
>> Neuroimaging mailing list
>> Neuroimaging at python.org
>> https://mail.python.org/mailman/listinfo/neuroimaging
>>
>>
>
>
> --
> Kirstie Whitaker, PhD
> Research Associate
>
> Department of Psychiatry
> University of Cambridge
>
> *Mailing Address*
> Brain Mapping Unit
> Department of Psychiatry
> Sir William Hardy Building
> Downing Street
> Cambridge CB2 3EB
>
> *Phone: *+44 7583 535 307
> *Website:* www.kirstiewhitaker.com
>
> _______________________________________________
> Neuroimaging mailing list
> Neuroimaging at python.org
> https://mail.python.org/mailman/listinfo/neuroimaging
>
>


-- 
Vanessa Villamia Sochat
Stanford University
(603) 321-0676
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/neuroimaging/attachments/20150731/09cd2bcc/attachment.html>


More information about the Neuroimaging mailing list