-
Notifications
You must be signed in to change notification settings - Fork 133
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
Volume 2 Surface ROIs #170
Comments
No trivial way, I'm afraid. Easiest one-off thing to do would be to add your volume-space ROIs to the ROIs file one by one (assuming you have an MNI flatmap) using A more generic approach would be to convert your volume-space ROIs into vertex-space ROIs (using |
Outlining it totally fine. I am just doing Thomas Yeo's 17 networks, so not too bad. I can't figure out exactly what the cortex.add_roi function requires, though. I am pulling up the networks with: vol = cortex.Volume('Yeo_MNI152/17_networks.nii.gz', subject='MNI', xfmname='identity') How would I call cortex.add_roi? Thanks! |
You would just call: |
hmm, I have inkscape, but I get this error://anaconda/lib/python2.7/site-packages/cortex/utils.pyc in add_roi(data, name, open_inkscape, add_path, **kwargs) OSError: [Errno 2] No such file or directoryThe only files I have for MNI space are the ones you gave me a while ago, which just has the surfaces and the anatomical file. Am I missing a file I need? |
pycortex is trying to call |
AH okay, that is working. How do you I add it as an overlay on the original image after I edit the SVG file? |
Okay so if you've added new layers to the "rois" group in the SVG file, and drawn outlines in those layers, then they will show up as lines when you call webshow (you may have to throw a |
Great! Got it. Looks awesome now. Thanks so much Alex. |
Is there a way to only show a single ROI, or a certain set of ROIs? |
Slightly tricky. You could put them in separate layer groups (i.e. outside the 'rois' group), then tell webshow explicitly to include them. This should create an interface in the viewer that will let you turn them on or off individually, though that currently fails with more than 2-3 groups (we use it for rois, sulci, and gyri). The more manual approach is simply to set some rois to not be visible, that should propagate correctly iirc. |
Second approach seems a bit easier! How do I set some to not be visible? I can only set all visible in the browser. |
And, in general, is there an easy way to control the ROI features from the command line? For example, control the fill color, outline color et cetera? |
err what i meant by "set some to be not visible" was to do that in the SVG. Not a scalable solution by any stretch. You can control the ROI attributes in your cfg file.. there may also be a hacky way to set them online, but that's the easiest way. |
ahh okay got it. what are the variable names for the individual alpha levels for ROIs? |
I think it's 'stroke-opacity' in SVG-lingo, if you set that property in your options.cfg does it work? |
hmm, does not work. But I like the lines alone anyways. Thanks! |
I'm going to close this issue, since this all seems to be resolved, but as a side note, it's now possible to do somewhat fancier things with the different display layers in quickflat by adding each overlay separately through compositing. See https://gallantlab.github.io/auto_examples/quickflat/plot_advanced_compositing.html#sphx-glr-auto-examples-quickflat-plot-advanced-compositing-py for an example. (Note that this only works on the glrework-merged branch for now, which will (soon??) be merged into the master branch. |
@alexhuth "A more generic approach would be to convert your volume-space ROIs into vertex-space ROIs (using cortex.mapper functions), and then creating outlines for them programmatically. We have code for doing that but it's currently highly experimental (read: won't work without a shitload of tweaking and digging). I can point you in that direction if you like." I already have my ROIs in vertex-space. Could you please direct me on how to create the paths/outlines programmatically? |
AFAIK there isn't any functional code to create paths / lines around ROIs in the .svg file programmatically (note: older file for master branch is rois.svg, newer file created by new glrework-merged branch is overlays.svg). There may be stubs of things lying about somewhere in some little-used function, but unless @alexhuth can point you there, I suggest you add ROIs using the add_roi function as described above. |
I wrote some code to do this a while ago, but the results were a bit ugly and I don't think I ever added it to pycortex. I can try to dig it up, though it may be a while.. sorry @kwayeke! |
Thanks a million for your prompt response @alexhuth |
@alexhuth did you find something? |
if I have some MNI volume space ROIs, is there an easy way to get the outlines on the surface?
The text was updated successfully, but these errors were encountered: