pytomography 2.0.4__tar.gz → 2.0.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pytomography-2.0.4 → pytomography-2.0.5}/PKG-INFO +1 -1
- {pytomography-2.0.4 → pytomography-2.0.5}/pyproject.toml +1 -1
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/io/SPECT/dicom.py +12 -11
- {pytomography-2.0.4 → pytomography-2.0.5}/.github/workflows/publish-to-test-pypi.yml +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/.gitignore +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/.readthedocs.yaml +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/LICENSE +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/README.md +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/Makefile +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/make.bat +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/_templates/autoapi/index.rst +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/_templates/autoapi/python/attribute.rst +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/_templates/autoapi/python/class.rst +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/_templates/autoapi/python/data.rst +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/_templates/autoapi/python/exception.rst +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/_templates/autoapi/python/function.rst +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/_templates/autoapi/python/method.rst +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/_templates/autoapi/python/module.rst +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/_templates/autoapi/python/package.rst +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/_templates/autoapi/python/property.rst +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/conf.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/developers_guide.md +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/external_data.md +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/images/PT1.png +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/images/coordinate_conventions.png +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/images/emission.png +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/images/figure4.jpg +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/images/figure5.jpg +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/images/psf.png +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/images/psf2.png +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/images/pytomo_front_title.png +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/images/sample_MIP.png +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/images/sample_MIPa.png +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/index.md +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/notebooks/conventions.ipynb +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/notebooks/script_to_generate_eta_for_petsird.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/notebooks/t_PETGATE.ipynb +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/notebooks/t_PETSIRD.ipynb +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/notebooks/t_dicomdata.ipynb +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/notebooks/t_dicommultibed.ipynb +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/notebooks/t_fbp.ipynb +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/notebooks/t_quantitative.ipynb +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/notebooks/t_siminddata.ipynb +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/notebooks/t_uncertainty_spect.ipynb +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/docs/source/usage.md +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/__init__.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/algorithms/__init__.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/algorithms/dip_recon.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/algorithms/fbp.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/algorithms/preconditioned_gradient_ascent.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/callbacks/__init__.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/callbacks/callback.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/callbacks/data_saving.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/callbacks/likelihood.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/data/NIST_attenuation_data/adipose.csv +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/data/NIST_attenuation_data/air.csv +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/data/NIST_attenuation_data/aluminum.csv +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/data/NIST_attenuation_data/bonecortical.csv +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/data/NIST_attenuation_data/boneequivplastic.csv +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/data/NIST_attenuation_data/breast.csv +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/data/NIST_attenuation_data/lead.csv +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/data/NIST_attenuation_data/lungtissue.csv +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/data/NIST_attenuation_data/muscle.csv +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/data/NIST_attenuation_data/tissueequivplastic.csv +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/data/NIST_attenuation_data/tungsten.csv +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/data/NIST_attenuation_data/water.csv +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/data/collim.col +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/io/CT/__init__.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/io/CT/attenuation_map.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/io/PET/__init__.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/io/PET/gate.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/io/PET/petsird.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/io/PET/prd/__init__.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/io/PET/prd/_binary.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/io/PET/prd/_dtypes.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/io/PET/prd/_ndjson.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/io/PET/prd/binary.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/io/PET/prd/ndjson.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/io/PET/prd/protocols.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/io/PET/prd/types.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/io/PET/prd/yardl_types.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/io/SPECT/__init__.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/io/SPECT/shared.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/io/SPECT/simind.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/io/__init__.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/io/shared/__init__.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/io/shared/dicom.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/io/shared/dicom_creation.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/io/shared/interfile.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/likelihoods/__init__.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/likelihoods/likelihood.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/likelihoods/mse_objective.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/likelihoods/poisson_log_likelihood.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/metadata/PET/__init__.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/metadata/PET/pet_tof_metadata.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/metadata/PET/petlm_metadata.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/metadata/SPECT/__init__.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/metadata/SPECT/spect_metadata.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/metadata/__init__.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/metadata/metadata.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/priors/__init__.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/priors/nearest_neighbour.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/priors/prior.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/projectors/PET/__init__.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/projectors/PET/petlm_system_matrix.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/projectors/SPECT/__init__.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/projectors/SPECT/spect_system_matrix.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/projectors/__init__.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/projectors/shared/__init__.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/projectors/shared/kem_system_matrix.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/projectors/shared/motion_correction_system_matrix.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/projectors/system_matrix.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/transforms/SPECT/__init__.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/transforms/SPECT/attenuation.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/transforms/SPECT/cutoff.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/transforms/SPECT/psf.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/transforms/__init__.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/transforms/shared/__init__.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/transforms/shared/filters.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/transforms/shared/kem.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/transforms/shared/motion.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/transforms/shared/spatial.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/transforms/transform.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/utils/__init__.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/utils/fourier_filters.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/utils/misc.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/utils/nist_data.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/utils/scatter.py +0 -0
- {pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/utils/spatial.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: pytomography
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.5
|
|
4
4
|
Summary: Package to perform tomographic image reconstruction
|
|
5
5
|
Project-URL: Homepage, https://github.com/qurit/PyTomography
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/qurit/PyTomography/issues
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
import warnings
|
|
3
|
+
import copy
|
|
3
4
|
import os
|
|
4
5
|
import collections.abc
|
|
5
6
|
from collections.abc import Sequence
|
|
@@ -574,12 +575,13 @@ def save_dcm(
|
|
|
574
575
|
recon_name (str): Type of reconstruction performed. Obtained from the `recon_method_str` attribute of a reconstruction algorithm class.
|
|
575
576
|
return_ds (bool): If true, returns the DICOM dataset objects instead of saving to file. Defaults to False.
|
|
576
577
|
"""
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
578
|
+
if not return_ds:
|
|
579
|
+
try:
|
|
580
|
+
Path(save_path).resolve().mkdir(parents=True, exist_ok=False)
|
|
581
|
+
except:
|
|
582
|
+
raise Exception(
|
|
583
|
+
f"Folder {save_path} already exists; new folder name is required."
|
|
584
|
+
)
|
|
583
585
|
# Convert tensor image to numpy array
|
|
584
586
|
pixel_data = torch.permute(object.squeeze(),(2,1,0)).cpu().numpy()
|
|
585
587
|
scale_factor = (2**16 - 1) / pixel_data.max()
|
|
@@ -620,13 +622,12 @@ def save_dcm(
|
|
|
620
622
|
dss = []
|
|
621
623
|
for i in range(pixel_data.shape[0]):
|
|
622
624
|
# Load existing DICOM file
|
|
623
|
-
ds_i =
|
|
625
|
+
ds_i = copy.deepcopy(ds)
|
|
624
626
|
ds_i.InstanceNumber = i + 1
|
|
625
627
|
ds_i.ImagePositionPatient = [Sx, Sy, Sz + i * dz]
|
|
626
628
|
# Create SOP Instance UID unique to slice
|
|
627
|
-
|
|
628
|
-
ds_i.
|
|
629
|
-
ds_i.file_meta.MediaStorageSOPInstanceUID = SOP_instance_UID_slice
|
|
629
|
+
ds_i.SOPInstanceUID = f"{ds.SOPInstanceUID[:-3]}{i+1:03d}"
|
|
630
|
+
ds_i.file_meta.MediaStorageSOPInstanceUID = ds_i.SOPInstanceUID
|
|
630
631
|
# Set the pixel data
|
|
631
632
|
ds_i.PixelData = pixel_data[i].tobytes()
|
|
632
633
|
dss.append(ds_i)
|
|
@@ -634,5 +635,5 @@ def save_dcm(
|
|
|
634
635
|
return dss
|
|
635
636
|
else:
|
|
636
637
|
for ds_i in dss:
|
|
637
|
-
ds_i.save_as(os.path.join(save_path, f'{
|
|
638
|
+
ds_i.save_as(os.path.join(save_path, f'{ds_i.SOPInstanceUID}.dcm'))
|
|
638
639
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytomography-2.0.4 → pytomography-2.0.5}/docs/source/_templates/autoapi/python/attribute.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytomography-2.0.4 → pytomography-2.0.5}/docs/source/_templates/autoapi/python/exception.rst
RENAMED
|
File without changes
|
{pytomography-2.0.4 → pytomography-2.0.5}/docs/source/_templates/autoapi/python/function.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytomography-2.0.4 → pytomography-2.0.5}/docs/source/_templates/autoapi/python/property.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/data/NIST_attenuation_data/adipose.csv
RENAMED
|
File without changes
|
{pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/data/NIST_attenuation_data/air.csv
RENAMED
|
File without changes
|
{pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/data/NIST_attenuation_data/aluminum.csv
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/data/NIST_attenuation_data/breast.csv
RENAMED
|
File without changes
|
{pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/data/NIST_attenuation_data/lead.csv
RENAMED
|
File without changes
|
{pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/data/NIST_attenuation_data/lungtissue.csv
RENAMED
|
File without changes
|
{pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/data/NIST_attenuation_data/muscle.csv
RENAMED
|
File without changes
|
|
File without changes
|
{pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/data/NIST_attenuation_data/tungsten.csv
RENAMED
|
File without changes
|
{pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/data/NIST_attenuation_data/water.csv
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/likelihoods/poisson_log_likelihood.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/projectors/PET/petlm_system_matrix.py
RENAMED
|
File without changes
|
|
File without changes
|
{pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/projectors/SPECT/spect_system_matrix.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pytomography-2.0.4 → pytomography-2.0.5}/src/pytomography/projectors/shared/kem_system_matrix.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|