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
7bee4c9a
Commit
7bee4c9a
authored
8 years ago
by
Nicola Vigano
Browse files
Options
Downloads
Patches
Plain Diff
C++/mex another round of error throwing improvements
Signed-off-by:
Nicola Vigano
<
nicola.vigano@esrf.fr
>
parent
ddf5fc81
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_Cxx/include/DctData.h
+16
-16
16 additions, 16 deletions
zUtil_Cxx/include/DctData.h
with
16 additions
and
16 deletions
zUtil_Cxx/include/DctData.h
+
16
−
16
View file @
7bee4c9a
...
...
@@ -190,7 +190,7 @@ namespace dct {
DctData
<
Type
,
Alloc
>::
set_dims
(
const
TypeDims
*
init_dims
,
const
size_t
&
num_dims
,
const
size_t
&
skip_dims
)
{
if
(
num_dims
>
3
)
{
throw
WrongArgumentException
(
"Expected three dimensions for the initialization of Projection Data"
);
THROW
(
WrongArgumentException
,
DctData
,
"Expected three dimensions for the initialization of Projection Data"
);
}
for
(
size_t
dim
=
0
;
dim
<
num_dims
;
dim
++
)
{
...
...
@@ -238,7 +238,7 @@ namespace dct {
DctProjection
<
Type
,
Alloc
>::
set_dims
(
const
std
::
vector
<
size_t
>
&
new_dims
)
{
if
(
new_dims
.
size
()
!=
3
)
{
throw
WrongArgumentException
(
"Expected three dimensions for the initialization of Projection Data"
);
THROW
(
WrongArgumentException
,
DctProjection
,
"Expected three dimensions for the initialization of Projection Data"
);
}
DctData
<
Type
,
Alloc
>::
set_dims
(
new_dims
);
...
...
@@ -252,7 +252,7 @@ namespace dct {
DctProjection
<
Type
,
Alloc
>::
set_dims
(
const
TypeDims
*
init_dims
,
const
size_t
&
num_dims
,
const
size_t
&
skip_dims
)
{
if
(
num_dims
!=
3
)
{
throw
WrongArgumentException
(
"Expected three dimensions for the initialization of Projection Data"
);
THROW
(
WrongArgumentException
,
DctProjection
,
"Expected three dimensions for the initialization of Projection Data"
);
}
DctData
<
Type
,
Alloc
>::
set_dims
(
init_dims
,
num_dims
,
skip_dims
);
...
...
@@ -268,13 +268,13 @@ namespace dct {
DctProjectionVector
<
Type
,
Alloc
>::
check_consistency
()
const
{
if
(
this
->
empty
())
{
throw
WrongArgumentException
(
"DctProjectionVector is empty! Cannot call consistency check!"
);
THROW
(
WrongArgumentException
,
DctProjectionVector
,
"DctProjectionVector is empty! Cannot call consistency check!"
);
}
const
size_t
*
first_dims
=
(
*
this
)[
0
].
get_dims
();
for
(
size_t
num
=
1
;
num
<
this
->
size
();
num
++
)
{
const
size_t
*
current_dims
=
(
*
this
)[
num
].
get_dims
();
if
(
first_dims
[
0
]
!=
current_dims
[
0
]
||
first_dims
[
2
]
!=
current_dims
[
2
])
{
throw
WrongArgumentException
(
"All the sinograms/blobs should have the same sizes along the first and third dimension"
);
THROW
(
WrongArgumentException
,
DctProjectionVector
,
"All the sinograms/blobs should have the same sizes along the first and third dimension"
);
}
}
}
...
...
@@ -310,13 +310,13 @@ namespace dct {
DctVolumeGrid
<
Type
,
Alloc
>::
check_consistency
()
const
{
if
(
this
->
empty
())
{
throw
WrongArgumentException
(
"
DctVolumeGrid
:
no volumes stored! Cannot call consistency check!"
);
THROW
(
WrongArgumentException
,
DctVolumeGrid
,
"
no volumes stored! Cannot call consistency check!"
);
}
const
size_t
*
first_dims
=
(
*
this
)[
0
].
get_dims
();
for
(
size_t
num
=
1
;
num
<
this
->
size
();
num
++
)
{
const
size_t
*
current_dims
=
(
*
this
)[
num
].
get_dims
();
if
(
first_dims
!=
current_dims
)
{
throw
WrongArgumentException
(
"
DctVolumeGrid
:
all volumes should have the same dimensions"
);
THROW
(
WrongArgumentException
,
DctVolumeGrid
,
"
all volumes should have the same dimensions"
);
}
}
}
...
...
@@ -346,7 +346,7 @@ namespace dct {
switch
(
reshape_policy
)
{
case
ReshapePolicy
::
NoMatchThrowError
:
{
throw
WrongArgumentException
(
"
DctVolumeGrid
:
Requested reshape of wrong total number of elements"
);
THROW
(
WrongArgumentException
,
DctVolumeGrid
,
"
Requested reshape of wrong total number of elements"
);
}
case
ReshapePolicy
::
NoMatchClear
:
{
...
...
@@ -369,7 +369,7 @@ namespace dct {
switch
(
reshape_policy
)
{
case
ReshapePolicy
::
NoMatchThrowError
:
{
throw
WrongArgumentException
(
"
DctVolumeGrid
:
assigned wrong total number of elements"
);
THROW
(
WrongArgumentException
,
DctVolumeGrid
,
"
assigned wrong total number of elements"
);
}
case
ReshapePolicy
::
NoMatchClear
:
{
...
...
@@ -428,10 +428,10 @@ namespace dct {
DctVolumeGrid
<
Type
,
Alloc
>::
sub_to_ind
(
const
std
::
vector
<
size_t
>
&
subs
)
const
{
if
(
subs
.
size
()
!=
this
->
grid_dims
.
size
())
{
throw
WrongArgumentException
(
"
DctVolumeGrid
:
requested volume position has a wrong dimensionality"
);
THROW
(
WrongArgumentException
,
DctVolumeGrid
,
"
requested volume position has a wrong dimensionality"
);
}
if
(
subs
.
empty
())
{
throw
WrongArgumentException
(
"
DctVolumeGrid
:
requested volume position is empty"
);
THROW
(
WrongArgumentException
,
DctVolumeGrid
,
"
requested volume position is empty"
);
}
size_t
dim_mult
=
1
;
...
...
@@ -440,7 +440,7 @@ namespace dct {
for
(
size_t
dim
=
1
;
dim
<
subs
.
size
();
dim
++
)
{
if
(
subs
[
dim
]
>
grid_dims
[
dim
])
{
throw
WrongArgumentException
(
"
DctVolumeGrid
:
requested volume position outside the grid limits"
);
THROW
(
WrongArgumentException
,
DctVolumeGrid
,
"
requested volume position outside the grid limits"
);
}
dim_mult
*=
grid_dims
[
dim
-
1
];
...
...
@@ -457,10 +457,10 @@ namespace dct {
std
::
vector
<
size_t
>
inds
;
if
(
ext_dim
>=
this
->
grid_dims
.
size
())
{
throw
WrongArgumentException
(
"
DctVolumeGrid
:
extended volumes dimension is bigger than the grid dimensions"
);
THROW
(
WrongArgumentException
,
DctVolumeGrid
,
"
extended volumes dimension is bigger than the grid dimensions"
);
}
if
(
ext_dim
<
0
)
{
throw
WrongArgumentException
(
"
DctVolumeGrid
:
extended volumes dimension is less than 0"
);
THROW
(
WrongArgumentException
,
DctVolumeGrid
,
"
extended volumes dimension is less than 0"
);
}
inds
.
resize
(
ext_inds
.
size
());
...
...
@@ -484,10 +484,10 @@ namespace dct {
std
::
vector
<
size_t
>
subs
;
if
(
ind
>=
this
->
get_tot_vols
())
{
throw
WrongArgumentException
(
"
DctVolumeGrid
:
requested volume position is higher than the number of volumes"
);
THROW
(
WrongArgumentException
,
DctVolumeGrid
,
"
requested volume position is higher than the number of volumes"
);
}
if
(
ind
<
0
)
{
throw
WrongArgumentException
(
"
DctVolumeGrid
:
requested volume position is less than 0"
);
THROW
(
WrongArgumentException
,
DctVolumeGrid
,
"
requested volume position is less than 0"
);
}
subs
.
resize
(
grid_dims
.
size
());
...
...
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