https://github.com/JeffFessler/MIRTjim.jl
This Julia package
exports the jim method that provides a "jiffy image display"
for showing 2D grayscale and color images
(and 3D images as a mosaic).
It is basically a wrapper around Plots.heatmap
with natural defaults.
As of v0.9 it supports
axes, colorbar limit (clim) and images
with physical units.
using Pkg
Pkg.add("MIRTjim")using MIRTjim: jim
z = (1:7) .+ (1:4)' # 7 × 4 matrix
jim(z ; title="example") # figureFor more examples, see the documentation.
This repo also exports some small helper functions.
-
prompt()first callsPlots.gui()to display the current plot, then waits for a user key press.Some keys have special effects:
[q]uitthrows an error[d]rawdisables further prompting and the plots are just drawn[n]odrawavoids thegui()call (useful for non-interactive testing)
Calling
prompt(:prompt)reverts the default key-press behavior. -
caller_name()usesstacktrace(inBase) to return the file name and line number that called the current function. It can be helpful for debugging and for giving warnings some context. -
mid3()extracts the middle three slices (transaxial, coronal, sagittal) of a 3D array and arranges them in a 2D mosaic for quick display.
This method is used in many of the image reconstruction examples in https://github.com/JuliaImageRecon.
Isolating these functions in this repo,
separate from other repos like
the
Michigan Image Reconstruction Toolbox (MIRT)
keeps
those repos lighter
by avoiding a dependence on Plots.jl there.
Tested with Julia ≥ 1.10.