Plot Mask on EVE Template using Python and Nilearn
map2_eve.Rd
This function plots a mask image on the EVE template using Python's Nilearn library and optionally saves the plot as an image. It ensures the required Python libraries are installed, and it handles the appropriate Conda environment setup.
Arguments
- mask_img_path
A string representing the file path to the mask NIfTI file.
- cmap
The colormap to use. Either a string (name of a matplotlib colormap) or a matplotlib colormap object. Default is 'bwr_r'.
- alpha
Transparency level for the overlay. Default is 1.
- save_path
A string representing the file path where the plot image should be saved (e.g., "output.png"). If NULL, the plot will be shown interactively instead of saved. Default is NULL.
- ...
Additional arguments to customize the anatomical plot. These arguments are passed directly to the Python function
nilearn.plotting.plot_anat
. You can specify parameters such astitle
,display_mode
,cut_coords
,dim
, etc. For more details on available options, refer to the official documentation at: https://nilearn.github.io/stable/modules/generated/nilearn.plotting.plot_anat.html
Details
The function first detects the system architecture (ARM or x86) and ensures the appropriate Conda environment is set up (Miniforge for ARM or Miniconda for x86).
It then checks and installs the required Python libraries: nilearn
, nibabel
, and matplotlib
.
The function loads the Python environment and calls the plot_mask_on_eve
function, which plots the mask on the EVE template. If save_path
is provided, the plot is saved as an image at the specified location.