Closed xraydoug closed 2 years ago
It seems as if the text editor moved everything after the patient's name into a private tag (4f4c, 000a)
You could try to use a DICOM anonymizer tool (if you have one available) or the Python package pydicom to anonymize the file instead.
Many DICOM anonymizers are kind of destructive but hopefully they should work for this usecase as the data used in PySkinDose should not be considered as data that should be deleted.
There is an example for anonymizing files with pydicom in the pydicom-documentation Anonymize DICOM data
Another option might be if you could acquire an examination on a test-patient/phantom, that would not be in need of anonymization, and try PySkinDose on that file. If that shows the same error message as this file did, we could try to use the phantom examination to debug the problem.
Thanks for the ideas. I’ll try pydicom first and work from there.
On Feb 16, 2022, at 12:16 PM, BwKodex @.***> wrote:
It seems as if the text editor moved everything after the patient's name into a private tag (4f4c, 000a)
You could try to use a DICOM anonymizer tool (if you have one available) or the Python package pydicom to anonymize the file instead.
Many DICOM anonymizers are kind of destructive but hopefully they should work for this usecase as the data used in PySkinDose should not be considered as data that should be deleted.
There is an example for anonymizing files with pydicom in the pydicom-documentation Anonymize DICOM data https://pydicom.github.io/pydicom/dev/auto_examples/metadata_processing/plot_anonymize.html Another option might be if you could acquire an examination on a test-patient/phantom, that would not be in need of anonymization, and try PySkinDose on that file. If that shows the same error message as this file did, we could try to use the phantom examination to debug the problem.
— Reply to this email directly, view it on GitHub https://github.com/rvbCMTS/PySkinDose/issues/37#issuecomment-1042063080, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXR7JZTZ73IQG2ZLBYAJE3LU3PZZDANCNFSM5OR4BURA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you authored the thread.
I used a different anonymizer and the attached file is now giving the "'float' is not iterable" error. REPORT_patient_name.SR.CARDIAC_CATH.0990.0990.2022.02.15.06.19.50.558473.50732094.SR.zip
I found the bug that caused this error and have created a PR for merging the fix into master. When my colleagues have reviewed and approved my changes I will create a new release that you can upgrade to.
@xraydoug: Now we've created a new release (version 22.2.2) where the bug causing the error message you saw has been fixed. I hope this makes the code run correctly for your file!
I’m afraid that I’m still getting the same error:
File "/Users/xraydoug/Downloads/PySkinDose-22.2.2/src/pyskindose/main.py", line 100, in
I’ve tried several different RDSR files to the same effect. Sorry...
On Feb 23, 2022, at 3:01 PM, BwKodex @.***> wrote:
@xraydoug https://github.com/xraydoug: Now we've created a new release (version 22.2.2) where the bug causing the error message you saw has been fixed. I hope this makes the code run correctly for your file!
— Reply to this email directly, view it on GitHub https://github.com/rvbCMTS/PySkinDose/issues/37#issuecomment-1049256859, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXR7JZUUKXH7AGGAXEBP7YDU4VKNJANCNFSM5OR4BURA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.
Hi again @xraydoug , From your error message it seems that you haven't gotten the latest version (22.2.2) I can see this from that the specified line at the line number in rdsr_normalizer.py does not correspond to the new version.
From the traceback I get the feeling that you've downloaded the new version from github but you have the old version installed, this means that when you run the script it imports the RDSR normalizer from the old version. You can see this from the rdsr_normalizer path being specified as /Users/xraydoug/opt/anaconda3/lib/python3.9/site-packages/pyskindose/rdsr_normalizer.py
while the main.py run is located at /Users/xraydoug/Downloads/PySkinDose-22.2.2/src/pyskindose/main.py
You could try update your installed version with the command python -m pip install -U pyskindose
and see if that helps.
Hi,
That did indeed fix the issue. Thank you! I had assumed it would use the nearest module and ignore the old one. It appears that the SR reports I have are being accepted with no issues. Main.py creates the beautiful 3D plot of each exposure.
What I’m trying to figure out now is how to get it to calculate the PSD. Main.py doesn’t allow any interaction but moving the camera. I’ve tried analyze_data.py and calculate_dose.py; these run but do not return anything visibly. The tests (e.g., manual_test_calculate_dose_interactive.py) run perfectly, as expected. I tried running them with --file-path mysr.sr, but they ignored the new SR. What module do I run to get it to give me the PSD? I am very sorry for being such a bother with pedestrian issues.
On Mar 1, 2022, at 3:21 PM, BwKodex @.***> wrote:
Hi again @xraydoug https://github.com/xraydoug , From your error message it seems that you haven't gotten the latest version (22.2.2) I can see this from that the specified line at the line number in rdsr_normalizer.py does not correspond to the new version.
From the traceback I get the feeling that you've downloaded the new version from git but you have the old version installed, this means that when you run the script it imports the RDSR normalizer from the old version. You can see this from the rdsr_normalizer path being specified as /Users/xraydoug/opt/anaconda3/lib/python3.9/site-packages/pyskindose/rdsr_normalizer.py while the main.py run is located at /Users/xraydoug/Downloads/PySkinDose-22.2.2/src/pyskindose/main.py
You could try update your installed version with the command python -m pip install -U pyskindose and see if that helps.
— Reply to this email directly, view it on GitHub https://github.com/rvbCMTS/PySkinDose/issues/37#issuecomment-1055917332, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXR7JZUVESMVXE4ZPSBOPCDU52J7TANCNFSM5OR4BURA. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.
Hi, no problem. This just highlights the need for our documentation to be finished and improved :)
At the moment you would have to write your own implementation of the main-script to get the max dose in the dose map. The dictionary that is the output from the call to analyze_data on row 44 in the main script should contain the dose map.
So by adding import numpy as np
to the imports and rewriting line 44 in the main script to something like this could help
result = analysze_data(normalized_data=data_norm, settings=settings)
print("Max dose in dose map:")
print(result["dose_map"].max())
I've talked to @MaxHellstrom about re-adding the original PSD calculation result to the output as well.
REPORT_patient_test.SR.CARDIAC_CATH.0990.0990.2022.02.15.06.19.50.558473.50732094.SR.zip This RDSR causes a crash. In it's original, non-anonymized form, I received the following error message: File "/Users/xraydoug/opt/anaconda3/lib/python3.9/site-packages/pyskindose/rdsr_normalizer.py", line 251, in _normalize_xray_filter_materials if KEY_RDSR_FILTER_MATERIAL_COPPER in event_filtermaterials: TypeError: argument of type 'float' is not iterable
After I anonymized it, which is the attached file, I received this error message: File "/Users/xraydoug/opt/anaconda3/lib/python3.9/site-packages/pydicom/dataset.py", line 836, in getattr return object.getattribute(self, name) AttributeError: 'FileDataset' object has no attribute 'ContentSequence' I am wondering if the text editor added some special characters in, because all I changed were two instances of the patient name. I'm hoping that it will still let you troubleshoot the first error.
I acquired the file directly from a Siemens Axiom Artis, exporting it to a thumb drive.