Skip to content
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

On-the-fly resampling to arbitrary resolutions #43

Open
oesteban opened this issue Apr 10, 2020 · 0 comments
Open

On-the-fly resampling to arbitrary resolutions #43

oesteban opened this issue Apr 10, 2020 · 0 comments
Assignees

Comments

@oesteban
Copy link
Member

Summary

To make the archive more consistent and lightweight, it would be very effective to allow the user to query for arbitrary resolutions.

Implementation details

  1. The TemplateFlow Archive would only keep the highest resolution of any given template. This has two nice side-effects: i) we will not hold-up any template for not having low-resolution conversion --this is, for instance, happening in the case of the UNCInfant template--; and ii) we do not need to have conversions for any object with a conversion at a higher resolution.
  2. The template_description.json should keep the prescriptions of the original lower-resolution conversion (i.e., matrix size, zooms, and origin) so that it is still possible to generate those conversions with the exact same details they were originally designed with.
  3. Whenever the client's API is queried with a resolution:
    a. If the resolution is the highest, the original template files are returned.
    b. If the resolution identifier (following BIDS-Derivs conventions) matches one of those kept in the template_description.json file, then resampling is done to that particular resolution.
    c. If the resolution is some different type of object (we can think of migrating the Space object from niworkflows to here, or some such), then templateflow generates a new resampling scheme that matches whatever the user-specified. This can be just zooms, zooms + shape, and zooms + shape + origin.
  4. Atlases can be queried for just coordinates (i.e., no grid necessary).

Resampling / interpolation

Uses nitransforms with the identity transform.

Potential pitfalls / downsides

This proposal adds enormous flexibility to users, complicating a bit the responsibility to ensure the reproducibility of downstream results. There are some strategies that could help ease this problem (i.e., trying to stick with the defaults whenever possible), this is a feature that could be easily misused.

Upshots

  • The archive is more lightweight
  • Conversions are more consistent (there are even cases where the different resolutions of a template are inconsistent)
  • Reduces a lot of frictions when using templates
  • Helps researchers do the right thing (e.g., querying for the label of any given coordinates should be always done at the highest resolution available).

Requesting for comments: @satra, @effigies, @yarikoptic, @wiheto, @rciric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants