function smm = unpicpermute(imgdata, originalimg)
% takes a column (r g b) linear space 

imgdata = permute(imgdata, [1 3 2]);
planesize = size(originalimg(:,:,1));
sm1 = reshape(imgdata(:,:,1),planesize);
sm2 = reshape(imgdata(:,:,2),planesize);
sm3 = reshape(imgdata(:,:,3),planesize);
smm = cat(3,sm1,sm2,sm3);

