Skip to content

Commit

Permalink
Change colormap from ".mat" file to QMRIColors.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
Stockless committed Dec 23, 2024
1 parent 603a297 commit df05e28
Showing 1 changed file with 32 additions and 2 deletions.
34 changes: 32 additions & 2 deletions KomaMRIPlots/src/ui/DisplayFunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1080,12 +1080,42 @@ function plot_phantom_map(
unit = " ms"
if key == :T1
cmax_key = 2500 / factor
colormap = relaxationColorMap("T1")
colors = relaxationColorMap("T1")
N = length(colors)
idx = range(0, 1; length=N)

# Create the colormap
colormap = [
(
idx[n],
string("rgb(",
floor(Int, colors[n].r * 255), ",",
floor(Int, colors[n].g * 255), ",",
floor(Int, colors[n].b * 255), ")"
)
)
for n in 1:N
]
elseif key == :T2 || key == :T2s
if key == :T2
cmax_key = 250 / factor
end
colormap = relaxationColorMap("T2")
colors = relaxationColorMap("T2")
N = length(colors)
idx = range(0, 1; length=N)

# Create the colormap
colormap = [
(
idx[n],
string("rgb(",
floor(Int, colors[n].r * 255), ",",
floor(Int, colors[n].g * 255), ",",
floor(Int, colors[n].b * 255), ")"
)
)
for n in 1:N
]
end
elseif key == :x || key == :y || key == :z
factor = 1e2
Expand Down

0 comments on commit df05e28

Please sign in to comment.