diff --git a/neural/afni.py b/neural/afni.py
index <HASH>..<HASH> 100644
--- a/neural/afni.py
+++ b/neural/afni.py
@@ -392,4 +392,14 @@ def qwarp_apply(dset_from,dset_warp,affine=None,warp_suffix='_warp'):
 		'-source', dset_from,
 		'-master','WARP',
 		'-prefix', suffix(dset_from,warp_suffix)
-	],products=suffix(dset_from,warp_suffix))
\ No newline at end of file
+	],products=suffix(dset_from,warp_suffix))
+
+def qwarp_invert(warp_param_dset,output_dset,affine_1Dfile=None):
+	'''inverts a qwarp (defined in ``warp_param_dset``) (and concatenates affine matrix ``affine_1Dfile`` if given)
+	outputs the inverted warp + affine to ``output_dset``'''
+	
+	cmd = ['3dNwarpCat','-prefix',output_dset,
+		   '-warp1','INV(%s)' % warp_param_dset]
+	if affine_1Dfile:
+		cmd += ['-warp2','INV(%s)' % affine_1Dfile]
+	neural.run(cmd,products=output_dset)
\ No newline at end of file
added qwarp_invert