Print

Print


Hi,
I've been trouble shooting this here on my end (because of confidentiality issues, we'd rather not send the files unless absolutely necessary). One hypothesis we've tested so far is that the problem may be WM mask (as outputted by FAST) not encompassing the lesions, so I've also tried lesion_filling with a mask that includes both normal and lesioned white matter. That does not help and produces the same error. If we can't get any further on our end here, I can hopefully get the consent of the study team to send the files.
Best wishes,
Mariya

Mariya Cherkasova, PhD
CIHR and MSFHR/LJHFM Fellow
Pacific Parkinson's Research Centre
University of British Columbia
2221 Westbrook Mall, rm M46C
Vancouver, BC V6T 2B5
phone: 604-822-3428
fax: 604-822-7866

________________________________________
From: FSL - FMRIB's Software Library [[log in to unmask]] on behalf of Dan Evans [[log in to unmask]]
Sent: March-21-19 1:02 PM
To: [log in to unmask]
Subject: Re: [FSL] Error in lesion_filling

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

########################################################################

To unsubscribe from the FSL list, click the following link:
https://www.jiscmail.ac.uk/cgi-bin/webadmin?SUBED1=FSL&A=1