Closed kmader closed 7 years ago
Implemented basic SUV code from radiomics paper:
[1] Vallières, M. et al. (2015). A radiomics model from joint FDG-PET and MRI texture features for the prediction of lung metastases in soft-tissue sarcomas of the extremities. Physics in Medicine and Biology, 60(14), 5471-5496. doi:10.1088/0031-9155/60/14/5471
this was nice piece of code i felt sad deleting
def _extract_pet_header_tags(pet_series):
# type: (str) -> Dict[str, Optional[str]]
"""
A tag based implementation
:param pet_series:
:return:
"""
PET_TAGS = {
"Acquisition Time": "0008,0032",
"Patient's Sex": "0010,0040",
"Patient's Size": "0010,1020",
"Patient's Weight": "0010,1030",
"Philipps SUV Scalar": "7053,1000",
"Radiopharmaceutical Start Time": "0018,1072",
"Decay Correction": "0054,1102",
"Decay Factor": "0054,1321",
"Frame Reference Time": "0054,1300",
"Radiopharmaceutical Information Sequence": "0054,0016",
"Radiopharmaceutical Volume": "0018,1071",
"Radionuclide Half Life": "0018,1075",
"Radionuclide Total Dose": "0018,1074",
"Series Time": "0008,0031"
}
try:
pet_files = slicer.dicomDatabase.filesForSeries(pet_series)
assert len(pet_files) > 0, "No pet files found for series {}".format(pet_series)
f_file = pet_files[0]
def _get_tag(c_tag):
try:
tag_val = slicer.dicomDatabase.fileValue(f_file, c_tag)
return tag_val if len(tag_val) > 0 else None
except Exception as e:
print('Cannot read tag', c_tag, e)
return None
except:
_get_tag = lambda x: None
pet_header = {c_name: _get_tag(c_tag) for c_name, c_tag in PET_TAGS.items()}
return pet_header
PET SUV calculation is based on phantom weight and injection time and should read these values from the header
Or simply using: https://github.com/Slicer/Slicer/blob/master/Modules/CLI/PETStandardUptakeValueComputation/PETStandardUptakeValueComputation.cxx