Methods list
MIRTjim.MIRTjimMIRTjim.jim_defMIRTjim.jim_stackMIRTjim._aspect_ratioMIRTjim.caller_nameMIRTjim.jimMIRTjim.jimMIRTjim.jimMIRTjim.jimMIRTjim.jim!MIRTjim.jim!MIRTjim.jim!MIRTjim.jim!MIRTjim.jim!MIRTjim.jim!MIRTjim.jim!MIRTjim.jim!MIRTjim.jim!MIRTjim.mid3MIRTjim.nothing_elseMIRTjim.promptMIRTjim.promptMIRTjim.wait_for_key
Methods usage
MIRTjim.MIRTjim — ModuleModule MIRTjim exports the "jiffy image display" method jim, and the helper methods:
caller_namemid3prompt
MIRTjim.jim_def — Constantjim_defGlobal Dict of default settings.
MIRTjim.jim_stack — Constantjim_stackGlobal 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
zimage, can be 2D or higher, if higher then it usesmosaicviews
option
aspect_ratio; default:equalfor square pixels (see_aspect_ratio)clim; default(minimum(z),maximum(z))color(colormap, e.g.:hsv); default:grayscolorbar(e.g.:none); default:legendguicallPlots.gui()immediately?; defaultfalsepromptcallprompt()immediately?; defaultfalsencolfor mosaicview for 3D and higher arrays; default0does auto select "Number of tiles in column direction."nrowfor mosaicview for 3D and higher arrays; default0does auto selectpadvalpadding value for mosaic view; defaultminimum(z)line3plotlines around sub image for 3d mosaic; defaulttrueline3typeline type around sub image for 3d mosaic; default(:yellow)mosaic_npad# of pixel padding for mosaic view; default1fft0if true use FFTView to display (2D only); defaultfalsetitle; default""xlabel; defaultnothing(or units if applicable)ylabel; defaultnothingyflip; defaulttrueifminimum(y) >= 0yreverse; defaulttrueify[1] > y[end]xvalues for x axis; defaultcollect(axes(z)[1])yvalues 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.
guicallPlots.gui()immediately?; defaultfalsepromptcallprompt()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:
:promptcallgui()if possible, then prompt user.:drawcallgui()if possible, then continue.:nodrawdo 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.