darsia.ScalarImage#
- class ScalarImage(img, transformations=None, **kwargs)[source]#
Bases:
ImageSpecial case of a space-time image, with 1d data, e.g., monochromatic photographs.
Specialized constructor for optical images.
In addition to the constructor of general images, the color space is required to be specified through the keyword arguments.
Methods
append(image[, offset])Append other image to current image.
astype(data_type)For scalar data types, change the data type of the data array.
copy()Copy constructor.
eval(point[, interpolation])Evaluate the image array at a given point location.
geometry()Generate (flat) geometry object corresponding to the image.
img_as(data_type)Change data type via skimage.
integral()Integrate the image over its spatial dimensions.
metadata()Return all metadata required to initiate an image via keyword arguments.
reset_origin([return_image])Reset origin and coordinatesystem.
reset_reference_time()Pick date of first image in a series as reference date.
resize(cx[, cy])roi(roi)Extraction of spatial subregion using a darsia.ROI object.
save(path[, verbose])Save image to file.
set_time([time])Setter for time array.
shape_metadata()Return all metadata connected to dimensions of image and voxels.
show([title, duration, mode])Show image using matplotlib.pyplots or plotly built-in methods.
show_matplotlib([title, duration])Show the image using
matplotlib.pyplot.show_plain([title])Show image using matplotlib.pyplots in plain mode.
show_plotly([title, duration])Show the image using
plotly(often faster than matplotlib).slice(cut, axis)Extract of spatial slice.
subregion(roi)Extraction of spatial subregion.
time_interval(indices)Extraction of temporal subregion, only for space-time images.
time_slice(time_index)Extraction of single time slice.
to_csv(path, *[, delimiter, header, ...])Write scalar image cell-center data to CSV file.
to_vtk(path[, name])Save image to file in vtk format.
update_metadata([meta])Update metadata of image.
update_reference_time(reference)Update reference time.
write(path, **kwargs)Write the image to file.
Attributes
coordinatesystemPhysical coordinate system with equipped transformation from voxel to Cartesian space.
domainPhysical domain.
dtypeData type of the (current) image array.
num_voxelsNumber of voxels in each dimension.
opposite_cornerCartesian coordinate of the corner opposite to origin.
shapeShape of the image array, incl.
space_numSpatial resolution, i.e., number of voxels.
voxel_sizeSize of each voxel in each direction, ordered as indexing.
imgData array.
original_dtypeOriginal dtype at construction of the object.
space_dimDimension of the spatial domain.
indexingIndexing of each axis in context of matrix indexing (ijk) or Cartesian coordinates (xyz).
dimensionsDimension in the directions corresponding to the indexings.
nameName of image, e.g., used to describe the origin.
originCartesian coordinates associated to the [0,0,0] voxel (after applying transformations), using Cartesian indexing.
seriesFlag controlling whether the data array corresponds to a time series.
time_dimDimensionality of the image in temporal sense.
time_numNumber of time points.
dateTime in datetime format.
reference_dateReference date (for defining relative time).
timeRelative time in scalar format (in seconds).
scalarFlag controlling whether the data array is scalar, i.e., it does not use an extra axis to encode the range.
range_dimDimensionality of the image in data sense.
range_numNumber of entries for each data entry.
- copy()[source]#
Copy constructor.
- Returns:
ScalarImageCopy of the image object.