loadPixels.m 463 B

12345678910111213141516171819
  1. function v0=loadPixels(segm, patientID)
  2. fs=string(segm.Alias_ID);
  3. for i=1:size(fs,1)
  4. fs(i)=erase(fs(i)," ");
  5. end
  6. regionIds=segm.Region_Id(fs==patientID);
  7. nr=size(regionIds,1);
  8. vtemp=zeros(nr,3);
  9. %rotate to match convention below
  10. vtemp(:,3)=segm.X(fs==patientID);
  11. vtemp(:,2)=segm.Y(fs==patientID);
  12. vtemp(:,1)=segm.Z(fs==patientID);
  13. v0=vtemp;
  14. for j=1:nr
  15. v0(regionIds(j)+1,:)=vtemp(j,:);
  16. end
  17. end