imgmarker.image package¶
Submodules¶
imgmarker.image.convolution module¶
Copyright © 2025, UChicago Argonne, LLC
Full license found at _YOUR_INSTALLATION_DIRECTORY_/imgmarker/LICENSE
- imgmarker.image.convolution.gaussian_filter(array: ndarray, sigma, n: int = 3) ndarray¶
Applies an approximate gaussian filter as a series of n box filters.
- Parameters:
- array: `numpy.ndarray`
Array to be filtered.
- sigma:
Radius of the Gaussian filter.
- n: int, optional
Number of equivalent box filters. Default is 3.
- Returns:
- out: numpy.ndarray
Filtered array.
- imgmarker.image.convolution.sigma_to_size(sigma, n: int)¶
Calculates the equivalent box filter sizes from a Gaussian filter radius.
Algorithm taken from P. Kovesi (2010).
- Parameters:
- sigma:
Radius of the Gaussian filter.
- n: int
Number of equivalent box filters.
- Returns:
- sizes: list
Equivalent box filter sizes.
imgmarker.image.fits module¶
Copyright © 2025, UChicago Argonne, LLC
Full license found at _YOUR_INSTALLATION_DIRECTORY_/imgmarker/LICENSE
- imgmarker.image.fits.open(path)¶
Module contents¶
Copyright © 2025, UChicago Argonne, LLC
Full license found at _YOUR_INSTALLATION_DIRECTORY_/imgmarker/LICENSE
- class imgmarker.image.Image(*args: Any, **kwargs: Any)¶
Bases:
QGraphicsPixmapItemImage class based on the PyQt QGraphicsPixmapItem.
- Attributes:
- path: str
Path to the image.
- name: str
File name.
- format: str
Image format. Can be TIFF, FITS, PNG, or JPEG.
- frame: int
Current frame of the image.
- n_frame: int
Number of frames in the image.
- imagefile: `PIL.Image.ImageFile`
Pillow imagefile object that allows loading of image data and image manipulation.
- width: int
Image width.
- height: int
Image height.
- wcs: `astropy.wcs.WCS` or None
WCS solution.
- wcs_center: list[float]
Center of the image in WCS coordinates.
- r: float
Blur radius applied to the image.
- stretch: `BaseStretch`, default=`LinearStretch()`
Stretch of the image brightness. Can be set with Image.stretch = ‘linear’ or Image.stretch = ‘log’
- interval: `BaseInterval`, default=`ZScaleInterval()`
Interval of the image brightness. Can be set with Image.interval = ‘zscale’ or Image.stretch = ‘min-max’
- comment: str
Image comment.
- categories: list[int]
List containing the categories for this image.
- marks: list[imgmarker.mark.Mark]
List of the marks in this image.
- dupe_marks: list[imgmarker.mark.Mark]
List of marks made on a duplicate-showing of the same image. Kept separate for saving purposes.
- seen: bool
Whether this image has been seen by the user or not.
- markfiles: list[str]
List of paths to the markfiles that have been imported for this image
Methods
__call__(*args, **kwargs)Call self as a function.
seek([frame])Switches to a new frame if it exists
topixmap(array)Creates a QPixmap from an array.
blur
close
read
read_metadata
rescale
toqimage
- close()¶
- read() ndarray¶
- rescale()¶
- property scaling¶
- topixmap(array: ndarray) PyQt6.QtGui.QPixmap¶
Creates a QPixmap from an array.
- toqimage(array: ndarray) PyQt6.QtGui.QImage¶
- property v¶
- property vlims¶
- class imgmarker.image.ImageScene(*args: Any, **kwargs: Any)¶
Bases:
QGraphicsSceneA class in which images and marks are stored.
Methods
__call__(*args, **kwargs)Call self as a function.
mark()Creates a mark object and adds it to the image scene and returns the mark.
rmmark(mark)Removes the specified mark from the image scene.
update_image(image)Updates the current image with a new image.
mousePressEvent
- mark(x: float, y: float, shape='ellipse', text: int | str = 0) Mark¶
- mark(ra: float = None, dec: float = None, shape='ellipse', text: int | str = 0) Mark
- mark(mark: Mark) Mark
Creates a mark object and adds it to the image scene and returns the mark.
- mousePressEvent(event)¶
- class imgmarker.image.ImageView(*args: Any, **kwargs: Any)¶
Bases:
QGraphicsViewA class in which the image scene is stored.
Methods
__call__(*args, **kwargs)Call self as a function.
Center on the cursor.
eventFilter(a0, a1)Performs operations based on the event source and type.
mouse_pix_pos([correction])Gets mouse image coordinates.
Gets mouse position.
scene()Returns the associated image scene.
zoom(scale[, mode])Zoom in on the image.
zoomfit()Fit the image view in the viewport.
- center_cursor()¶
Center on the cursor.
- eventFilter(a0, a1)¶
Performs operations based on the event source and type.
- Parameters:
- source: `QObject` object
Source of the event
- event: `QEvent` object
Event
- Returns:
- True if the event triggered an some operation.
- mouse_pix_pos(correction: bool = True)¶
Gets mouse image coordinates.
- Returns:
- pix_pos: QPoint
position of mouse in the image.
- mouse_pos()¶
Gets mouse position.
- Returns:
- view_pos: QPoint
position of mouse in the image view.
- scene() ImageScene¶
Returns the associated image scene.
- zoom(scale: float, mode: str = 'mouse')¶
Zoom in on the image.
- Parameters:
- scale: str
Scale of the zoom. Greater than 1 means zooming in, less than 1 means zooming out
- mode: str, optional
Zoom mode. To zoom from the center of the viewport, use mode=’viewport’. To zoom from the mouse cursor location, use mode=’mouse’. Defaults to ‘mouse’.
- Returns:
- None
- zoomfit()¶
Fit the image view in the viewport.
- class imgmarker.image.Interval¶
Bases:
objectMethods
MINMAX
ZSCALE
- MINMAX = <astropy.visualization.interval.MinMaxInterval object>¶
- ZSCALE = <astropy.visualization.interval.ZScaleInterval object>¶
- class imgmarker.image.Stretch¶
Bases:
objectMethods
LINEAR
LOG
- LINEAR = <astropy.visualization.stretch.LinearStretch object>¶
- LOG = <astropy.visualization.stretch.LogStretch object>¶
- imgmarker.image.align8to32(bytes: bytes, width: int, bits_per_pixel: str) bytes¶
converts each scanline of data from 8 bit to 32 bit aligned. slightly modified from Pillow
- imgmarker.image.read_wcs(f)¶
Reads WCS information from headers if available. Returns astropy.wcs.WCS.