-
Notifications
You must be signed in to change notification settings - Fork 168
Multi metric registration
stnava edited this page Nov 20, 2018
·
2 revisions
ANTsPy and ANTsR inherit the ability to do multi-metric registration.
Such registrations assume that the feature images are in the same physical space and at least roughly aligned.
One may then use registration to optimize a multiple similarity metric objective function as in:
https://doi.org/10.3389/fninf.2014.00044
https://www.ncbi.nlm.nih.gov/pubmed/18995188
First, import ants, read some images and create some features.
import ants
image = ants.image_read(ants.get_ants_data('r16'))
image2 = ants.image_read(ants.get_ants_data('r27'))
g1 = ants.iMath_grad( image )
g2 = ants.iMath_grad( image2 )
Perform a baseline registration with a single feature.
reg1 = ants.registration( image, image2, 'SyNOnly' )
Create a couple of new metrics.
demonsMetric = ['demons', g1, g2, 1, 1]
ccMetric = ['CC', image, image2, 2, 1 ]
Append the first metric to the metric list. In actuality this means that reg2
will be driven by both a demons metric and the default metric.
metrics = list( )
metrics.append( demonsMetric )
reg2 = ants.registration( image, image2, 'SyNOnly',
multivariate_extras = metrics )
Add a third metric and run this new registration.
metrics.append( ccMetric )
reg3 = ants.registration( image, image2, 'SyNOnly',
multivariate_extras = metrics )
Compute some quantification of the results.
print( ants.image_mutual_information( image, image2 ) )
print( ants.image_mutual_information( image, reg1['warpedmovout'] ) )
print( ants.image_mutual_information( image, reg2['warpedmovout'] ) )
print( ants.image_mutual_information( image, reg3['warpedmovout'] ) )