PyESAPI icon indicating copy to clipboard operation
PyESAPI copied to clipboard

pyesapi 16.1 issue with volume, DVH, ... calculation

Open TmnGitHub opened this issue 1 year ago • 1 comments

Hello,

I am encountering some strange issues while executing my script. I have been following "Chapter 6. PyESAPI: The Python Interface to ESAPI" and this GitHub page. I am working on Eclipse 16.1

I am able to print the patient ID, last name, and first name for all patients. I can also print C1, but courses dose not show up. Additionally, I can print structure ID and DicomType, as well as ct.XSize and ct.YSize. However, I cannot retrieve the Image.np_array_like(), Volume, or DVH. When I attempt to run these, the process takes a long time and doesn't return any values.

Could you please recommend how I can resolve this issue? My goal is to successfully run Code 6.19 from "Chapter 6. PyESAPI: The Python Interface to ESAPI." which dose the Bulk Extraction of volume, DVH, ...

Thank you in advance for your time and help.

TmnGitHub avatar Jun 29 '24 18:06 TmnGitHub

@fizxmike I would appreciate any response on this. Thanks

TmnGitHub avatar Jul 01 '24 22:07 TmnGitHub

Hi @TmnGitHub, Just some quick questions:

  1. Can you share the code you are trying to run?
  2. Are there any popup messages happening (with reference to a logfile)?
  3. Have you tried the code from this notebook?

fizxmike avatar Jul 29 '24 15:07 fizxmike

Hi @fizxmike,

Thank you for taking the time to help me. I am using similar code. There were no pop-up messages. It kept running without any output for hours, so I had to terminate it.

I also tried running it from C#, and the problem occurred at the same stage. However, this time I received a pop-up message in C#. Please see the attached details. esapi

TmnGitHub avatar Jul 29 '24 15:07 TmnGitHub

Sometimes the popup will be hiding behind some windows. You can check the windows taskbar to see if python created a new window when you find things are taking too long.

Is your script creating the file in the error message? If not, what type of file is it and where is it trying to write?

fizxmike avatar Jul 29 '24 15:07 fizxmike

Hi @fizxmike,

Thank you for the reply. I ran the same exact code on my patient (3.Have you tried the code from this notebook?). Please find the error attached.

Thanks pyesapi_error

TmnGitHub avatar Jul 29 '24 17:07 TmnGitHub

Ok, since you are getting the same error in C#, I'd say this is not a PyESAPI-specific issue. You can check the ESAPI subreddit to see if some people have seen this error before, if not, try emailing [email protected].

fizxmike avatar Jul 29 '24 18:07 fizxmike

Hi @fizxmike,

Thank you very much; I greatly appreciate your help. I will follow your suggestion. On a separate note, I was wondering if we could use pyesapi similarly to how it's done in DICOM_Communication_101. Do you have any Python references for this? Alternatively, I suppose we could retrieve the image using pyesapi and save it locally with ITK for processing.

Thanks a lot for your views.

TmnGitHub avatar Jul 29 '24 18:07 TmnGitHub

sure, it is possible. See here: https://github.com/VarianAPIs/PyESAPI/issues/31

fizxmike avatar Jul 29 '24 18:07 fizxmike