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
8dc539c1
Commit
8dc539c1
authored
10 years ago
by
preischig
Browse files
Options
Downloads
Patches
Plain Diff
gtConvertRawImages2Blobs: added basic help and formatted
Signed-off-by:
preischig
<
preischig@gmail.com
>
parent
1e26739a
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
2_difspot/gtConvertRawImages2Blobs.m
+64
-56
64 additions, 56 deletions
2_difspot/gtConvertRawImages2Blobs.m
with
64 additions
and
56 deletions
2_difspot/gtConvertRawImages2Blobs.m
+
64
−
56
View file @
8dc539c1
function
gtConvertRawImages2Blobs
(
first
,
last
,
workingdirectory
,
varargin
)
%
GTCONVERTRAWIMAGES2BLOBS
Loads
diff
blobs
from
database
and
saves
them
as
%
hdf5
files
.
%
%
gtConvertRawImages2Blobs
(
first
,
last
,
workingdirectory
,
varargin
)
%
%
To
speed
up
,
run
it
in
parallel
using
OAR
(
OAR
_
make
)
.
if
(
isdeployed
)
global
GT
_
DB
global
GT
_
MATLAB
_
HOME
load
(
'
workspaceGlobal
.
mat
'
)
end
if
(
isdeployed
)
global
GT
_
DB
global
GT
_
MATLAB
_
HOME
load
(
'
workspaceGlobal
.
mat
'
)
end
cd
(
workingdirectory
)
;
gtDBConnect
()
;
parameters
=
[]
;
load
(
'
parameters
.
mat
'
)
;
cd
(
workingdirectory
)
;
gtDBConnect
()
;
parameters
=
[]
;
load
(
'
parameters
.
mat
'
)
;
if
(
~
exist
(
'
first
',
'
var
'
)
||
isempty
(
first
))
first
=
1
;
end
difblob
_
num
=
mym
([
'
select
count
(*) from ' parameters.acq.name 'difblob']);
if (~exist('last', 'var') || isempty(last))
last = difblob_num;
end
if
(
~
exist
(
'
first
',
'
var
'
)
||
isempty
(
first
))
first
=
1
;
end
difblob
_
num
=
mym
([
'
select
count
(*) from ' parameters.acq.name 'difblob']);
if (~exist('last', 'var') || isempty(last))
last = difblob_num;
end
if (isdeployed)
first = str2double(first);
last = str2double(last);
end
if (isdeployed)
first = str2double(first);
last = str2double(last);
end
conf = struct('list', first:last, 'dilate', 5);
conf = parse_pv_pairs(conf, varargin);
info = edf_info(fullfile('1_preprocessing', 'full', 'full0000.edf'));
totproj = parameters.acq.nproj *2;
stats = GtTasksStatistics();
stats.add_task('load_blob', 'Time to load from DB');
stats.add_task('load_mask', 'Time to load mask');
stats.add_task('save_blob', 'Time to save to HDF5');
stats.add_task('convert_blob', 'Time for converting from DB to HDF5')
fprintf('Progress: ')
c = tic();
for ii = conf.list
num_chars = fprintf('%06d/%06d (%s)', ii, numel(conf.list), ...
stats.get_formatted_total('convert_blob'));
stats.tic('convert_blob')
stats.tic('load_mask')
[mask, bb] = get_mask('2_difspot', ii, parameters, conf);
mask(mask < 0) = 0;
stats.toc('load_mask')
stats.tic('load_blob')
blob = get_blob(bb, info, totproj);
blob(blob < 0) = 0;
stats.toc('load_blob')
stats.tic('save_blob')
gtWriteBlobToHDF5('2_difblob', ii, blob, bb, mask);
stats.toc('save_blob')
stats.toc('convert_blob')
fprintf(repmat('\b', [1 num_chars]))
end
fprintf('%06d Done in %f seconds.\n', numel(conf.list), toc(c));
stats.printStats()
conf = struct('list', first:last, 'dilate', 5);
conf = parse_pv_pairs(conf, varargin);
info = edf_info(fullfile('1_preprocessing', 'full', 'full0000.edf'));
totproj = parameters.acq.nproj *2;
stats = GtTasksStatistics();
stats.add_task('load_blob', 'Time to load from DB');
stats.add_task('load_mask', 'Time to load mask');
stats.add_task('save_blob', 'Time to save to HDF5');
stats.add_task('convert_blob', 'Time for converting from DB to HDF5')
fprintf('Progress: ')
c = tic();
for ii = conf.list
num_chars = fprintf('%06d/%06d (%s)', ii, numel(conf.list), ...
stats.get_formatted_total('convert_blob'));
stats.tic('convert_blob')
stats.tic('load_mask')
[mask, bb] = get_mask('2_difspot', ii, parameters, conf);
mask(mask < 0) = 0;
stats.toc('load_mask')
stats.tic('load_blob')
blob = get_blob(bb, info, totproj);
blob(blob < 0) = 0;
stats.toc('load_blob')
stats.tic('save_blob')
gtWriteBlobToHDF5('2_difblob', ii, blob, bb, mask);
stats.toc('save_blob')
stats.toc('convert_blob')
fprintf(repmat('\b', [1 num_chars]))
end
fprintf('%06d Done in %f seconds.\n', numel(conf.list), toc(c));
stats.printStats()
end
function blob = get_blob(bb, info, totproj)
...
...
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