Dear AFNIers,
I would like to use a WM lesion map, derived from a FLAIR image with the Lesion Segmentation Toolbox (LST) in SPM, as a mask to extract values of interest from a functional scan. However, I’m having troubles getting the images aligned properly. The FLAIR has AIL orientation and the functional scan RAI orientation. The LST output is in TLRC space (but seems aligned to a MNI template).
I’ve searched the message board and used 3dresample, 3dWarp, and 3dAllineate. The latter seems to work best but the output is not quite a match although the orientation differences seem to be corrected. This may be due to template differences? Below, you find tons of information on the orientation and geometry of the images as well as some example commands and unsuccessful approaches.
An aside question: the scans are built with dcm2nii - could this cause potential issues with left-right flip? It doesn’t seem so.
I’d be really grateful for any tips and suggestions!
Thanks so much in advance,
Nic
############################ SCAN INFORMATION ############################
FLAIR
T2SPACEFLAIRvb17bw651subj.nii
Template Space: ORIG
Data Axes Tilt: Oblique (10.911 deg. from plumb)
Data Axes Approximate Orientation:
first (x) = Anterior-to-Posterior
second (y) = Inferior-to-Superior
third (z) = Left-to-Right [-orient AIL]
R-to-L extent: -73.036 [R] -to- 101.965 [L] -step- 1.000 mm [176 voxels]
A-to-P extent: -168.287 [A] -to- 86.713 [P] -step- 1.000 mm [256 voxels]
I-to-S extent: -174.799 [I] -to- 80.201 [S] -step- 1.000 mm [256 voxels]
R-to-L center: 14.464 [L]
A-to-P center: -40.787 [A]
I-to-S center: -47.299 [I]
FUNCTIONAL SCAN
pb00.subj.r01.tcat+orig.
Template Space: ORIG
Data Axes Tilt: Oblique (10.912 deg. from plumb)
Data Axes Approximate Orientation:
first (x) = Right-to-Left
second (y) = Posterior-to-Anterior
third (z) = Inferior-to-Superior [-orient RPI]
R-to-L extent: -95.113 [R] -to- 93.887 [L] -step- 3.000 mm [ 64 voxels]
A-to-P extent: -119.949 [A] -to- 69.051 [P] -step- 3.000 mm [ 64 voxels]
I-to-S extent: -112.225 [I] -to- 4.025 [S] -step- 3.750 mm [ 32 voxels]
R-to-L center: -0.613 [R]
A-to-P center: -25.449 [A]
I-to-S center: -54.100 [I]
pb02.subj.r01.volreg+tlrc
Template Space: TT_N27
Data Axes Tilt: Plumb
Data Axes Orientation:
first (x) = Right-to-Left
second (y) = Anterior-to-Posterior
third (z) = Inferior-to-Superior [-orient RAI]
R-to-L extent: -79.500 [R] -to- 79.500 [L] -step- 3.000 mm [ 54 voxels]
A-to-P extent: -79.500 [A] -to- 109.500 [P] -step- 3.000 mm [ 64 voxels]
I-to-S extent: -63.500 [I] -to- 83.500 [S] -step- 3.000 mm [ 50 voxels]
R-to-L center: 0.000
A-to-P center: 15.000 [P]
I-to-S center: 10.000 [S]
LST OUTPUT
ples_lpa_mrT2SPACEFLAIRvb17bw651subj.nii
Template Space: TLRC
Data Axes Tilt: Oblique (11.275 deg. from plumb)
Data Axes Approximate Orientation:
first (x) = Anterior-to-Posterior
second (y) = Inferior-to-Superior
third (z) = Left-to-Right [-orient AIL]
R-to-L extent: -78.326 [R] -to- 96.674 [L] -step- 1.000 mm [176 voxels]
A-to-P extent: -164.654 [A] -to- 90.346 [P] -step- 1.000 mm [256 voxels]
I-to-S extent: -178.495 [I] -to- 76.505 [S] -step- 1.000 mm [256 voxels]
R-to-L center: 9.174 [L]
A-to-P center: -37.154 [A]
I-to-S center: -50.995 [I]
############################ EXAMPLE COMMANDS ############################
ALIGN LST OUTPUT TO FUNCTIONAL SCAN
The _al output seems to mostly align with the functional scan but is tilted to the left in the AFNI viewer. The LST output is in AIL and functional scan in RAI → using 3dresample but the probability map is totally off then.
3dAllineate -base pb02.subj.r01.volreg+tlrc -input ples_lpa_mrT2SPACEFLAIRvb17bw651subj.nii -1Dmatrix_save al_matrix_1mm -mast_dxyz 1 -prefix lesion_map_al_1mm
3dresample -master pb02.subj.r01.volreg+tlrc -input ples_lpa_mrT2SPACEFLAIRvb17bw651subj.nii -prefix ples_lpa_mrT2SPACEFLAIRvb17bw651subj_reoriented_3mm
lesion_map_al_1mm+tlrc
Template Space: TT_N27
Data Axes Tilt: Plumb
Data Axes Orientation:
first (x) = Right-to-Left
second (y) = Anterior-to-Posterior
third (z) = Inferior-to-Superior [-orient RAI]
R-to-L extent: -80.500 [R] -to- 80.500 [L] -step- 1.000 mm [162 voxels]
A-to-P extent: -80.500 [A] -to- 110.500 [P] -step- 1.000 mm [192 voxels]
I-to-S extent: -64.500 [I] -to- 84.500 [S] -step- 1.000 mm [150 voxels]
R-to-L center: 0.000
A-to-P center: 15.000 [P]
I-to-S center: 10.000 [S]
ples_lpa_mrT2SPACEFLAIRvb17bw651subj_reoriented_3mm+tlrc.
Template Space: TLRC
Data Axes Tilt: Plumb
Data Axes Orientation:
first (x) = Right-to-Left
second (y) = Anterior-to-Posterior
third (z) = Inferior-to-Superior [-orient RAI]
R-to-L extent: -79.500 [R] -to- 79.500 [L] -step- 3.000 mm [ 54 voxels]
A-to-P extent: -79.500 [A] -to- 109.500 [P] -step- 3.000 mm [ 64 voxels]
I-to-S extent: -63.500 [I] -to- 83.500 [S] -step- 3.000 mm [ 50 voxels]
R-to-L center: 0.000
A-to-P center: 15.000 [P]
I-to-S center: 10.000 [S]
REORIENTING FROM AIL TO RAI BEFORE ALIGNMENT OF LST OUTPUT TO FUNCTIONAL SCAN
#Again, the reoriented_pre_al output seems to mostly align with the functional scan but is tilted to the left in the AFNI viewer.
3dresample -master pb02.subj.r01.volreg+tlrc -dxyz 1.0 1.0 1.0 -input ples_lpa_mrT2SPACEFLAIRvb17bw651subj.nii -prefix ples_lpa_mrT2SPACEFLAIRvb17bw651subj_reoriented
3dAllineate -base pb02.subj.r01.volreg+tlrc -input ples_lpa_mrT2SPACEFLAIRvb17bw651subj_reoriented+tlrc. -1Dmatrix_save al_matrix_1mm_reoriented -mast_dxyz 1 -prefix lesion_map_al_1mm_reoriented_pre_al
ples_lpa_mrT2SPACEFLAIRvb17bw651subj_reoriented
Template Space: TLRC
Data Axes Tilt: Plumb
Data Axes Orientation:
first (x) = Right-to-Left
second (y) = Anterior-to-Posterior
third (z) = Inferior-to-Superior [-orient RAI]
R-to-L extent: -80.500 [R] -to- 80.500 [L] -step- 1.000 mm [162 voxels]
A-to-P extent: -80.500 [A] -to- 110.500 [P] -step- 1.000 mm [192 voxels]
I-to-S extent: -64.500 [I] -to- 84.500 [S] -step- 1.000 mm [150 voxels]
R-to-L center: 0.000
A-to-P center: 15.000 [P]
I-to-S center: 10.000 [S]
lesion_map_al_1mm_reoriented_pre_al+tlrc
Template Space: TT_N27
Data Axes Tilt: Plumb
Data Axes Orientation:
first (x) = Right-to-Left
second (y) = Anterior-to-Posterior
third (z) = Inferior-to-Superior [-orient RAI]
R-to-L extent: -80.500 [R] -to- 80.500 [L] -step- 1.000 mm [162 voxels]
A-to-P extent: -80.500 [A] -to- 110.500 [P] -step- 1.000 mm [192 voxels]
I-to-S extent: -64.500 [I] -to- 84.500 [S] -step- 1.000 mm [150 voxels]
R-to-L center: 0.000
A-to-P center: 15.000 [P]
I-to-S center: 10.000 [S]
############################ OTHER UNSUCCESSFUL APPROACHES ############################