Methods list

Methods usage

MIRTjim.MIRTjimModule

Module MIRTjim exports the "jiffy image display" method jim, and the helper methods:

  • caller_name
  • mid3
  • prompt
source
MIRTjim.jim_stackConstant
jim_stack

Global Vector{Any} used with :push! and :pop! to store and retrieve settings.

source
MIRTjim._aspect_ratioMethod
_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.

source
MIRTjim.caller_nameMethod

caller_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.

source
MIRTjim.jim!Method
jim(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.

source
MIRTjim.jim!Method
jim(..., 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.

source
MIRTjim.jim!Method
jim(z::Matrix{<:Colorant}; kwargs...) or jim!(pp::Plot, ...)
jim!(pp::Plot, ...)

For RGB images, ignore clim, color, x, y.

source
MIRTjim.jim!Method
jim(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 uses mosaicviews

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 call Plots.gui() immediately?; default false
  • prompt call prompt() immediately?; default false
  • ncol for mosaicview for 3D and higher arrays; default 0 does auto select "Number of tiles in column direction."
  • nrow for mosaicview for 3D and higher arrays; default 0 does auto select
  • padval padding value for mosaic view; default minimum(z)
  • line3plot lines around sub image for 3d mosaic; default true
  • line3type line type around sub image for 3d mosaic; default (:yellow)
  • mosaic_npad # of pixel padding for mosaic view; default 1
  • fft0 if true use FFTView to display (2D only); default false
  • title; default ""
  • xlabel; default nothing (or units if applicable)
  • ylabel; default nothing
  • yflip; default true if minimum(y) >= 0
  • yreverse; default true if y[1] > y[end]
  • x values for x axis; default collect(axes(z)[1])
  • y values for y axis; default collect(axes(z)[2])
  • xticks; default [minimum(x),maximum(x)] (usually)
  • yticks; default [minimum(y),maximum(y)]

out

  • returns plot handle, type Plots.Plot
source
MIRTjim.jim!Method
jim(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.

source
MIRTjim.jim!Method
jim(x, y, z, title::String ; kwargs...) or jim!(pp::Plot, ...)

Allow title as positional argument for convenience.

source
MIRTjim.jim!Method
jim(x, y, z ; kwargs...) or jim!(pp::Plot, ...)

The x and y axes can be Unitful.

source
MIRTjim.jim!Method
jim(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.)

source
MIRTjim.jimMethod
jim(args...; kwargs...)

Create a blank plot and then call jim!.

source
MIRTjim.jimMethod
jim(plot1, plot2, ... ; gui=?, prompt=?, kwargs...)

Subplot-type layout, where kwargs are passed to plot.

  • gui call Plots.gui() immediately?; default false
  • prompt call prompt() immediately?; default false
source
MIRTjim.jimMethod
jim(key::Symbol, value::Any)

Set default value for one of the keys.

source
MIRTjim.jimMethod
jim(: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.

source
MIRTjim.mid3Method
mid3(a::AbstractArray{T,3})

Extract the "middle" slices (transaxial, coronal, sagittal) and arrange in a 2D mosaic for quick display of 3D array.

source
MIRTjim.promptMethod
prompt(key::symbol)

Set prompt state to one of:

  • :prompt call gui() if possible, then prompt user.
  • :draw call gui() if possible, then continue.
  • :nodraw do not call gui(), just continue.

Use prompt(:state) to query current state.

Actually it calls display(plot!()) instead of gui().

source
MIRTjim.promptMethod
prompt( ; 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.

source