Reference
Contents
Index
ImageTally.VALID_MARKERSImageTally.CountPointImageTally.CountSessionImageTally.TagImageTally.add_point!ImageTally.add_tag!ImageTally.clamp_to_imageImageTally.count_by_tagImageTally.default_tagsImageTally.delete_point!ImageTally.export_csvImageTally.find_nearest_pointImageTally.get_tagImageTally.has_tagImageTally.launch_counterImageTally.load_sessionImageTally.move_point!ImageTally.new_sessionImageTally.pixel_to_relativeImageTally.relative_to_pixelImageTally.remove_tag!ImageTally.save_sessionImageTally.session_summaryImageTally.set_active_tag!ImageTally.set_marker_size!ImageTally.total_count
ImageTally.VALID_MARKERS — Constant
Valid GLMakie marker symbols accepted by ImageTally.
ImageTally.CountPoint — Type
CountPointRepresents a single counted object in the image.
Fields
id::Int: Unique identifierx::Float64: Relative x position (0.0 to 1.0)y::Float64: Relative y position (0.0 to 1.0)tag::String: Name of the associated Tag- `timestamp::DateTime
ImageTally.CountSession — Type
CountSessionHolds all state for a single counting session.
Fields
image_path::String: Path to the image fileimage_width::Int: Original image width in pixelsimage_height::Int: Original image height in pixelstags::Vector{Tag}: Available counting categoriespoints::Vector{CountPoint}: All counted pointsnext_id::Int: Counter for generating unique point IDsactive_tag::String: Currently selected tag namemarker_size::Float64: Display size of markers
ImageTally.Tag — Type
TagRepresents a user-defined counting category with visual properties.
Fields
name::String: Display name (e.g. "male", "female", "egg"). Must not be empty.color::Symbol: Marker color (e.g.:red,:blue,:green). GLMakie accepts any named color; commonly used values include:red,:blue,:green,:orange,:purple,:cyan,:magenta,:yellow,:black,:white,:gray.marker::Symbol: Marker shape (e.g.:circle,:utriangle). Known supported markers are (:circle, :utriangle, :dtriangle, :rect, :diamond, :xcross, :cross, :pentagon). A warning is issued for unrecognised symbols.
Throws
ArgumentErrorifnameis empty.
ImageTally.add_point! — Method
add_point!(session, x_px, y_px) -> CountPointAdd a new point at the given pixel coordinates using the active tag. Coordinates are converted to relative and clamped to valid range. Both integer and floating-point coordinates are accepted.
Examples
add_point!(session, 1728.0, 2592.0)
add_point!(session, 1728, 2592)ImageTally.add_tag! — Method
add_tag!(session, tag) -> TagAdd a new tag to the session. Throws ArgumentError if a tag with the same name already exists or if the maximum number of tags is reached.
Examples
add_tag!(session, Tag("juvenile", :green, :diamond))ImageTally.clamp_to_image — Method
clamp_to_image(x_rel, y_rel) -> Tuple{Float64, Float64}Clamp relative coordinates to valid image range (0.0 to 1.0). Handles clicks slightly outside the image boundary.
ImageTally.count_by_tag — Method
count_by_tag(session) -> Dict{String, Int}Return a dictionary with the count of points for each tag.
Examples
count_by_tag(session) # Dict("male" => 5, "female" => 3)ImageTally.default_tags — Method
default_tags() -> Vector{Tag}Return a default set of two tags to use when no tags are specified.
ImageTally.delete_point! — Method
delete_point!(session, id) -> BoolDelete the point with the given id. Returns true if found and deleted, false if no point with that id exists.
Examples
delete_point!(session, 1)ImageTally.export_csv — Method
export_csv(session, path) -> NothingExport the counted points to a CSV file at path. Each row represents one counted point with its relative coordinates, pixel coordinates, tag, and timestamp.
The CSV includes both relative (0.0-1.0) and absolute pixel coordinates so the data is useful regardless of how the image is displayed.
Examples
export_csv(session, "my_count.csv")ImageTally.find_nearest_point — Method
find_nearest_point(session, x_px, y_px; threshold=50.0) -> Union{CountPoint, Nothing}Find the nearest point to the given pixel coordinates within the threshold distance. Returns nothing if no point is within the threshold.
Examples
point = find_nearest_point(session, 1728.0, 2592.0)ImageTally.get_tag — Method
get_tag(session, tag_name) -> Union{Tag, Nothing}Return the Tag with the given name, or nothing if it doesn't exist.
Examples
tag = get_tag(session, "male")ImageTally.has_tag — Method
has_tag(session, tag_name) -> BoolReturn true if a tag with the given name exists in the session.
Examples
has_tag(session, "male") # true or falseImageTally.launch_counter — Method
launch_counter(args...; kwargs...)Launch the ImageTally graphical counting interface. Requires GLMakie to be loaded first:
using GLMakie
using ImageTally
launch_counter("path/to/image.jpg")ImageTally.load_session — Method
load_session(path) -> CountSessionLoad a CountSession from a TOML file previously saved with save_session.
Examples
session = load_session("my_count.toml")ImageTally.move_point! — Method
move_point!(session, id, x_px, y_px) -> BoolMove the point with the given id to new pixel coordinates. Returns true if found and moved, false if no point with that id exists. Both integer and floating-point coordinates are accepted.
Examples
move_point!(session, 1, 1800.0, 2600.0)
move_point!(session, 1, 1800, 2600)ImageTally.new_session — Method
new_session(image_path, width, height; tags=default_tags()) -> CountSessionCreate a new counting session for the given image.
Examples
session = new_session("moths.jpg", 3456, 5184)
session = new_session("moths.jpg", 3456, 5184; tags=[Tag("male", :blue, :circle), Tag("female", :red, :utriangle)])Throws
ArgumentErrorifimage_pathis empty.ArgumentErrorifwidthorheightis not positive.ArgumentErroriftagsis empty or exceedsMAX_TAGS.
ImageTally.pixel_to_relative — Method
pixel_to_relative(x_px, y_px, width, height) -> Tuple{Float64, Float64}Convert pixel coordinates to relative coordinates (0.0 to 1.0).
Examples
pixel_to_relative(1728, 2592, 3456, 5184) # (0.5, 0.5)ImageTally.relative_to_pixel — Method
relative_to_pixel(x_rel, y_rel, width, height) -> Tuple{Int, Int}Convert relative coordinates (0.0 to 1.0) to pixel coordinates.
Examples
relative_to_pixel(0.5, 0.5, 3456, 5184) # (1728, 2592)ImageTally.remove_tag! — Method
remove_tag!(session, tag_name) -> BoolRemove the tag with the given name. Returns false if the tag doesn't exist. Throws ArgumentError if points exist with this tag — delete or retag those points first. Automatically switches active tag if the removed tag was active.
Examples
remove_tag!(session, "juvenile")ImageTally.save_session — Method
save_session(session, path) -> NothingSave a CountSession to a TOML file at path. The session can be reloaded with load_session. The image file is not saved — only its path and dimensions are recorded.
Examples
save_session(session, "my_count.toml")ImageTally.session_summary — Method
session_summary(session) -> StringReturn a human-readable summary of the session as a string.
Examples
println(session_summary(session))ImageTally.set_active_tag! — Method
set_active_tag!(session, tag_name) -> NothingSet the active tag by name. Throws ArgumentError if tag doesn't exist.
Examples
set_active_tag!(session, "female")ImageTally.set_marker_size! — Method
set_marker_size!(session, size) -> NothingSet the global marker display size. Must be positive. Both integer and floating-point values are accepted. A warning is issued for sizes above 200, which are unusually large and may obscure the image.
Examples
set_marker_size!(session, 20.0)
set_marker_size!(session, 20)Throws
ArgumentErrorifsizeis not positive.
ImageTally.total_count — Method
total_count(session) -> IntReturn the total number of counted points across all tags.
Examples
total_count(session) # 8