Skip to content

Commit

Permalink
fixed wrong variable names for metadata stuff
Browse files Browse the repository at this point in the history
Former-commit-id: 67449ca
  • Loading branch information
fishingguy456 committed Jun 6, 2022
1 parent 0b64164 commit 4204769
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
15 changes: 10 additions & 5 deletions examples/autotest.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def process_one_subject(self, subject_id):
metadata[f"size_{output_stream}"] = str(doses.GetSize())
metadata[f"metadata_{colname}"] = [read_results[i].get_metadata()]

if hasattr(structure_set, "metadata"):
if hasattr(doses, "metadata"):
metadata.update(doses.metadata)

print(subject_id, " SAVED DOSE")
Expand Down Expand Up @@ -218,7 +218,7 @@ def process_one_subject(self, subject_id):
metadata[f"size_{output_stream}"] = str(pet.GetSize())
metadata[f"metadata_{colname}"] = [read_results[i].get_metadata()]

if hasattr(structure_set, "metadata"):
if hasattr(pet, "metadata"):
metadata.update(pet.metadata)

print(subject_id, " SAVED PET")
Expand Down Expand Up @@ -265,9 +265,14 @@ def run(self):
# visualize=False,
# overwrite=True)

pipeline = AutoPipeline(input_directory="C:/Users/qukev/BHKLAB/hnscc_testing/HNSCC",
output_directory="C:/Users/qukev/BHKLAB/hnscc_testing_output",
modalities="CT,RTSTRUCT",
# pipeline = AutoPipeline(input_directory="C:/Users/qukev/BHKLAB/hnscc_testing/HNSCC",
# output_directory="C:/Users/qukev/BHKLAB/hnscc_testing_output",
# modalities="CT,RTSTRUCT",
# visualize=False,
# overwrite=True)
pipeline = AutoPipeline(input_directory="C:/Users/qukev/BHKLAB/hnscc_pet/PET",
output_directory="C:/Users/qukev/BHKLAB/hnscc_pet_output",
modalities="CT,PT",
visualize=False,
overwrite=True)

Expand Down
8 changes: 4 additions & 4 deletions imgtools/modules/pet.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ def from_dicom_pet(cls, path,series_id=None,type="SUV"):
metadata = {}
# metadata["factor"] = df.factor

if hasattr(df, 'RescaleType'):
if hasattr(pet, 'RescaleType'):
metadata["RescaleType"] = str(pet.RescaleType)
if hasattr(df, 'RescaleSlope'):
if hasattr(pet, 'RescaleSlope'):
metadata["RescaleSlope"] = str(pet.RescaleSlope)
if hasattr(df, 'RadionuclideTotalDose'):
if hasattr(pet, 'RadionuclideTotalDose'):
metadata["RadionuclideTotalDose"] = str(pet.RadionuclideTotalDose)
if hasattr(df, 'RadionuclideHalfLife'):
if hasattr(pet, 'RadionuclideHalfLife'):
metadata["RadionuclideHalfLife"] = str(pet.RadionuclideHalfLife)

# Number of Slices is avg. number slice?
Expand Down

0 comments on commit 4204769

Please sign in to comment.