Hello,
I am getting the same error and have not had any luck solving it yet. Below I have included the verbose output from running the lesion filling command as well as the relevant code I used. Thanks for your help.
ERROR MESSAGE:
Read in images
Counted lesions in mask : total = 1408
Calculated outer border mask
Calculated outer border components
Calculated inner border and region masks
Component 1 of 1408
Component 2 of 1408
Cols = 1 and rows = 41
Calculating cummulative distribution
Random sampling...
Putting samples back into image
Values are : 263.390015 243.080002 261.850006 261.359985 270.040009 232.960007 245.610001
Image Exception : #4 :: Incompatible number of mask positions and matrix columns
libc++abi.dylib: terminating with uncaught exception of type RBD_COMMON::BaseException
Trac_LS_lesfill.sh: line 40: 38604 Abort trap: 6 lesion_filling -i MPRAGE.nii -l ${i}_LL_HRmask.nii.gz -w WM_mask.nii.gz -o ${i}_MPRAGE_filled_FSL.nii.gz -v
RELEVANT CODE:
#################################################################
# PURPOSE: This script uses the lesion probability map from the Lesion Segmentation Toolbox to create a binary lesion mask with a user defined threshold.
# It then uses that mask to fill lesions in the MPRAGE based on a transformation from the LST normalized FLAIR image to MPRAGE space.
#################################################################
sublist='Trac003'
thresh=0.4
for i in $sublist; do
# filepaths
#cwd=/Data/TracMRI/LesionSegmentationTesting/pre/${i}
cd /Data/TracMRI/LesionSegmentationTesting/pre/${i}
# Create binary lesion masks based on LST probability map
fslmaths ples_lpa_*.nii -thr ${thresh} temp.nii.gz
fslmaths temp.nii.gz -bin ${i}_LM_thresh_${thresh}.nii.gz
rm temp.nii.gz
# Register standard space to mprage and output transformation matrix
flirt -in /usr/local/fsl/data/standard/MNI152_T1_1mm_brain.nii.gz -ref ${i}_MPRAGE_brain.nii.gz -omat standard2highres.mat
# Segment brain extracted MPRAGE and binarize WM mask
fast -t 1 -n 3 -a standard2highres.mat -o sgm ${i}_MPRAGE_brain.nii.gz
fslmaths sgm_pve_2.nii.gz -bin WM_mask.nii.gz
# Register LST normalized FLAIR to MPRAGE
flirt -in mrAxialT2_*.nii -ref MPRAGE.nii -omat mrflair2highres.mat
flirt -in ${i}_LM_thresh_${thresh}.nii.gz -ref MPRAGE.nii -out ${i}_LL_HRmask.nii.gz -applyxfm -init mrflair2highres.mat -noresampblur
# Fill lesions
lesion_filling -i MPRAGE.nii -l ${i}_LL_HRmask.nii.gz -w WM_mask.nii.gz -o ${i}_MPRAGE_filled_FSL.nii.gz -v
done
Best,
Dan
Daniel G. Evans
Neuroimaging Manager
Clinical Neuroscience Lab
Department of Psychology
The Ohio State University, Columbus, OH
########################################################################
To unsubscribe from the FSL list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1
|