question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Motion correction: improve output

See original GitHub issue

Is your feature request related to a problem? Please describe. Currently, ants.motion_correction outputs motion_parameters as a list of MAT files that are saved to a temporary folder. This makes it so that if the user wants to save these transformations (to my understanding), he has to move these outputs somewhere else, manually, and write a mapping.txt file that specifies which file belongs to each volume, given that names are random. It’s also cumbersome to extract common motion parameter regressors from these MAT files from within python. My knowledge is that this requires calling in scipy or hdf5 to load the MAT files, extracting the affine from the dict, parsing it and storing the translation and rotation parameters manually. This also means that the end user has to know what the ANTs internal representation of an affine transformation looks like, which is well documented, but outside of ANTsPy.

Describe the solution you’d like

  1. have the user be able to specify where to save the transformation matrices, and have their filenames sorted by index. This would ease storing files and allow easy identification of which affine belongs to which volume. If the folder already contains files with the same name, either throw an error before starting the motion correction, have a parameter to toggle overwrite (could default to True I guess), or add a suffix (the FSL solution).

  2. output an extra motion_parameter_estimates np.array or dictionary containing translation and rotation estimates for better interop with other software packages.

Describe alternatives you’ve considered Open to suggestions.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:13 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
stnavacommented, Jul 9, 2019

We have both a transform to point Operation and transform classes to do all of this in a ©lean way and consistently with other ants tools … under some of this: https://github.com/stnava/structuralFunctionalJointRegistration/blob/master/src/Default Mode Connectivity in ANTsPy.ipynb

0reactions
stnavacommented, Apr 21, 2020

@wangyibin0011 please open a different issue for this question

Read more comments on GitHub >

github_iconTop Results From Across the Web

Improved motion correction of submillimetre 7T fMRI time ...
Our results show that BBR realignment is able to accurately correct head motion in 7T data and can be utilized in preprocessing pipelines...
Read more >
Prospective motion correction of fMRI: Improving the quality of ...
Prospective Motion Correction (PMC) has been shown to improve fMRI data quality. •. We applied PMC for improving rs-fMRI quality of data ...
Read more >
Quantitative evaluation of prospective motion correction in ...
Results. Subjective evaluation overall has shown a statistically significant improvement (5.5%) in terms of image quality with PMC ON. In a ...
Read more >
Motion Detection and Correction - BrainVoyager
Motion correction operates by selecting one functional volume of a run (or a ... while not producing better results than the trilinear /...
Read more >
Evaluation and Optimization of Motion Correction in Spinal ...
Our results illustrated the proposed motion correction algorithm that ... Results. As expected, generally, motion correction improved the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found