QMRIColors.colorLogRemap
— FunctioncolorLogRemap(oriCmap, loLev=0.0, upLev=size(cmap)[1])
Applies logarithmic scaling to oriCmap
based on loLev
and upLev
.
Arguments
oriCmap
: Original colormap array.loLev
: Lower bound of the color range.upLev
: Upper bound of the color range.
Returns
logCmap
: Colormap with logarithmic scaling applied.
QMRIColors.relaxationColorMap
— FunctionrelaxationColorMap(maptype::AbstractString, x::AbstractArray, loLev=minimum(x), upLev=maximum(x))
Applies a color mapping to a numerical array x
based on a specified relaxation map type. Reads color data from a CSV file and adjusts values in x
to provide a color-coded visualization.
This function is commonly used in data visualization, especially for MRI relaxation maps, to display data in a color-coded format for easier interpretation.
Arguments
maptype::AbstractString
: The relaxation map type to use for color mapping. Common values include"T1"
,"T2"
,"R1"
,"R2"
, (see documentation).x::AbstractArray
: An array of numerical values to be color-mapped.loLev
: Lower bound for color mapping. Defaults to the minimum ofx
.upLev
: Upper bound for color mapping. Defaults to the maximum ofx
.
Returns
rgb_vec
: A vector of RGB colors representing the mapped values.xClip
: A modified version ofx
with values adjusted based onloLev
andupLev
.
Description
- Calls
read_map_csv(maptype)
to load the colormap. - Adjusts
x
based onloLev
andupLev
to producexClip
. - Maps values to colors using
colorLogRemap
and converts to RGB.
QMRIColors.relaxationColorMap
— FunctionrelaxationColorMap(maptype::AbstractString, loLev=0, upLev=256)
Simplified variant of the above function. Only generates the RGB vector of colors without modifying an array x
.