|
4 | 4 | % |
5 | 5 | % Synopsis |
6 | 6 | % D = cd_images(D); % get new path from GUI |
7 | | -% D = cd_images(D, '/new/root/path'); |
| 7 | +% D = cd_images(D, '/new/root/path'); |
8 | 8 | % D = cd_images(D, '/new/root/path', 1); % force byteswap |
9 | | -% D = cd_images(D, '/new/root/path', 1); % prevent byteswap |
10 | | -% |
| 9 | +% D = cd_images(D, '/new/root/path', 1); % prevent byteswap |
| 10 | +% |
11 | 11 | % D - mardo design |
12 | 12 | % newpath - path to replace common path of files in analysis [GUI] |
13 | | -% byteswap - whether to indicate byte swapping in vol structs |
| 13 | +% byteswap - whether to indicate byte swapping in vol structs |
14 | 14 | % [determined from images by default] |
15 | | -% |
| 15 | +% |
16 | 16 | % $Id$ |
17 | | - |
| 17 | + |
18 | 18 | if nargin < 2 |
19 | 19 | newpath = spm_get(-1, '', 'New directory root for files'); |
20 | 20 | end |
|
35 | 35 | n = length(VY); |
36 | 36 | strout = strvcat(VY(:).fname); |
37 | 37 | msk = diff(strout+0)~=0; % common path |
38 | | -d1 = min(find(sum(msk,1))); |
| 38 | +d1 = min(find(sum(msk,1))); |
39 | 39 | d1 = max([find(strout(1,1:d1) == other_filesep | strout(1,1:d1) == filesep) 0]); |
40 | 40 | ffnames = strout(:,d1+1:end); % common path removed |
41 | 41 | tmp = ffnames == other_filesep; % filesep exchanged for this platform |
|
48 | 48 | if ~exist(nfnames{1}, 'file') |
49 | 49 | error(['Cannot find first file here: ' nfnames{1}]); |
50 | 50 | end |
51 | | -if isempty(byteswap) |
| 51 | +if isempty(byteswap) |
52 | 52 | byteswap = mars_vol_utils('is_swapped_wrong', VY(1)); |
53 | 53 | end |
54 | 54 |
|
|
58 | 58 | if verbose(D) |
59 | 59 | disp('Images vols byteswapped'); |
60 | 60 | end |
61 | | -end |
| 61 | +end |
62 | 62 |
|
63 | 63 | D = set_images(D, VY); |
0 commit comments