kuwisdelu / Cardinal

Mass spectrometry imaging toolbox
http://www.cardinalmsi.org
36 stars 14 forks source link

Can I rotate the image (plot) #46

Closed qingnanl closed 3 weeks ago

qingnanl commented 3 weeks ago

Thanks for the great work here! I wonder if there is any way to rotate the visualization of the data (output of function 'image'), such as flipping vertically or rotating 90 degrees. Sorry, I am not very familiar with the format of the visualization output. Many thanks!

Qingnan

kuwisdelu commented 3 weeks ago

For the image only, the easiest way to do this would be to change the image formula.

The default for ?Cardinal::image is intensity ~ x * y. You could pass the formula as intensity ~ y * x to flip the x/y axis, for example.

If you want to apply spatial transformations to the dataset itself, you can transform the coordinates in coord(obj) as you like.