save an image of the colormap like a colorbar in matlab/matplotlib

Questions about Anatomist manipulation

Moderators: riviere, denghien

guillaume
Posts: 44
Joined: Wed Mar 15, 2006 10:29 am
Location: Institut des Neurosciences de la Timone
Contact:

save an image of the colormap like a colorbar in matlab/matplotlib

Postby guillaume » Wed Aug 01, 2018 3:46 pm

Hello,

until now I used to take a caption of the screen with the anatomist colormap window open and then manually crop the screenshot before I can incorporate it in my figure, which is not convenient.

is there a way to save on the disk an image of the colormap automatically using pyAnatomist?

thks for your help!
gui

User avatar
riviere
Site Admin
Posts: 1358
Joined: Tue Jan 06, 2004 12:21 pm
Location: CEA NeuroSpin, Saint Aubin, France
Contact:

Re: save an image of the colormap like a colorbar in matlab/matplotlib

Postby riviere » Wed Aug 15, 2018 9:18 pm

Hi Guillaume,
Sorry I didn't see your post, the forum notification seems broken...
Palette images are all images in jpeg, png, or ima formats, but I guess what you want is the colormaps with scale factors applied, and associated image or texture values, right ?
Well, there is nothing builtin for that, it could be something we may add...
There is a colormap module, which allows to do it interactively: view the object in a window, select the object in the main window, and in the right-click menu, select "color -> show/hide palette". The palette will display in windows showing the selected object. A "save" button allows to save it. I guess this is what you need, but there is no dedicated API to do it in python. Anyway it's programmed in python (and using matplotlib actually) so there is definitely a way to call it from a script, but we have to dig in the code of the plugin. I'll tell you a bit later when I have a solution...
Denis


Return to “Anatomist”

Who is online

Users browsing this forum: No registered users and 0 guests