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

Visualizing ROIs #545

Open
vpzgithub opened this issue Jul 8, 2024 · 2 comments
Open

Visualizing ROIs #545

vpzgithub opened this issue Jul 8, 2024 · 2 comments

Comments

@vpzgithub
Copy link

Hey,
Pycortex is a fantastic tool, but I'm currently facing some challenges. Simply put, I'm looking to draw specific ROIs on the unfolded cortical surface, such as certain brain areas from the AAL atlas. I would like to ask for your advice on how to draw these ROI outlines. This is because I want to show others which brain areas my data points belong to, those displayed on the unfolded map. I understand that I might need to use software like Inkscape, but I'm not clear about the overall process. Could you please clarify the general workflow for me?
Thank you very much for your assistance!

@yinxu1996
Copy link

I have the same problem.

@candytaco
Copy link
Contributor

candytaco commented Aug 12, 2024

The short of adding an ROI is to:

  1. add the ROI-defining data to the overlays.svg file:
    v = cortex.Volume(<data>, <subject>, <transform>) or if you have vertex-defined data v = cortex.Vertex(<data>, <subject>)
    cortex.add_roi(v, name = '<your ROI name>', open_inkscape = True)

    • note when open_inkscape is true, pycortex will automatically open inkscape for you after this method call, otherwise you will need to manually navigate to the subject directory and open the overlays.svg file
  2. Draw the ROI.

    • Inside the overlays.svg file, the data from step 1 will be in the data layer, inside a sublayer with the name that was passed to cortex.add_roi.
    • Inside the rois/shapes sublayer, there will be an empty layer with the same name.
    • Use the pen tool to draw the ROI boundary (ies) inside this sublayer inside roi/shapes.
    • You can draw as many shapes as need in this layer - all shapes will be treated as part of this ROI.
    • You can also rename the ROI by changing the sublayer name.
    • Shapes can go off the edge of the flatmap - pycortex will ignore those regions.
    • Shapes need to be closed, and can overlap other ROIs.
    • Save the file.
  3. To have the new ROI show up, when calling cortex.quickflat or cortex.webgl methods for the first time after adding ROIs, add the recache = True argument to the method call, e.g. cortex.webgl.show(<data>, recache = True).

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

No branches or pull requests

3 participants