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
8759f5d5
Commit
8759f5d5
authored
12 years ago
by
Nicola Vigano
Browse files
Options
Downloads
Patches
Plain Diff
Trivial formatting
Signed-off-by:
Nicola Vigano
<
nicola.vigano@esrf.fr
>
parent
28ef5566
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
5_reconstruction/gtAstra3D.m
+2
-3
2 additions, 3 deletions
5_reconstruction/gtAstra3D.m
5_reconstruction/gtAstraAbsorptionVolume.m
+1
-2
1 addition, 2 deletions
5_reconstruction/gtAstraAbsorptionVolume.m
5_reconstruction/gtAstra_FBP2D.m
+18
-23
18 additions, 23 deletions
5_reconstruction/gtAstra_FBP2D.m
with
21 additions
and
28 deletions
5_reconstruction/gtAstra3D.m
+
2
−
3
View file @
8759f5d5
...
...
@@ -26,11 +26,11 @@ function volume = gtAstra3D(~, ~, ~, proj)
% Version 002 26-09-2012 by LNervo
% Formatting, cleaning, commenting
OK
=
gtCheckGpu
();
if
~
OK
mexc
=
MException
(
'ASTRA:no_GPU'
,
'gtAstra3D: Submit this job on a GPU machine ! Exiting...'
);
mexc
=
MException
(
'ASTRA:no_GPU'
,
...
'gtAstra3D: Submit this job on a GPU machine ! Exiting...'
);
throw
(
mexc
)
else
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...
...
@@ -67,7 +67,6 @@ else
volume
=
astra_mex_data3d
(
'get'
,
vol_id
);
% vol is now a 3d "matrix" of size [x,y,z]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% clean up
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
...
...
This diff is collapsed.
Click to expand it.
5_reconstruction/gtAstraAbsorptionVolume.m
+
1
−
2
View file @
8759f5d5
...
...
@@ -18,11 +18,10 @@ end
projname
=
fullfile
(
parameters
.
acq
.
dir
,
'absorption_stack.mat'
);
proj
=
[];
if
exist
(
projname
,
'file'
)
check
=
inputwdefault
(
'Absorption stack already exists - do you want to (re)-create it ? [y/n]'
,
'n'
);
if
strcmpi
(
check
,
'n'
)
if
strcmpi
(
check
,
'n'
)
proj
=
load
(
projname
);
else
proj
=
gtAstraPrepareAbsorptionStack
(
parameters
);
...
...
This diff is collapsed.
Click to expand it.
5_reconstruction/gtAstra_FBP2D.m
+
18
−
23
View file @
8759f5d5
...
...
@@ -7,7 +7,6 @@ function abs = gtAstra_FBP2D(parameters, proj)
% Version 002 26-09-2012 by LNervo
% Formatting, cleaning, commenting
if
~
exist
(
'proj'
,
'var'
)
name
=
fullfile
(
parameters
.
acq
.
dir
,
'absorption_stack.mat'
);
if
exist
(
name
,
'file'
)
...
...
@@ -28,23 +27,21 @@ end
% now start FBP reconstruction of absorption volume
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%proj_data
=
permute(proj.stack,[3 2 1]);
% transforms stack of projection images to stack of sinograms
%proj_data
=
permute(proj.stack,[3 2 1]); % transforms stack of projection images to stack of sinograms
proj_data
=
proj
.
stack
;
vsize
=
size
(
proj
.
stack
,
3
);
% numer of slices to be reconstructed
hsize
=
size
(
proj
.
stack
,
1
);
% number of pixels in projection image
nproj
=
size
(
proj
.
stack
,
2
);
% number of projections
hsize_zp
=
ceil
(
hsize
*
sqrt
(
2
));
% zeropad projection images
offset
=
ceil
((
hsize_zp
-
hsize
)/
2
);
sino
=
zeros
(
nproj
,
hsize_zp
);
vsize
=
size
(
proj
.
stack
,
3
);
% numer of slices to be reconstructed
hsize
=
size
(
proj
.
stack
,
1
);
% number of pixels in projection image
nproj
=
size
(
proj
.
stack
,
2
);
% number of projections
hsize_zp
=
ceil
(
hsize
*
sqrt
(
2
));
% zeropad projection images
offset
=
ceil
((
hsize_zp
-
hsize
)/
2
);
xvol
=
hsize
;
yvol
=
hsize
;
zvol
=
vsize
;
sino
=
zeros
(
nproj
,
hsize_zp
);
xvol
=
hsize
;
yvol
=
hsize
;
zvol
=
vsize
;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% projection geometry (type, #rows, #columns, vectors)
...
...
@@ -52,7 +49,7 @@ zvol=vsize;
proj_geom
=
astra_create_proj_geom
(
'parallel'
,
1.0
,
hsize_zp
,
proj
.
Omega
);
vol_geom
=
astra_create_vol_geom
(
hsize
,
hsize
);
proj_id
=
astra_create_projector
(
'linear'
,
proj_geom
,
vol_geom
);
sinogram_id
=
astra_mex_data2d
(
'create'
,
'-sino'
,
proj_geom
,
0
);
sinogram_id
=
astra_mex_data2d
(
'create'
,
'-sino'
,
proj_geom
,
0
);
% allocate space to store reconstruction image
recon_id
=
astra_mex_data2d
(
'create'
,
'-vol'
,
vol_geom
,
0
);
...
...
@@ -66,26 +63,24 @@ cfg.ReconstructionDataId = recon_id;
cfg
.
FilterType
=
'Ram-Lak'
;
cfg
.
option
.
GPUindex
=
0
;
abs
=
zeros
(
xvol
,
yvol
,
zvol
);
abs
=
zeros
(
xvol
,
yvol
,
zvol
);
for
i
=
1
:
vsize
for
ii
=
1
:
vsize
alg_id
=
astra_mex_algorithm
(
'create'
,
cfg
);
% 'zeropadding' projections with the value
sino
=
gtPlaceSubImage
(
squeeze
(
proj_data
(:,:,
i
))
'
,
sino
,
offset
,
1
);
sino
=
gtPlaceSubImage
(
squeeze
(
proj_data
(:,
:,
i
i
))
'
,
sino
,
offset
,
1
);
sino
(:,
1
:
offset
-
1
)
=
repmat
(
sino
(:,
offset
),
1
,
offset
-
1
);
sino
(:,
offset
+
hsize
:
end
)
=
repmat
(
sino
(:,
offset
+
hsize
-
1
),
1
,
hsize_zp
-
offset
-
hsize
+
1
);
sino
(:,
1
:
offset
-
1
)
=
repmat
(
sino
(:,
offset
),
1
,
offset
-
1
);
sino
(:,
offset
+
hsize
:
end
)
=
repmat
(
sino
(:,
offset
+
hsize
-
1
),
1
,
hsize_zp
-
offset
-
hsize
+
1
);
astra_mex_data2d
(
'set'
,
sinogram_id
,
sino
)
astra_mex_data2d
(
'set'
,
sinogram_id
,
sino
)
astra_mex_algorithm
(
'run'
,
alg_id
);
% retrieve reconstruction from ASTRA lib
abs
(:,:,
vsize
-
i
+
1
)
=
astra_mex_data2d
(
'get'
,
recon_id
);
abs
(:,
:,
vsize
-
i
i
+
1
)
=
astra_mex_data2d
(
'get'
,
recon_id
);
astra_mex_algorithm
(
'delete'
,
alg_id
);
end
...
...
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