Methods list
MIRTjim.MIRTjim
MIRTjim.jim_def
MIRTjim.jim_stack
MIRTjim._aspect_ratio
MIRTjim.caller_name
MIRTjim.jim
MIRTjim.jim
MIRTjim.jim
MIRTjim.jim
MIRTjim.jim!
MIRTjim.jim!
MIRTjim.jim!
MIRTjim.jim!
MIRTjim.jim!
MIRTjim.jim!
MIRTjim.jim!
MIRTjim.jim!
MIRTjim.jim!
MIRTjim.mid3
MIRTjim.nothing_else
MIRTjim.prompt
MIRTjim.prompt
MIRTjim.wait_for_key
Methods usage
MIRTjim.MIRTjim
— ModuleModule MIRTjim
exports the "jiffy image display" method jim
, and the helper methods:
caller_name
mid3
prompt
MIRTjim.jim_def
— Constantjim_def
Global Dict
of default settings.
MIRTjim.jim_stack
— Constantjim_stack
Global Vector{Any}
used with :push!
and :pop!
to store and retrieve settings.
MIRTjim._aspect_ratio
— Method_aspect_ratio(x, y)
Determine aspect_ratio
argument for heatmap.
The user can set the default by invoking (e.g.) jim(:aspect_ratio, :equal)
.
Otherwise, the default from jim_def[:aspect_ratio]
is :infer
, which will lead to :equal
if x
and y
have the same units, or if Δx ≈ Δy
(square pixels). Otherwise revert to :auto
.
MIRTjim.caller_name
— Methodcaller_name() or caller_name(;level=4)
Return "filename line fun():" as a string to describe where this function was called.
Stack levels:
- 1: #caller_name
- 2: caller_name()
- 3: function that invoked caller()
- 4: the calling function we want to return
Hence the default level is 4, but we increment it by one in case user says @show caller_name()
in which case stack[3] is a macro expansion.
MIRTjim.jim!
— Methodjim(z, title::String ; kwargs...) or jim!(pp::Plot, ...)
MIRTjim.jim!
— Methodjim(z::AbstractArray{<:AbstractArray{<:Union{Number,Colorant}}} ; kwargs...)
jim!(pp::Plot, ...)
Display an array of images. Same arguments and options as display of a 3D stack of images. The argument ratio
defaults to /(Plots.default(:size)...)
and affects the default ncol
value.
MIRTjim.jim!
— Methodjim(..., z::AbstractArray{<:NTuple{N,Number} where N}, ... ; kwargs...)
jim(..., z::AbstractArray{<:AbstractVector{<:Number}}, ... ; kwargs...)
jim!(pp::Plot, ...)
Stack Tuple or Vector along the last dimension.
MIRTjim.jim!
— Methodjim(z::Matrix{<:Colorant}; kwargs...) or jim!(pp::Plot, ...)
jim!(pp::Plot, ...)
For RGB images, ignore clim
, color
, x
, y
.
MIRTjim.jim!
— Methodjim(z, ...) or jim!(pp::Plot, z, ...)
A jiffy image display of z
using heatmap
.
in
z
image, can be 2D or higher, if higher then it usesmosaicviews
option
aspect_ratio
; default:equal
for square pixels (see_aspect_ratio
)clim
; default(minimum(z),maximum(z))
color
(colormap, e.g.:hsv
); default:grays
colorbar
(e.g.:none
); default:legend
gui
callPlots.gui()
immediately?; defaultfalse
prompt
callprompt()
immediately?; defaultfalse
ncol
for mosaicview for 3D and higher arrays; default0
does auto select "Number of tiles in column direction."nrow
for mosaicview for 3D and higher arrays; default0
does auto selectpadval
padding value for mosaic view; defaultminimum(z)
line3plot
lines around sub image for 3d mosaic; defaulttrue
line3type
line type around sub image for 3d mosaic; default(:yellow)
mosaic_npad
# of pixel padding for mosaic view; default1
fft0
if true use FFTView to display (2D only); defaultfalse
title
; default""
xlabel
; defaultnothing
(or units if applicable)ylabel
; defaultnothing
yflip
; defaulttrue
ifminimum(y) >= 0
yreverse
; defaulttrue
ify[1] > y[end]
x
values for x axis; defaultcollect(axes(z)[1])
y
values for y axis; defaultcollect(axes(z)[2])
xticks
; default[minimum(x),maximum(x)]
(usually)yticks
; default[minimum(y),maximum(y)]
out
- returns plot handle, type
Plots.Plot
MIRTjim.jim!
— Methodjim(x, y, z, array3d, [title] ; kwargs...) or jim!(pp::Plot, ...)
Allow user to provide the "z axis" of a 3D array, but ignore it without warning.
MIRTjim.jim!
— Methodjim(x, y, z, title::String ; kwargs...) or jim!(pp::Plot, ...)
Allow title
as positional argument for convenience.
MIRTjim.jim!
— Methodjim(x, y, z ; kwargs...) or jim!(pp::Plot, ...)
The x
and y
axes can be Unitful.
MIRTjim.jim!
— Methodjim(axes::Tuple, array, [title] ; kwargs...) or jim!(pp::Plot, ...)
Allow user to provide the axes
of array
. (Only x = axes[1]
and y = axes[2]
are used.)
MIRTjim.jim
— Methodjim(args...; kwargs...)
Create a blank plot and then call jim!
.
MIRTjim.jim
— Methodjim(plot1, plot2, ... ; gui=?, prompt=?, kwargs...)
Subplot-type layout, where kwargs
are passed to plot
.
gui
callPlots.gui()
immediately?; defaultfalse
prompt
callprompt()
immediately?; defaultfalse
MIRTjim.jim
— Methodjim(key::Symbol, value::Any)
Set default value for one of the keys.
MIRTjim.jim
— Methodjim(:test::Symbol)
jim(:keys)
return default keys.
jim(:defs)
return Dict
of default keys / vals.
jim(:key)
return Dict[key]
if possible.
jim(:reset)
reset to defaults.
jim(:push!)
push!
current defaults to the stack.
jim(:pop!)
pop!
defaults from the stack.
jim(:blank)
return blank plot.
MIRTjim.mid3
— Methodmid3(a::AbstractArray{T,3})
Extract the "middle" slices (transaxial, coronal, sagittal) and arrange in a 2D mosaic for quick display of 3D array.
MIRTjim.nothing_else
— Methodnothing_else(x, y)
Return y
if x
is nothing, else return x
.
MIRTjim.prompt
— Methodprompt(key::symbol)
Set prompt state to one of:
:prompt
callgui()
if possible, then prompt user.:draw
callgui()
if possible, then continue.:nodraw
do not callgui()
, just continue.
Use prompt(:state)
to query current state.
Actually it calls display(plot!())
instead of gui()
.
MIRTjim.prompt
— Methodprompt( ; gui::Bool=true)
Prompt user to hit any key to continue, after gui()
. Some keys have special actions: [q]uit [d]raw [n]odraw
. Call prompt(:prompt)
to revert to default.
MIRTjim.wait_for_key
— Methodfunction wait_for_key( ; io_in = stdin, io_out = stdout, prompt=?)
From discourse.