Reconstruction and motion correction#
NeSVoR reconstruction#
Reconstruct from mutiple stacks of slices#
The reconstruct command can be used to reconstruct a 3D volume
from N stacks of 2D slices (in NIfTI format, i.e. .nii or .nii.gz).
A basic usage of reconstruct is as follows,
where mask-i.nii.gz is the ROI mask of the i-th input stack.
nesvor reconstruct \
--input-stacks stack-1.nii.gz ... stack-N.nii.gz \
--stack-masks mask-1.nii.gz ... mask-N.nii.gz \
--output-volume volume.nii.gz
A more elaborate example could be
nesvor reconstruct \
--input-stacks stack-1.nii.gz ... stack-N.nii.gz \
--stack-masks mask-1.nii.gz ... mask-N.nii.gz \
--thicknesses <thick-1> ... <thick-N> \
--output-volume volume.nii.gz \
--output-resolution 0.8 \
--output-model model.pt \
--weight-image 1.0 \
--image-regularization edge \
--delta 0.2 \
--n-iter 5000 \
--level-scale 1.38 \
--coarsest-resolution 16.0 \
--finest-resolution 0.5 \
--n-levels-bias 0 \
--n-samples 128
Run nesvor reconstruct --h to see the meaning of each parameter.
Given multiple stacks at inputs,
reconstruct first corrects the motion in the input stacks using SVoRT
(the same as what register does),
and then trains a NeSVoR model that implicitly represent the underlying 3D volume,
from which a discretized volume (i.e., a 3D tensor) can be sampled.
Reconstruct from motion-corrected slices#
reconstruct can also take a folder of motion-corrected slices as inputs.
nesvor reconstruct \
--input-slices <path-to-slices-folder> \
--output-volume volume.nii.gz
This enables the separation of registration and reconstruction.
That is, you may first run register to perform motion correction,
and then use reconstruct
to reconstruct a volume from a set of motion-corrected slices.
Deformable NeSVoR#
NeSVoR can now reconstruct data with deformable (non-rigid) motion!
To enable deformable motion, use the flag --deformable.
nesvor reconstruct \
--deformable \
.....
This feature is still experimental.
SVoRT motion correction#
register takes mutiple stacks of slices as inputs, performs motion correction,
and then saves the motion-corrected slices to a folder.
nesvor register \
--input-stacks stack-1.nii.gz ... stack-N.nii.gz \
--stack-masks mask-1.nii.gz ... mask-N.nii.gz \
--registration <method> \
--output-slices <path-to-save-output-slices>
The list of supported methods in register
can be found here.
Slice-to-volume registration/reconstruction#
svr implements a classical slice-to-volume registration/reconstruction method combined with SVoRT
motion correction. THe usage of svr is similar to reconstruct.
svr currently only supports rigid motion.
nesvor reconstruct \
--input-stacks stack-1.nii.gz ... stack-N.nii.gz \
--stack-masks mask-1.nii.gz ... mask-N.nii.gz \
--output-volume volume.nii.gz