Skip to content

Commit

Permalink
Use fullfile for more stable path management and fix IO_stf problem w…
Browse files Browse the repository at this point in the history
…ith one beam
  • Loading branch information
wahln committed Jan 29, 2024
1 parent d9437f2 commit d6175ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions IO_stf.m
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
function status = IO_stf(path)

stf_init = load(strcat(path,'stf_with_separate_rays.mat'), 'stf');
ray_init = load(strcat(path,'stf_with_separate_rays.mat'), 'rays');
stf_init = load(fullfile(path,'stf_with_separate_rays.mat'), 'stf');
ray_init = load(fullfile(path,'stf_with_separate_rays.mat'), 'rays');

%%
stf = [stf_init.stf{:}];

if numel(stf) == 1
ray_init.rays = {ray_init.rays};
end

ray = cell(size(ray_init.rays, 2), 1);

for i=1:size(ray_init.rays, 2)
Expand All @@ -16,7 +21,7 @@
end

%%
save(strcat(path,'stf.mat'), 'stf')
save(fullfile(path,'stf.mat'), 'stf')

status = 'STF written';

Expand Down
2 changes: 1 addition & 1 deletion matRad_callFromPython.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ function matRad_callFromPython(functionName, outputName, inputPath, outputPath,

for i=1:length(varargin)
if contains(string(varargin{i}), string('.mat'))
load(strcat(inputPath, varargin{i}));
load(fullfile(inputPath, varargin{i}));
[path, var, ext]=fileparts(varargin{i});
functionVars{i}=var;
else
Expand Down

0 comments on commit d6175ce

Please sign in to comment.