Hi all,
I’m trying to get the center line of a t2s image in the lumbar region. With the image not having the best quality the optic method fails quite often. Since I have good manual segmentation’s I tried to switch to -fitseg. This works quite well in the slices were I have the binary mask but I get empty slices for the last 1-2 slices where the cord ended. According to the help message of the function this should not happen:
- fitseg: fit a regularized centerline on an already-existing cord segmentation. It will interpolate if slices are missing and extrapolate beyond the segmentation boundaries (i.e., every axial slice will exhibit a centerline pixel).
So maybe I misunderstand the function or am using the commands wrong?
sct_get_centerline
-i binary_sc_mask.nii
-method fitseg
-o img_centerline.nii
Or there might be an error. There is the -igt (File name of ground-truth centerline or segmentation (binary nifti)) argument which I also tried to use in combination with the segmentation but it produced center lines at the edge of the cord.
It seems like I need to have the center line even in slices where there is no cord anymore since following functions like sct_straighten_spinalcord start to delete slices or shift them. (This also happens when I directly give the segmentation to the straighten function. I assume this function just runs the get center line command at the start if a segmentation is provided.)
On a side note, sct_straighten_spinalcord mv or cp files from the /tmp into the current directory ./. I’m not sure if this is intentional but it is a bit weird, since I usually run the bash scripts from a separate folder, to have these files pop up there or even in the home directory.
[...]
Generate output files...
mv /tmp/sct-20230316152744.662160-straighten_spinalcord-27m1rutb/tmp.curve2straight.nii.gz ./warp_curve2straight.nii.gz
File created: ./warp_curve2straight.nii.gz
mv /tmp/sct-20230316152744.662160-straighten_spinalcord-27m1rutb/tmp.straight2curve.nii.gz ./warp_straight2curve.nii.gz
File created: ./warp_straight2curve.nii.gz
cp /tmp/sct-20230316152744.662160-straighten_spinalcord-27m1rutb/tmp.anat_rigid_warp.nii.gz ./straight_ref.nii.gz
[...]