Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tomotools
tomoscan
Commits
ebb28308
Commit
ebb28308
authored
Nov 06, 2020
by
Pierre Paleo
Browse files
[scanbase] Add ignore_projections paramater
parent
b44a4210
Changes
1
Hide whitespace changes
Inline
Side-by-side
tomoscan/scanbase.py
View file @
ebb28308
...
...
@@ -70,7 +70,12 @@ class TomoScanBase:
_SCHEME
=
None
"""scheme to read data url for this type of acquisition"""
def
__init__
(
self
,
scan
:
Union
[
None
,
str
],
type_
:
str
):
def
__init__
(
self
,
scan
:
Union
[
None
,
str
],
type_
:
str
,
ignore_projections
:
Union
[
None
,
str
]
=
None
,
):
self
.
path
=
scan
self
.
_type
=
type_
self
.
_normed_flats
=
None
...
...
@@ -87,6 +92,7 @@ class TomoScanBase:
self
.
_flats_weights
=
None
"""list flats indexes to use for flat field correction and associate
weights"""
self
.
_get_ignored_projections
(
ignore_projections
)
def
clear_caches
(
self
):
"""clear caches. Might be call if some data changed after
...
...
@@ -628,3 +634,15 @@ class TomoScanBase:
for
proj_index
in
self
.
projections
:
res
[
proj_index
]
=
get_weights
(
proj_index
=
proj_index
)
return
res
def
_get_ignored_projections
(
self
,
ignore_projections
):
self
.
ignore_projections
=
ignore_projections
self
.
_ignored_projections
=
None
if
ignore_projections
is
not
None
:
self
.
_ignored_projections
=
numpy
.
loadtxt
(
ignore_projections
,
comments
=
"#"
)
if
self
.
_ignored_projections
.
ndim
>
1
:
raise
ValueError
(
"Expected exactly one row or one column in file %s"
%
ignore_projections
)
self
.
_ignored_projections
=
self
.
_ignored_projections
.
astype
(
numpy
.
uint32
)
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment