-
Notifications
You must be signed in to change notification settings - Fork 9
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
antsGetSpacing much slower than getting voxel dims from antsImageHeaderInfo #130
Comments
Can you send a PR to merge these 2? |
That's the point of the function of check_ants.
Best,
John
…On Mon, Jan 4, 2021 at 1:26 PM dorianps ***@***.***> wrote:
The code for antsGetSpacing already checks if the input is antsImage:
[image: image]
<https://user-images.githubusercontent.com/9083517/103566371-e4274200-4e8f-11eb-8870-d54e8158ebc3.png>
but the problem seems to be that check_ants is returning an antsImage
type for a character vector. Maybe that should be fixed?
[image: image]
<https://user-images.githubusercontent.com/9083517/103566658-61eb4d80-4e90-11eb-8803-332c4ff9c1f5.png>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#130 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIGPLVJ4GOLEQP5ZRLDWNDSYIB6LANCNFSM4VTKPZZA>
.
|
Is the purpose of check_ants to load an image into memory? If that is the case, maybe that is suboptimal. It might be faster to use antsImageHeader and return the result rather than load the file in memory to enable |
The purpose of check_ants is to pass in an object (antsImage, nifti object, RNifti image) or character filename and ensure the output is an antsImage object. |
In that case, I can add an initial Not a big deal anyway, but can make for a more friendly and faster usability. |
Is your feature request related to a problem? Please describe.
For reasons that I haven't dug up entirely,
antsGetSpacing
is much slower than getting spacing throughantsImageHeaderInfo
. I had to extract spacing from ~3000 images and it took just a few seconds withantsImageHeaderInfo
whileantsGetSpacing
took maybe 10-15 minutes. Just leaving a note here in case we want to optimize.Describe the solution you'd like
We can consider making
antsGetSpacing
a wrapper ofantsImageHeaderInfo
which returns only voxel dimensions. Right now I am not sure why we are using a separate C function for getting spacing in https://github.com/ANTsX/ANTsRCore/blob/master/R/ants_set_get.R#L105Describe alternatives you've considered
NA
Additional context
No bug, just potential for optimization.
The text was updated successfully, but these errors were encountered: