Releases: hanjinliu/impy
Releases · hanjinliu/impy
Improvements and New Functions
Improvements
__getitem__
, especially axis targeted slicing is faster.numba
,napari
, andtrackpy
were imported at the same time as importingimpy
before, which slowed down importing time up to ~4 sec. These modules are now imported just after they are needed.specify
is re-implemented withnumba
and now it is much faster.reslice
is re-implemented. It's up to ~50 times faster and supports 3D reslicing.refine_sm
now works for n-D images.skeletonize
takesradius
argument.
New Functions
PhaseArray
(new)
This class is specialized in phase images.PhaseArray
supports:
- radian/degree conversion
mean_filter
with correct averaging formula.regionprops
with specialized properties "phase_mean" and "phase_std".
ImgArray
voronoi
for image segmentation.area_opening
,area_closing
,diameter_opening
,diameter_closing
.flood
for flood-fill labeling.split_pixel_unit
,stokes
for polarization microscopy.pointprops
to measure floating coordinates.label_if
is useful for filtering labels upon labeling.- Many binary object detections.
PropArray
hist
method for plotting histogram.
Axes
replace
method is useful for replacing axes symbols.
Changes
reslice
no longer takeslinewidth
argument because it is useless and difficult to implement for 3D images.affine_correction
is less flexible (it doesn't take reference image as an argument) but this change does not lose generality because you can access the optimal matrices byout.temp
anyway.
New Functions
News
lineprops
for measuring lines, such as mean intensities along a line.gauss_correction
for direct correction and background subtraction.directional_median_filter
for filtering salt and pepper noise while preserving edges.random_walker
for segmentation.lbp
,glcm_filter
,glcm_props
for texture classification. Especially, some functions are available that were not inskimage
. Currently main for-loop inglcm_props
are coded in pure Python so that it is very slow. It is partly implemented usingnumba
(if available). Afternumba
can efficiently compile numpy functions (especiallynp.sum
, which get slower innumba
), I'll fix this problem.hessian_angle
,gabor_angle
for calculating filament angle (for those who want to analyze such as DNA or cytoskeletons). Accordingly,PhaseArray
is newly implemented for phase images. Attachednapari
viewer can recognizePhaseArray
and show in cyclic colormap.
Improvements
-
Broadcasting abolished image axes before. Also,
__getitem__
method could not make full use of axes information. Now in v1.7.0 axes-based broadcasting is smarter.
img
← 4-dimensional image with tzyx-axes
thr
← 3-dimensional boolean image with tyx-axes
then,
img[thr]
← this works! -
Some labeling functions are moved to LabeledArray from ImgArray, for compatibility between
PhaseArray
. -
napari
is imported inside a function. The startup time is shorter now.
Trackpy Supports and Simple DataFrame Handling, and Some New Functions
News
- New Functions of
ImgArray
wiener
for deconvolution.extract
for extraction of certain region of image according to labels.defocus
for z-padding, which is very useful for FFT preprocessing.focus_map
to find focal plane of 3D image stack, using variance of Laplacian method.std_filter
,coef_filter
are filters based on standard deviation.scipy.ndimage.generic_filter
is very slow so I implemented in E[X^2] - E[X]^2 method.doh_filter
(determinant of Hessian),log_filter
(Laplacian of Gaussian) are implemented aimed at single molecule detection in microscopic images. They can used infind_sm
.
- Other News
MarkerFrame
andTrackFrame
, (subclass ofpd.DataFrame
) are defined. They have simple interface betweentrackpy
. You can track particles withlnk = df.link(...)
, and return individual MSDs bylnk.imsd(...)
. They also supportsImgArray
-like slicing, likedf["t=0;c=1"]
.
Improvements
- The use of
MarkerArray
was a little bit confusing so now all the functions that use coordinates supports interface withAxesFrame
or its subclasses. ip.window.add(X)
now supports MarkerFrame/TrackFrame for drawing points/tracks.- Automatic color mapping in
ip.window.add(X)
filt
argument inspecify
,centroid_sm
andgauss_sm
, which filters if labels/markers should be added.reslice
returnsPropArray
instead orImgArray
to enable directplot
andcurve_fit
.
Bug Fix
specify
could not draw labels when certain values are set toradius
because of my misunderstanding of scikit-image'sdisk
andball
functions. → Now it works for any values.split
did not inherit scales. &rrar; fixed.
napari is partially working! And new functions
News
ip.window
will be imported if possible, and this object makes it easy to visualize image withnapari
.curve_fit
is working inPropArray
, which can runscipy.optimize.curve_fit
along any axis.specify
is totally modified and now it is very useful for labeling in square or circular shape.melt
is working inPropArray
, which makes it easier to iterate along all the labels.
Improvements
- Some of filter functions are implemented using functions provided in
scipy.ndimage
rather thanskimage
because they are much faster. - For images with size less than 10^7 pixels,
parallel
do not choose multiprocessing because it might be slower. - Scales of axes can be set with
set_scale
so that you don't need to specify pixel size in such ashessian_eigval
. peak_local_max
takespercentile
as an argument instead of absolute threshold because it is more useful.
Bug Fix
- In some functions
update=True
did not work split
did split the image itself but did not split labels.
Important Changes
__getitem__
is zero-start now, like innapari
.- All the plugin is deleted and moved into
ImgArray
methods.
More Generalized Implementation and New Functions
New Functions
enhance_contrast
,entropy_filter
... feature detection.skeletonize
,fill_hole
... binary operation.empty_like
,zeros_like
... easily make image arrays with same parameters.labels
will also be inherited correctly, especially when xy-size changed by__getitem__
.- You can prevent unwanted image analysis using
freeze
function.
Deleted/Modified
lut
no longer works because it is not useful.- All the
light_bg
arguments are removed because you can do it by inverting image. lucy2d
andlucy3d
are integrated aslucy
.peak_local_max
returnsPropArray
withIndexArray
now, which is convenient for multi-dimensional images.
Simplifications
__array_ufunc__
,__array_finalize__
and_set_info
had very similar part while they had separated codes. Now they are much more clearer.- To specify along which axes to iterate, you can use
dims
keyword argument for many functions commonly. This is achieved by using decoratordims_to_spatial_axes
.
Immediate Goals
- I want to integrate units (such as nm, msec, or maybe channel names) into Axes to enable efficient tracking of scales. After this is done, scaling parameters such as
pxsize
inhessian_eig
will be removed. - For data visualization, I'll depend on
napari
. Of course it will be coded in plugin folder.
Bug fix and new methods
Bug Fix
gaussian_filter
did not work in previous version because of slightly different implementation of other running-kernel filters.impy.zeros
did not work because I forgot adding it in__init__.py
.clip_outliers
andrescale_intensity
did not work in some cases because of bad implementation.
New Methods
gaussfit_particle
structure_tensor_eigval
structure_tensor_eig
dog_filter
peak_local_max
Changes
- Following methods now support new keyword argument
update
: bool --mean_filter
,median_filter
,gaussian_filter
,tophat
,erosion
,dilation
,opening
,closing
. Ifupdate=True
, the original image is updated just like filters in ImageJ. - Gaussian functions are integrated in
gauss.py
and now it can be utilized for generating images and fitting to single molecules.
First Release
I want to write in the future:
- RANSAC Gaussian fitting.
- Hessian method for cytoskeleton, cell surface, axon detection.
- Single molecule tracking and cell tracking
- ImageJ ROI → attribute
labels