Skip to content

Commit

Permalink
Modified Internal/isRightNameFormat.m to fix zero padding if it is sc…
Browse files Browse the repository at this point in the history
…rewed up.
  • Loading branch information
Paul Wiggins committed Sep 5, 2018
1 parent 2c77421 commit 6d58c6e
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions Internal/isRightNameFormat.m
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,36 @@
rightNames = false;
end


%% fix the padding if required
contents = dir([dirname,filesep,'*.tif*']);

num_im = numel(contents);
pad = [];

for i = 1:num_im;
nameInfo = ReadFileName( contents(i).name );
pad = [pad, nameInfo.npos(1,4)];
end

if 1 ~= numel( unique( pad ) )

maxpad = max( pad );

ind = find( pad < maxpad );

for i = ind
nameInfo = ReadFileName( contents(i).name );

nameInfo.npos(1,4) = maxpad;

movefile( [dirname,filesep,contents(i).name], ...
[dirname,filesep,MakeFileName(nameInfo)] );
end
end




end

0 comments on commit 6d58c6e

Please sign in to comment.