function data = loadSPECTdata(path,patientID,cm)
%loadData Summary of this function goes here
%   Detailed explanation goes here
    
    c1=size(cm,1);
    
    ofile=fullfile(path,patientID,sprintf('%sVolume0.nrrd',patientID));
    headerInfo = nhdr_nrrd_read(ofile,1);
    a0=headerInfo.data;
    [i1,i2,i3]=size(a0);

    data=zeros(i1,i2,i3,c1);

    for i=1:c1
        s=sprintf('%sVolume%d.nrrd',patientID,i-1);
        ofile=fullfile(path,patientID,s);
        hInfo = nhdr_nrrd_read(ofile,1);
        hInfo.data(hInfo.data<0)=0;
        data(:,:,:,i)=hInfo.data/cm(i);
    end


end

