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
a917ba8d
Commit
a917ba8d
authored
9 years ago
by
Nicola Vigano
Browse files
Options
Downloads
Patches
Plain Diff
Fixed a few bugs in GtGrainsManager
Signed-off-by:
Nicola Vigano
<
nicola.vigano@esrf.fr
>
parent
ffdf8e0e
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_TomoUtils/GtGrainsManager.m
+20
-8
20 additions, 8 deletions
zUtil_TomoUtils/GtGrainsManager.m
with
20 additions
and
8 deletions
zUtil_TomoUtils/GtGrainsManager.m
+
20
−
8
View file @
a917ba8d
...
@@ -371,8 +371,12 @@ classdef GtGrainsManager < GtVolView
...
@@ -371,8 +371,12 @@ classdef GtGrainsManager < GtVolView
bboxList
=
sample
.
phases
{
phaseID
}
.
simpleSearchBBtouched
(
voxel
);
bboxList
=
sample
.
phases
{
phaseID
}
.
simpleSearchBBtouched
(
voxel
);
for
jj
=
1
:
length
(
bboxList
)
for
jj
=
1
:
length
(
bboxList
)
grainID
=
bboxList
(
jj
);
grainID
=
bboxList
(
jj
);
seg
=
obj
.
cache
.
get
(
'grain'
,
{
phaseID
,
grainID
},
'seg'
);
try
if
isempty
(
seg
)
gr_seg
=
obj
.
cache
.
get
(
'grain_det'
,
{
phaseID
,
grainID
},
'SEG'
);
catch
gr_seg
=
obj
.
cache
.
get
(
'grain'
,
{
phaseID
,
grainID
},
{
'seg'
});
end
if
(
isempty
(
gr_seg
.
seg
)
||
numel
(
gr_seg
.
seg
)
==
1
)
fprintf
(
'Segmentation volume for grain %d is empty. Please run Reconstruction and 3d Threshold again!\n'
,
grainID
)
fprintf
(
'Segmentation volume for grain %d is empty. Please run Reconstruction and 3d Threshold again!\n'
,
grainID
)
continue
continue
end
end
...
@@ -999,8 +1003,12 @@ classdef GtGrainsManager < GtVolView
...
@@ -999,8 +1003,12 @@ classdef GtGrainsManager < GtVolView
%
%
% viewSegmentedGrain(obj, phaseID, grainID)
% viewSegmentedGrain(obj, phaseID, grainID)
grainSeg
=
obj
.
cache
.
get
(
'grain'
,
{
phaseID
,
grainID
},
'seg'
);
try
GtVolView
(
grainSeg
);
gr_seg
=
obj
.
cache
.
get
(
'grain_det'
,
{
phaseID
,
grainID
},
'SEG'
);
catch
gr_seg
=
obj
.
cache
.
get
(
'grain'
,
{
phaseID
,
grainID
},
{
'seg'
});
end
GtVolView
(
gr_seg
.
seg
);
end
end
function
displayForwardSim
(
obj
,
phaseID
,
grainID
,
varargin
)
function
displayForwardSim
(
obj
,
phaseID
,
grainID
,
varargin
)
...
@@ -1329,7 +1337,11 @@ classdef GtGrainsManager < GtVolView
...
@@ -1329,7 +1337,11 @@ classdef GtGrainsManager < GtVolView
% GTGRAINSMANAGER/GETCONTOUROFGRAIN Function that gets border of grains,
% GTGRAINSMANAGER/GETCONTOUROFGRAIN Function that gets border of grains,
% when grain is not into assembled volume
% when grain is not into assembled volume
sample
=
obj
.
getSample
();
sample
=
obj
.
getSample
();
vol
=
obj
.
cache
.
get
(
'grain'
,
{
phaseID
,
grainID
},
'seg'
);
try
gr_seg
=
obj
.
cache
.
get
(
'grain_det'
,
{
phaseID
,
grainID
},
'SEG'
);
catch
gr_seg
=
obj
.
cache
.
get
(
'grain'
,
{
phaseID
,
grainID
},
{
'seg'
});
end
bbox
=
sample
.
phases
{
phaseID
}
.
getBoundingBox
(
grainID
);
bbox
=
sample
.
phases
{
phaseID
}
.
getBoundingBox
(
grainID
);
indx
=
obj
.
conf
.
slicendx
-
bbox
(
obj
.
conf
.
ortDim
);
indx
=
obj
.
conf
.
slicendx
-
bbox
(
obj
.
conf
.
ortDim
);
...
@@ -1337,15 +1349,15 @@ classdef GtGrainsManager < GtVolView
...
@@ -1337,15 +1349,15 @@ classdef GtGrainsManager < GtVolView
switch
(
obj
.
conf
.
ortDim
)
switch
(
obj
.
conf
.
ortDim
)
case
3
% equivalent to plane 'xy' or 'yx'
case
3
% equivalent to plane 'xy' or 'yx'
slice
=
zeros
(
obj
.
conf
.
dim
(
1
),
obj
.
conf
.
dim
(
2
));
slice
=
zeros
(
obj
.
conf
.
dim
(
1
),
obj
.
conf
.
dim
(
2
));
sliceVol
=
vol
(:,
:,
indx
);
sliceVol
=
gr_seg
.
seg
(:,
:,
indx
);
slice
=
gtPlaceSubVolume
(
slice
,
sliceVol
,
([
bbox
(
1
)
bbox
(
2
)
1
]
-
1
));
slice
=
gtPlaceSubVolume
(
slice
,
sliceVol
,
([
bbox
(
1
)
bbox
(
2
)
1
]
-
1
));
case
1
% equivalent to plane 'yz' or 'zy'
case
1
% equivalent to plane 'yz' or 'zy'
slice
=
zeros
(
obj
.
conf
.
dim
(
2
),
obj
.
conf
.
dim
(
3
));
slice
=
zeros
(
obj
.
conf
.
dim
(
2
),
obj
.
conf
.
dim
(
3
));
sliceVol
=
squeeze
(
vol
(
indx
,
:,
:));
sliceVol
=
squeeze
(
gr_seg
.
seg
(
indx
,
:,
:));
slice
=
gtPlaceSubVolume
(
slice
,
sliceVol
,
([
1
bbox
(
2
)
bbox
(
3
)]
-
1
));
slice
=
gtPlaceSubVolume
(
slice
,
sliceVol
,
([
1
bbox
(
2
)
bbox
(
3
)]
-
1
));
case
2
% equivalent to plane 'zx' or 'xz'
case
2
% equivalent to plane 'zx' or 'xz'
slice
=
zeros
(
obj
.
conf
.
dim
(
1
),
obj
.
conf
.
dim
(
3
));
slice
=
zeros
(
obj
.
conf
.
dim
(
1
),
obj
.
conf
.
dim
(
3
));
sliceVol
=
squeeze
(
vol
(:,
indx
,
:));
sliceVol
=
squeeze
(
gr_seg
.
seg
(:,
indx
,
:));
slice
=
gtPlaceSubVolume
(
slice
,
sliceVol
,
([
bbox
(
1
)
1
bbox
(
3
)]
-
1
));
slice
=
gtPlaceSubVolume
(
slice
,
sliceVol
,
([
bbox
(
1
)
1
bbox
(
3
)]
-
1
));
end
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