Open stnava opened 3 months ago
For the first part - it would be nice to do that with the already supported standard numpy-like indexing (e.g. img[:, 1:50, :, :]
) but then an env var or something would be needed to determine whether you want numpy-like slicing to return ants images or arrays. So a general slice function makes sense.
Second part - I can definitely see the utility in adding a ants.metrics
sub-module that provides an interface to calculating all types of image similarity metrics.
It would be more pythonic and explicit to have each metric be its own function rather than as a string argument to a general function.
e.g. prefer explicit discovery of metrics:
from ants.metrics import metric1, metric2
result1 = metric1(img1, img2)
result2 = metric2(img1, img2)
instead of:
from ants.metrics import calculate_metric
result1 = calculate_metric(img1, img2, 'metric1')
result2 = calculate_metric(img1, img2, 'metric2')
These are notes about some utilities that would be useful.
probably just a wrapper for
slice_image
.... more important would be the display of the slice with some relevant annotation. would be something like :then add some information about similarity, distortion and/or motion. see below.
if img_3d is present, assess similarity with next neighbor. otherwise similarity against the reference. returns a numpy array (?)
norm( grad(U) )
... would want to assess across a time series.