-
Notifications
You must be signed in to change notification settings - Fork 532
ENH: add average error to ErrorMap #1039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: add average error to ErrorMap #1039
Conversation
@satra Thanks for the comments. I will update the changes file and make some according tests. |
@oesteban - in the following chunk of code in ErrorMap, were you just trying to calculate the euclidean distance voxel-wisely (
double checking this because I am making some tests for it -- Thanks in advance |
@lsqshr you are right, but if I recall it well, I use The |
perhaps we can also add the frobenius norm here and keep expanding the list of metrics. |
…euclidean average `errvectorexp = np.zeros_like(mskvector)` used to generate a uint8 vector by default which loses the precision when calculating the special volumes with float voxels of small values like the jacobian determinant volume
Just made the update and some tests with dummy |
mskvector = msk.reshape(-1) | ||
msk_idxs = np.where(mskvector==1) | ||
refvector = ref_data.reshape(-1,comps)[msk_idxs].astype(np.float32) | ||
tstvector = tst_data.reshape(-1,comps)[msk_idxs].astype(np.float32) | ||
diffvector = (refvector-tstvector) | ||
|
||
# Scale the diffrernce |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minimal typo (should read difference).
…_2_errormap Conflicts: CHANGES
@oesteban, thanks for reviewing the code and the comments. I have just made the according fixes and synced this branch with the upstream. |
ENH: add average error to ErrorMap
Add an average distance output to the
nipype.algorithms.metrics.ErrorMap
, which simpy get the square root average/the sum average of the errormap vector.