function lupusWMLsegm(inputFolder)
    tic
    
    tissues=spmTissueSegment(inputFolder,'T1','spmSegmTissue.T1.nii');
    
    regSingle([inputFolder 'T1.nii'], [inputFolder 'FLAIR.nii']);
    flair=load_untouch_nii([inputFolder '/rFLAIR.nii']);
    
    %Denoising by Perona and Malik
        num_iter = 1;
        delta_t = 3/44;
        kappa = 50;
        option = 1;
        voxel_spacing = ones(3,1);
        flair_denoised = anisodiff3D(flair.img, num_iter, delta_t, kappa, option, voxel_spacing);
    
    %Intensity inhomogeneities correction by N3
        mask=zeros(size(tissues));
        mask(tissues>0)=1;
        flair_denoised(~mask)=0;
    
    [flairN3, biasField, maskOut] = iic(double(flair_denoised), ...
        'smoothingDistance', 30, ...
        'stepSize', [flair.hdr.dime.pixdim(2), flair.hdr.dime.pixdim(3), flair.hdr.dime.pixdim(4)], ...
        'smoothingRegularization', 1e-4, ...
        'backgroundThresholdType','otzu');
    
    
    %WM lesion segmentation
    
    % Getting the Posterior Fossa
    deformBack([inputFolder '/iy_T1.nii'], 'structures/pFossa.nii');
    movefile('wpFossa.nii', inputFolder);
    pFossa=load_untouch_nii([inputFolder 'wpFossa.nii']);
    window=strel('disk',3);
    pFossa.img(pFossa.img~=1)=0;
    pFossa=imdilate(pFossa.img,window);
    
    alpha = 2.5;        % standard deviation multiplier (t = \mu + \alpha*\sigma)    
    omega_n = 0.7;      % percentage of neighbor lesion voxels in WM
    min_size = 3;       % minimum number of voxels per lesion

    [lesion_mask] = WMLSegmentation(double(flairN3), double(tissues), alpha, omega_n, min_size, pFossa);

    flair.img=lesion_mask;
    save_untouch_nii(flair, [inputFolder '/segm_lesion.nii']);
    toc
end