Dear Forum
I want to make sure I am not doing something stupid here. I want to only do a 2D rigid body coregistration. SCT version 4+, pulled from git some time ago:
git-master-6f50fd8e917e8e255a0004daa1966c4a1fec49bf*
My snytax is:
sct_register_multimodal -i input.nii -d destination.nii -param step=1,algo=rigid,type=im,metric=MI,slicewise=0
However, when I run this, there is a proceeding zeroth step with the following parameters:
Registration parameters:
type … im
algo … syn
slicewise … 0
metric … MeanSquares
iter … 10
smooth … 0
laplacian … 0
shrink … 1
gradStep … 0.5
deformation … 1x1x0
init …
poly … 5
dof … Tx_Ty_Tz_Rx_Ry_Rz
smoothWarpXY … 2
rot_method … pca
Is this WAD? How can I force SCT to only do a “bad” coregistration?
Hi @Daniel_Papp,
This is strange, STEP #0 should show the following instead (iter=0, meaning that the only transformation is a coordinate system transformation based on the qform):
ESTIMATE TRANSFORMATION FOR STEP #0
Registration parameters:
type ........... im
algo ........... syn
slicewise ...... 0
metric ......... MI
iter ........... 0
smooth ......... 0
laplacian ...... 0
shrink ......... 1
gradStep ....... 0.5
deformation .... 1x1x0
init ...........
poly ........... 5
filter_size .... 5
dof ............ Tx_Ty_Tz_Rx_Ry_Rz
smoothWarpXY ... 2
rot_method ..... pca
Can you please copy/paste everything so i can check SCT’s version and other things?
Cheers,
Julien
(base) f140:aaa dpapp$ sct_register_multimodal -i sF3T_2013_40_602-155559-00001-00001-1.nii -d medic.nii -param step=1,algo=rigid,type=im,metric=MI,slicewise=0
--
Spinal Cord Toolbox (git-master-6f50fd8e917e8e255a0004daa1966c4a1fec49bf*)
Input parameters:
Source .............. sF3T_2013_40_602-155559-00001-00001-1.nii
Destination ......... medic.nii
Init transfo ........
Mask ................
Output name .........
Remove temp files ... 1
Verbose ............. 1
Check if input data are 3D...
Create temporary folder (/var/folders/ff/px4nh9y56fb6kxfmwdks37bc0000gr/T/sct-20191218163606.183500-kuo1i843)...
Copying input data to tmp folder and convert to nii...
--
ESTIMATE TRANSFORMATION FOR STEP #0
Registration parameters:
type ........... im
algo ........... syn
slicewise ...... 0
metric ......... MI
iter ........... 0
smooth ......... 0
laplacian ...... 0
shrink ......... 1
gradStep ....... 0.5
deformation .... 1x1x0
init ...........
poly ........... 5
dof ............ Tx_Ty_Tz_Rx_Ry_Rz
smoothWarpXY ... 2
rot_method ... pca
Estimate transformation
/Users/dpapp/sct/bin/isct_antsRegistration --dimensionality 3 --transform 'syn[0.5,3,0]' --metric 'MI[dest_RPI.nii,src.nii,1,32]' --convergence 0 --shrink-factors 1 --smoothing-sigmas 0mm --restrict-deformation 1x1x0 --output '[step0,src_regStep0.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /private/var/folders/ff/px4nh9y56fb6kxfmwdks37bc0000gr/T/sct-20191218163606.183500-kuo1i843
--
ESTIMATE TRANSFORMATION FOR STEP #1
Apply transformation from previous step
Parse list of warping fields...
Get dimensions of data...
232 x 288 x 18 x 1
Apply transformation...
/Users/dpapp/sct/bin/isct_antsApplyTransforms -d 3 -i src.nii -o src_reg.nii -t warp_forward_0.nii.gz -r dest_RPI.nii -n 'BSpline[3]' # in /private/var/folders/ff/px4nh9y56fb6kxfmwdks37bc0000gr/T/sct-20191218163606.183500-kuo1i843
Copy affine matrix from destination space to make sure qform/sform are the same.
Done! To view results, type:
fsleyes dest_RPI.nii src_reg.nii &
Registration parameters:
type ........... im
algo ........... rigid
slicewise ...... 0
metric ......... MI
iter ........... 10
smooth ......... 0
laplacian ...... 0
shrink ......... 1
gradStep ....... 0.5
deformation .... 1x1x0
init ...........
poly ........... 5
dof ............ Tx_Ty_Tz_Rx_Ry_Rz
smoothWarpXY ... 2
rot_method ... pca
sct_image -i dest_RPI.nii -o dest_RPI_pad.nii -pad 0,0,5 # in /private/var/folders/ff/px4nh9y56fb6kxfmwdks37bc0000gr/T/sct-20191218163606.183500-kuo1i843
Estimate transformation
/Users/dpapp/sct/bin/isct_antsRegistration --dimensionality 3 --transform 'rigid[0.5]' --metric 'MI[dest_RPI_pad.nii,src_reg.nii,1,32]' --convergence 10 --shrink-factors 1 --smoothing-sigmas 0mm --restrict-deformation 1x1x0 --output '[step1,src_reg_regStep1.nii]' --interpolation 'BSpline[3]' --verbose 1 # in /private/var/folders/ff/px4nh9y56fb6kxfmwdks37bc0000gr/T/sct-20191218163606.183500-kuo1i843
Concatenate transformations...
Parse list of warping fields...
Check file existence...
OK: dest.nii
OK: warp_forward_0.nii.gz
OK: warp_forward_1.mat
/Users/dpapp/sct/bin/isct_ComposeMultiTransform 3 warp_final.nii.gz -R dest.nii warp_forward_1.mat warp_forward_0.nii.gz # in /private/var/folders/ff/px4nh9y56fb6kxfmwdks37bc0000gr/T/sct-20191218163606.183500-kuo1i843
Generate output files...
File created: warp_src2dest.nii.gz
Parse list of warping fields...
Check file existence...
OK: src.nii
OK: warp_forward_1.mat
OK: warp_inverse_0.nii.gz
/Users/dpapp/sct/bin/isct_ComposeMultiTransform 3 warp_final.nii.gz -R src.nii warp_inverse_0.nii.gz -i warp_forward_1.mat # in /private/var/folders/ff/px4nh9y56fb6kxfmwdks37bc0000gr/T/sct-20191218163606.183500-kuo1i843
Generate output files...
File created: warp_dest2src.nii.gz
Apply transfo source --> dest...
Parse list of warping fields...
Get dimensions of data...
232 x 288 x 18 x 1
Apply transformation...
/Users/dpapp/sct/bin/isct_antsApplyTransforms -d 3 -i src.nii -o src_reg.nii -t warp_src2dest.nii.gz -r dest.nii -n Linear # in /private/var/folders/ff/px4nh9y56fb6kxfmwdks37bc0000gr/T/sct-20191218163606.183500-kuo1i843
Copy affine matrix from destination space to make sure qform/sform are the same.
Done! To view results, type:
fsleyes dest.nii src_reg.nii &
Apply transfo dest --> source...
Parse list of warping fields...
Get dimensions of data...
384 x 384 x 18 x 1
Apply transformation...
/Users/dpapp/sct/bin/isct_antsApplyTransforms -d 3 -i dest.nii -o dest_reg.nii -t warp_dest2src.nii.gz -r src.nii -n Linear # in /private/var/folders/ff/px4nh9y56fb6kxfmwdks37bc0000gr/T/sct-20191218163606.183500-kuo1i843
Copy affine matrix from destination space to make sure qform/sform are the same.
Done! To view results, type:
fsleyes src.nii dest_reg.nii &
Generate output files...
WARNING: File sF3T_2013_40_602-155559-00001-00001-1_reg.nii already exists. Deleting it...
File created: sF3T_2013_40_602-155559-00001-00001-1_reg.nii
WARNING: File warp_sF3T_2013_40_602-155559-00001-00001-12medic.nii.gz already exists. Deleting it...
File created: warp_sF3T_2013_40_602-155559-00001-00001-12medic.nii.gz
WARNING: File medic_reg.nii already exists. Deleting it...
File created: medic_reg.nii
WARNING: File warp_medic2sF3T_2013_40_602-155559-00001-00001-1.nii.gz already exists. Deleting it...
File created: warp_medic2sF3T_2013_40_602-155559-00001-00001-1.nii.gz
Remove temporary files...
rm -rf /var/folders/ff/px4nh9y56fb6kxfmwdks37bc0000gr/T/sct-20191218163606.183500-kuo1i843
Finished! Elapsed time: 80s
Done! To view results, type:
fsleyes sF3T_2013_40_602-155559-00001-00001-1.nii medic_reg.nii &
Done! To view results, type:
fsleyes medic.nii sF3T_2013_40_602-155559-00001-00001-1_reg.nii &
all good! it says " iter … 0" on STEP #0, meaning that the syn algo is effectively not used. I know the verbose can be confusing though…