MIRTjim.jl

Jiffy image display for image reconstruction
Author JeffFessler
Popularity
8 Stars
Updated Last
6 Months Ago
Started In
March 2021

MIRTjim

https://github.com/JeffFessler/MIRTjim.jl

docs-stable docs-dev action status pkgeval status codecov license Aqua QA code-style deps version pkgeval

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.

Getting started

using Pkg
Pkg.add("MIRTjim")

Example

using MIRTjim: jim
z = (1:7) .+ (1:4)' # 7 × 4 matrix
jim(z ; title="example") # figure

For more examples, see the documentation.

Helper functions

This repo also exports some small helper functions.

  • prompt() first calls Plots.gui() to display the current plot, then waits for a user key press.

    Some keys have special effects:

    • [q]uit throws an error
    • [d]raw disables further prompting and the plots are just drawn
    • [n]odraw avoids the gui() call (useful for non-interactive testing)

    Calling prompt(:prompt) reverts the default key-press behavior.

  • caller_name() uses stacktrace (in Base) 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.

Notes

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.

Compatibility

Tested with Julia ≥ 1.10.

Related packages

Used By Packages

No packages found.