Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8272336
add fourier Filter
mittoalb Mar 25, 2024
4fd1a7e
Merge branch 'tomography:main' into main
mittoalb Mar 25, 2024
74e6192
Merge branch 'tomography:main' into main
mittoalb Apr 4, 2024
46157cd
bug fix
mittoalb Apr 16, 2024
684e7db
Merge branch 'tomography:main' into main
mittoalb Sep 10, 2024
af13b22
add phase method
mittoalb Sep 10, 2024
41c5307
zarr Reader, various phase-retrievals
mittoalb Oct 25, 2024
9a83080
config fix
mittoalb Oct 25, 2024
005a1bf
Merge pull request #1 from mittoalb/dev
mittoalb Oct 25, 2024
355899a
code cleanup
mittoalb Oct 29, 2024
bd58e07
Merge pull request #2 from mittoalb/dev
mittoalb Oct 29, 2024
291dfbb
code cleanup
mittoalb Oct 30, 2024
104dda2
Merge pull request #3 from mittoalb/dev
mittoalb Oct 30, 2024
e8c3abb
add zarr dependency
nikitinvv Nov 11, 2024
a2b5719
checking write with zarr
nikitinvv Nov 11, 2024
6f4b501
Merge pull request #4 from tomography/pullcheck
mittoalb Nov 11, 2024
af7e184
solved bug in zarr data saving
mittoalb Nov 21, 2024
824a800
recon steps zarr data saving
mittoalb Nov 22, 2024
9c374cb
Meta saving
mittoalb Nov 25, 2024
c32cfad
Updated meta saving
mittoalb Nov 26, 2024
36b1d4a
Updated meta saving
mittoalb Nov 26, 2024
b7d9cc3
Fixed zarr data neuroglancer compatibility
mittoalb Nov 27, 2024
7867104
Updated meta saving
mittoalb Dec 4, 2024
abd2dbf
bugs over bugs
mittoalb Dec 6, 2024
02de7d8
clean up
mittoalb Dec 6, 2024
3a92c83
clean up
mittoalb Dec 6, 2024
7f9d08a
Restructured/add zarr sum data
mittoalb Dec 11, 2024
1d2461d
MIP alignment
mittoalb Feb 8, 2025
3b54b49
Merge pull request #11 from mittoalb/dev
mittoalb Feb 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.4
1.0.6
3 changes: 2 additions & 1 deletion recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ requirements:
- opencv
- opencv-contrib-python
- pywavelets
- tifffile
- tifffile
- zarr

about:
home: https://github.com/tomography/tomocupy
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
packages=find_packages('src'),
zip_safe=False,
install_requires=[
'cupy',
'cupy',
'opencv-python',
'h5py',
'numexpr',
'numpy',
'pywavelets',
'setuptools', # for pkg_resources at runtime
'tifffile',
'zarr',
]
)
76 changes: 56 additions & 20 deletions src/tomocupy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ def default_parameter(func, param):
'default': 'none',
'type': str,
'help': "Phase retrieval correction method",
'choices': ['none', 'paganin', 'Gpaganin']},
'choices': ['none', 'paganin', 'Gpaganin', 'FourierFilter', 'farago']},
'energy': {
'default': 0,
'type': float,
Expand All @@ -240,7 +240,7 @@ def default_parameter(func, param):
'retrieve-phase-delta-beta': {
'default': 1500.0,
'type': float,
'help': "delta/beta material for Generalized Paganin"},
'help': "delta/beta material for Generalized Paganin & Farago"},
'retrieve-phase-W': {
'default': 2e-4,
'type': float,
Expand All @@ -249,6 +249,22 @@ def default_parameter(func, param):
'type': utils.positive_int,
'default': 1,
'help': "Padding with extra slices in z for phase-retrieval filtering"},
'FFratio': {
'default': 100,
'type': float,
'help': "Shape of the Fourier Filter window"},
'FFdim': {
'default': 2,
'type': float,
'help': "1 for sinograms, 2 for projections"},
'FFlog': {
'default': 0,
'type': int,
'help': "0/1"},
'FFpad': {
'default': 150,
'type': float,
'help': "Padding size for the Fourier Filter"},
}

SECTIONS['rotate-proj'] = {
Expand Down Expand Up @@ -395,21 +411,6 @@ def default_parameter(func, param):
'type': int,
'default': -1,
'help': "End row to find the rotation center"},
'dtype': {
'default': 'float32',
'type': str,
'choices': ['float32', 'float16'],
'help': "Data type used for reconstruction. Note float16 works with power of 2 sizes.", },
'save-format': {
'default': 'tiff',
'type': str,
'help': "Output format",
'choices': ['tiff', 'h5', 'h5sino', 'h5nolinks']},
'clear-folder': {
'default': 'False',
'type': str,
'help': "Clear output folder before reconstruction",
'choices': ['True', 'False']},
'fbp-filter': {
'default': 'parzen',
'type': str,
Expand Down Expand Up @@ -446,6 +447,41 @@ def default_parameter(func, param):
'type': float,
'help': "Pixel size [microns]"},
}
SECTIONS['output'] ={
'dtype': {
'default': 'float32',
'type': str,
'choices': ['float32', 'float16'],
'help': "Data type used for reconstruction. Note float16 works with power of 2 sizes.", },
'save-format': {
'default': 'tiff',
'type': str,
'help': "Output format",
'choices': ['tiff', 'h5', 'h5sino', 'h5nolinks', 'zarr']},
'zarr-compression': {
'default': 'blosclz',
'type': str,
'help': "ZARR compression format",
'choices': ['blosclz', 'lz4', 'zstd']},
'zarr-chunk': {
'default': '8,64,64',
'type': str,
'help': "ZARR chunk size"},
'large-data': {
'default': False,
'type': bool,
'help': "If Active it computes ldchunk chunks of angular projections"},
'ldchunk': {
'default': 10,
'type': int,
'help': "Number of angular chunks for large-data"},
'clear-folder': {
'default': 'False',
'type': str,
'help': "Clear output folder before reconstruction",
'choices': ['True', 'False']}
}


SECTIONS['beam-hardening'] = {
'beam-hardening-method': {
Expand Down Expand Up @@ -564,9 +600,9 @@ def default_parameter(func, param):


RECON_PARAMS = ('file-reading', 'remove-stripe',
'reconstruction', 'fw', 'ti', 'vo-all', 'lamino', 'reconstruction-types', 'beam-hardening')
'reconstruction', 'fw', 'ti', 'vo-all', 'lamino', 'reconstruction-types', 'beam-hardening', 'output')
RECON_STEPS_PARAMS = ('file-reading', 'remove-stripe', 'reconstruction',
'retrieve-phase', 'fw', 'ti', 'vo-all', 'lamino', 'reconstruction-steps-types', 'rotate-proj', 'beam-hardening')
'retrieve-phase', 'fw', 'ti', 'vo-all', 'lamino', 'reconstruction-steps-types', 'rotate-proj', 'beam-hardening', 'output')

NICE_NAMES = ('General', 'File reading', 'Remove stripe',
'Remove stripe FW', 'Remove stripe Titarenko', 'Remove stripe Vo' 'Retrieve phase', 'Reconstruction')
Expand Down Expand Up @@ -773,7 +809,7 @@ def update_hdf_process(fname, args=None, sections=None):
hdf_file.require_dataset(dataset, shape=(1,), dtype=dt)
log.info(name + ': ' + str(value))
try:
hdf_file[dataset][0] = np.string_(str(value))
hdf_file[dataset][0] = np.bytes_(str(value))
except TypeError:
log.error(
"Could not convert value {}".format(value))
Expand Down
11 changes: 7 additions & 4 deletions src/tomocupy/dataio/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def init_sizes(self):

# read data sizes and projection angles with a reader
sizes = self.read_sizes()
theta = self.read_theta()
theta = self.read_theta(sizes['nproji'])
nproji = sizes['nproji']
nzi = sizes['nzi']
ni = sizes['ni']
Expand Down Expand Up @@ -306,12 +306,15 @@ def read_sizes(self):

return sizes

def read_theta(self):
def read_theta(self, projections):
"""Read projection angles (in radians)"""

with h5py.File(args.file_name) as file_in:
theta = file_in['/exchange/theta'][:].astype('float32')/180*np.pi

if '/exchange/theta' in file_in:
theta = file_in['/exchange/theta'][:].astype('float32') / 180 * np.pi
else:
# If 'theta' doesn't exist, calculate it over the range [0, proj]
theta = np.linspace(0, np.pi, projections, dtype='float32')
return theta

def read_data_chunk_to_queue(self, data_queue, ids_proj, st_z, end_z, st_n, end_n, id_z, in_dtype):
Expand Down
Loading