DiedrichsenLab / SUITPy

Other
15 stars 5 forks source link

Trouble loading on flatmap.plot #11

Open milinkim opened 2 months ago

milinkim commented 2 months ago

Dear Diedrichsen Lab,

I've been using the wonderful SUIT toolbox for several years now. Thank you so much!

But after our cluster system updated from Python 7 to Python 3.10, there has been a problem plotting the data.

It reads in using flatmap.vol_to_surf and then when i try loading with flatmap.plot(data, cmap, threshold..., render='matplotlib'), but I get this error:

ax=_redner_matplotlib(vertices, faces, color, borders, File ...SUITPy/flatmap.py in rendermatplotlib polygon =Polygon(certices[f,0:2], True)

TypeError: 'Polygon.init() takes 2 positional argument but 3 were given

When I load the same nii file in matlab SUIT, it plots well. But suddenly it is not working on python. I've tried my best to figure it out but I couldn't.

Thank you again!

jdiedrichsen commented 2 months ago

Which version of SUITPy are you using? The 1.3.2 release, or did you clone the master from github?

I don't get a problem with the current Master branch - but the lines 576-578 are different from what is displayed in your error message:

Master Branch: for i,f in enumerate(faces[face_in]): polygon = Polygon(vertices[f,0:2]) patches.append(polygon)

So, not sure if you have some edits - or just an outdated version. I cannot see any changes to the Polygon constructor with new versions of matplotlib, but do let me know which version you are using as well.

J

milinkim commented 2 months ago

Hello Jörn!

I am using version 1.3.2. I have tried also without polygon =Polygon(certices[f,0:2]) thinking it might be the problem. The plot comes out but without any colors. But I think i found the reason! It is the new matplotlib version that wasn't compatible with the environment that I was using- because i think the problem arouse from not able to 'get c_map' from 'matplotlib.cm'. Now it works.

Thank you!!