NIPY_4D_REALIGN(1)
π NIPY_4D_REALIGN π
okay bestie, gather round, because this one is the <pink>nipy_4d_realign</pink> manual page β a User Commands classic β and it is literally the command-line wrapper for <purple>SpaceTimeRealign</purple>. yes, that's the whole vibe. motion correction but make it a one-liner. π
β¨ NAME β¨
nipy_4d_realign β command-line wrapper for SpaceTimeRealign
πΈ SYNOPSIS πΈ
nipy_4d_realign [-h] [--slice_order String] [--slice_dim Int]
[--slice_dir Int] [--make_figure Bool] [--save_path String]
[--save_params Bool] Float File
π¦ OPTIONS π¦
π POSITIONAL ARGUMENTS
Floatβ the TR of the measurement. that's it, that's the number. the repetition time. give it here. π«ΆFileβ path to a<lavender>nifti file</lavender>, or to a folder containing nifti files. If you hand it a folder instead of a file, the order of motion correction will benp.sort(list_of_files)β so yeah, sorted, not vibes-based, no cap. The outputs will beβ*_mc.parβ(which holds 3 translation and three rotation parameters) andβ*_mc.nii.gzβwhich holds the motion corrected data β unlessβapplyβis set toFalse, in which case bestie, you're not getting the corrected data. π
π§ OPTIONAL ARGUMENTS
-h,--helpβ show a help message and exit. the classic. the icon. the moment you type this when everything is on fire. π₯--slice_order Stringβ the order of slice aquisition:{βascendingβ, βdescendingβ (default), or the name of a function from nipy.algorithms.slicetiming.timefuncs}. so you can name a function from that module, main character energy. π--slice_dim Intβ integer denoting the axis in images that is the slice axis. In a 4D image, this will often be axis = 2 (default). lowkey it's usually 2. π--slice_dir Intβ1if the slices were acquired slice 0 first (default), slice -1 last, or-1if acquire slice -1 first, slice 0 last. direction matters, ok?? which end came first is literally the whole point. π--make_figure Boolβ whether to generate aβ.pngβfigure with the motion parameters across runs.{True, False}. Default:False. so if you want the little picture of your motion suffering, you gotta ask for it. β¨--save_path Stringβ full path to a file-system location for the output files. Defaults to the same location as the input files. it'll just dump stuff next to your inputs unless you tell it otherwise. π--save_params Boolβ whether to save the motion corrections parameters (3 rotations, 3 translations).{True, False}. Default:False.
NOTE: The rotations are not Euler angles, but a rotation vector. Usenipy.algorithms.registration.to_matrix44to convert to a 4-by-4 affine matrix. β οΈ do NOT come for me saying "but my Euler angles" β they are NOT Euler angles, they are a rotation vector, andto_matrix44is your bestie for turning them into a 4-by-4 affine matrix. periodt. π
π SEE ALSO π
the whole little friend group, all in one place. go say hi. π«Ά
and that's the page, bestie!! this one's from February 2023 and it lives in the NIPY_4D_REALIGN(1) section of the manual, so like, that's the version + date, consider yourself signed off on. now go correct some motion. mwah. πβ¨π
π¦ where this page comes from
- fedora 43: python3-nipy 1:0.6.1-5.fc43 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms