function [parcel] = computeWM_Parcellation(imageSegmentation_Path,imageParcellation_Path,WM_labl,reduced_parcellation_path)
%Extract WM parcel labels


imageSegmentation_nii = load_untouch_nii(imageSegmentation_Path);
imageSegmentation = uint16(imageSegmentation_nii.img);

% reslice_nii(imageParcellation_Path, imageParcellation_Path);

imageParcellation_nii = load_untouch_nii(imageParcellation_Path);
imageParcellation = uint16(imageParcellation_nii.img);


if(size(imageSegmentation)~=size(imageParcellation))
     disp 'Input images need to be the same size';
     return;
 end

 img = uint16(zeros(size(imageSegmentation)));
img(imageSegmentation==WM_labl)=1;
% img(imageSegmentation==Sub_cortLabel)=55;

 parcel=(imageParcellation.*img);

% new_img = imageSegmentation_nii;
new_img.img = parcel;
new_img.hdr=imageSegmentation_nii.hdr;
new_img.filetype=imageSegmentation_nii.filetype;
new_img.machine=imageSegmentation_nii.machine;
new_img.fileprefix=reduced_parcellation_path;

save_nii(new_img,reduced_parcellation_path);
end