1
0

dicomrt_create1dmesh.m 507 B

12345678910111213141516171819202122
  1. function [mesh] = dicomrt_create1dmesh(start,pix,dim,dir)
  2. % dicomrt_create1dmesh(start,pix,dim,dir)
  3. %
  4. % Create one dimensional mesh.
  5. %
  6. % See also dicomrt_loadct, dicomrt_loaddose
  7. %
  8. % Copyright (C) 2002 Emiliano Spezi (emiliano.spezi@physics.org)
  9. % set up vector dimensions
  10. mesh=zeros(dim,1);
  11. % create mesh
  12. if dir == 0 % positive direction
  13. for i=1:dim
  14. mesh(i)=start+(pix.*double(i))-pix;
  15. end
  16. else % negative direction
  17. for i=1:dim
  18. mesh(i)=start-(pix.*double(i))+pix;
  19. end
  20. end