Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DCT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
graintracking
DCT
Commits
0526acac
Commit
0526acac
authored
11 years ago
by
Yoann Guilhem
Browse files
Options
Downloads
Patches
Plain Diff
Code formatting in gtCopyDataForTest
Signed-off-by:
Yoann Guilhem
<
yoann.guilhem@esrf.fr
>
parent
92f62aa7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
zUtil_Help/gtCopyDataForTest.m
+26
-32
26 additions, 32 deletions
zUtil_Help/gtCopyDataForTest.m
with
26 additions
and
32 deletions
zUtil_Help/gtCopyDataForTest.m
+
26
−
32
View file @
0526acac
...
...
@@ -27,10 +27,10 @@ if ~exist('newdir', 'var') || isempty(newdir)
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
d
irectories
%
D
irectories
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
disp
(
'Creating the directories...'
)
if
exist
(
fullfile
(
newdir
,
new_pattern
),
'dir'
)
disp
(
'Creating the
new dataset
directories...'
)
;
if
exist
(
fullfile
(
newdir
,
new_pattern
),
'dir'
)
gtError
(
'gtCopyDataForTest:wrong_directory'
,
...
'New directory already exists. Please check the directory name.'
);
elseif
~
exist
(
newdir
,
'dir'
)
...
...
@@ -41,11 +41,11 @@ end
[
~
,
msg
]
=
mkdir
(
fullfile
(
newdir
,
new_pattern
,
'0_rawdata'
,
'Orig'
));
disp
(
msg
);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
i
mages
%
I
mages
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
c
opying data
disp
(
'Copying the images...'
)
%
C
opying data
disp
(
'Copying
and
the images
to the new directory
...'
)
;
copyfile
(
fullfile
(
workdir
,
old_pattern
,
'0_rawdata'
,
'Orig'
,
'*.edf'
),
...
fullfile
(
newdir
,
new_pattern
,
'0_rawdata'
,
'Orig'
),
'f'
);
...
...
@@ -53,10 +53,10 @@ disp('Copying the info file...');
copyfile
(
fullfile
(
workdir
,
old_pattern
,
'0_rawdata'
,
'Orig'
,
'*.info'
),
...
fullfile
(
newdir
,
new_pattern
,
'0_rawdata'
,
'Orig'
),
'f'
);
olddir
=
pwd
;
olddir
=
pwd
;
% Set path to tomo_utils.py script
global
GT_MATLAB_HOME
global
GT_MATLAB_HOME
;
tomoUtilsScript
=
fullfile
(
GT_MATLAB_HOME
,
'zUtil_Python'
,
'tomo_utils.py'
);
% Enter old dataset Orig directopy
...
...
@@ -68,47 +68,43 @@ is_interlaced = exist([old_pattern '0_0000.edf'], 'file');
disp
(
'Renaming the images...'
);
filenames
=
[
old_pattern
'*.edf'
];
if
(
is_interlaced
)
image_old
=
[
old_pattern
'0_'
];
image_new
=
[
new_pattern
'0_'
];
image_old
=
[
old_pattern
'0_'
];
image_new
=
[
new_pattern
'0_'
];
cmd
=
[
tomoUtilsScript
...
' -rename
''
'
filenames
'
''
''
'
image_old
'
''
''
'
image_new
'
''
'
];
[
s
,
msg
]
=
gtPythonCommand
(
cmd
);
disp
(
msg
);
image_old
=
[
old_pattern
'1_'
];
image_new
=
[
new_pattern
'1_'
];
[
~
,
msg
]
=
gtPythonCommand
(
cmd
);
disp
(
msg
);
image_old
=
[
old_pattern
'1_'
];
image_new
=
[
new_pattern
'1_'
];
cmd
=
[
tomoUtilsScript
...
' -rename
''
'
filenames
'
''
''
'
image_old
'
''
''
'
image_new
'
''
'
];
[
s
,
msg
]
=
gtPythonCommand
(
cmd
);
disp
(
msg
);
[
~
,
msg
]
=
gtPythonCommand
(
cmd
);
disp
(
msg
);
else
cmd
=
[
tomoUtilsScript
...
cmd
=
[
tomoUtilsScript
...
' -rename
''
'
filenames
'
''
''
'
old_pattern
'
''
''
'
new_pattern
'
''
'
];
[
s
,
msg
]
=
gtPythonCommand
(
cmd
);
disp
(
msg
);
[
~
,
msg
]
=
gtPythonCommand
(
cmd
);
disp
(
msg
);
end
cd
(
olddir
);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
c
opying xml file
%
C
opying xml file
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
disp
(
'Copying the xml file...'
)
disp
(
'Copying the xml file...'
)
;
%xmlold = fullfile(workdir, old_pattern, '0_rawdata', old_pattern, [old_pattern '.xml']);
xmlold
=
fullfile
(
workdir
,
old_pattern
,
'0_rawdata'
,
'Orig'
,
[
old_pattern
'.xml'
]);
xmlnew
=
fullfile
(
newdir
,
new_pattern
,
'0_rawdata'
,
'Orig'
,
[
new_pattern
'.xml'
]);
copyfile
(
xmlold
,
xmlnew
,
'f'
);
copyfile
(
xmlold
,
xmlnew
,
'f'
);
% changing fields in xml file
% disp('Renaming fields in the xml file...')
disp
(
'Renaming scan name field in the xml file...'
);
cmd
=
[
'sed -i -e "s/'
old_pattern
'/'
new_pattern
'/g " '
xmlnew
];
[
s
,
msg
]
=
unix
(
cmd
);
disp
(
msg
)
[
~
,
msg
]
=
unix
(
cmd
);
disp
(
msg
)
;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Header information
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
c
opy *.xml file to *dct_.xml adding some information from headers of
% ref0000_0000.edf and darkend0000.
xml
images
%
C
opy *.xml file to *dct_.xml adding some information from headers of
% ref0000_0000.edf and darkend0000.
edf
images
wd
=
pwd
;
cd
(
fullfile
(
newdir
,
new_pattern
,
'0_rawdata'
,
'Orig'
));
...
...
@@ -118,9 +114,7 @@ gtUpdateXmlFile();
cd
(
wd
);
% copy DB tables and values
gtDBCopyAllTables
(
old_pattern
,
new_pattern
);
gtDBCreateSpotPairTable
(
new_pattern
,
1
);
end
gtDBCopyAllTables
(
old_pattern
,
new_pattern
);
gtDBCreateSpotPairTable
(
new_pattern
,
1
);
end
% end of function
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment