diff --git a/README.md b/README.md index 747e2cb..a15abbd 100644 --- a/README.md +++ b/README.md @@ -37,3 +37,10 @@ cmap = relaxationColorMap("T1") VIEW(x,c=cmap) # Do not use range limits here! ```

Again, "VIEW" refers to your favorite viewing software.

+


If the simplified processing is invoked WITH use of range limits, then the +distinction is lost between invalid values and low-but-valid values. See second image in the +example below: it represents a circular object with a T1 value that is gradually increasing +from top to bottom, but only valid within a circular "object", the outside thereof representing +unknown T1 values.

+ +![image info](./rangeNoRange.jpg) \ No newline at end of file diff --git a/docs/src/example.md b/docs/src/example.md index b5d9747..b3f15db 100644 --- a/docs/src/example.md +++ b/docs/src/example.md @@ -10,32 +10,45 @@ The generated colormap can be easily integrated with multiple plotting library l For `Makie.jl` the colormap can be directly used like `heatmap(x,colormap=cmap,colorrange=(loLev,upLev))` ```@example 2 -using FileIO -using Downloads using qMRIColors using CairoMakie -url = "https://github.com/mfuderer/colorResources/raw/refs/heads/main/sampleT1map.jld" -dest_path = "sampleT1map.jld" -# Download the file -Downloads.download(url, dest_path) -x = FileIO.load("sampleT1map.jld")["sampleT1map"] +# ----- Make test object: gradually increasing T1, but invalid outside a circle +size = 256; center = size÷2+1; radius = 100; origin = CartesianIndex(center,center) +d(x::CartesianIndex, y::CartesianIndex) = √( (x[1]-y[1])^2 + (x[2]-y[2])^2 ) +row = [10*i for i in 1:size] +testT1= zeros(size,size) +testT1 .= row +# Set invalid values to 0 +allidx = CartesianIndices(testT1) +invalid = allidx[ d.(origin, allidx) .> radius]; +testT1[invalid] .= 0 +# ---------------------------------------------- Test object made + +# -------------------- Display test object the correct and the wrong way loLev = 700 -upLev = 1500 -cmap,imClip = relaxationColorMap("T1",x,loLev,upLev) +upLev = 2000 begin f=CairoMakie.Figure() - ax=Axis(f[1,1],aspect = DataAspect(),title = "clip") + ax=Axis(f[1,1],aspect = DataAspect(),title = "Using imClip") + cmap,imClip = relaxationColorMap("T1",testT1,loLev,upLev) h=heatmap!(ax,rotr90(imClip),colormap=cmap,colorrange=(loLev,upLev)) Colorbar(f[1,2],h) hidedecorations!(ax) - ax=Axis(f[2,1],aspect = DataAspect(),title = "no clip") - h=heatmap!(ax,rotr90(x),colormap=cmap,colorrange=(loLev,upLev)) + ax=Axis(f[2,1],aspect = DataAspect(),title = "wrong: simplified, \n with range") + cmap = relaxationColorMap("T1") + h=heatmap!(ax,rotr90(testT1),colormap=cmap,colorrange=(loLev,upLev)) Colorbar(f[2,2],h) hidedecorations!(ax) + ax=Axis(f[3,1],aspect = DataAspect(),title = "OK: simplified, \n no range") + cmap = relaxationColorMap("T1") + h=heatmap!(ax,rotr90(testT1),colormap=cmap) + Colorbar(f[3,2],h) + hidedecorations!(ax) + # clean up plot colsize!(f.layout, 1, Aspect(1,1)) resize_to_layout!(f) @@ -49,8 +62,14 @@ end Using GR backend ```@example 3 using FileIO +using Downloads using qMRIColors +using CairoMakie +url = "https://github.com/mfuderer/colorResources/raw/refs/heads/main/sampleT1map.jld" +dest_path = "sampleT1map.jld" +# Download the file +Downloads.download(url, dest_path) x = FileIO.load("sampleT1map.jld")["sampleT1map"] loLev = 700 diff --git a/rangeNoRange.jpg b/rangeNoRange.jpg new file mode 100644 index 0000000..548e732 Binary files /dev/null and b/rangeNoRange.jpg differ