msaifee786 / hvf_extraction_script

Python scripting framework for extraction data from Humphrey Visual Fields
GNU General Public License v3.0
18 stars 3 forks source link

Extract individual plots as images. #1

Open IsmailM opened 2 years ago

IsmailM commented 2 years ago

Hi,

Many thanks for building this - it has been extremely useful.

I was wondering if it was possible to extract the individual plots (particularly the percentile plots) as images?

Many thanks, Ismail

msaifee786 commented 2 years ago

Hi Ismail, thanks for your email. Glad to hear its been of use. I'm happy to help anyway I can.

I'm curious - what application are you using the script for?

It likely is possible to extract the plots as images, but let me confirm with you to ensure I'm understanding correctly. Are you looking to extract the entire 10x10 grid (eg, the total dev or pattern dev percentile plots as a whole) or the individual plot element icons? Either one should be doable but would require a little modification of the code.

Thanks, Murtaza Saifee

On Thu, May 5, 2022 at 12:41 PM Ismail Moghul @.***> wrote:

Hi,

Many thanks for building this - it has been extremely useful.

I was wondering if it was possible to extract the individual plots (particularly the percentile plots) as images?

Many thanks, Ismail

— Reply to this email directly, view it on GitHub https://github.com/msaifee786/hvf_extraction_script/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHFGLBZG7I43J2J3ZJITMTVIQP47ANCNFSM5VGCITBQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

IsmailM commented 2 years ago

Hi Murtaza,

Many thanks for the swift reply.

We are using the script as part of our pipeline for VF data uploaded to a grading platform at Moorfields. Specifically, we use the script to ensure that users are uploading data with the correct strategy and then finally display the VF data in a custom format within a webpage.

I am able to extract the original plot images as follows:

from PIL import Image
Image.fromarray(hvf_obj.image).save("tmp/out/orig.jpeg")
Image.fromarray(hvf_obj.raw_value_array.plot_image).save("tmp/out/raw_value_array.jpeg")
Image.fromarray(hvf_obj.abs_dev_value_array.plot_image).save("tmp/out/abs_dev_value_array.jpeg")
Image.fromarray(hvf_obj.pat_dev_value_array.plot_image).save("tmp/out/pat_dev_value_array.jpeg")
Image.fromarray(hvf_obj.abs_dev_percentile_array.plot_image).save("tmp/out/abs_dev_percentile_array.jpeg")
Image.fromarray(hvf_obj.pat_dev_percentile_array.plot_image).save("tmp/out/pat_dev_percentile_array.jpeg")

I noticed that the hvf_object does not include the pattern sensitivity plots (i.e. the plot on the right below). Is this by design, or am I missing something?

image

msaifee786 commented 2 years ago

Hi Ismail, thanks for the info - very interesting! I've wanted to make a custom HVF viewer using this extraction tool; its nice to hear you are doing it at Moorfields.

Regarding the grayscale image, unfortunately the extraction script is not currently designed to extract it out separately. That being said, its shouldn't be that difficult (all the code is there). I am happy to help code this and include it in the extraction script for you but unfortunately it may need to wait a few months as my clinical schedule is quite busy at the moment.

Thanks, Murtaza

On Sat, May 7, 2022 at 6:16 AM Ismail Moghul @.***> wrote:

Hi Murtaza,

Many thanks for the swift reply.

We are using the script as part of our pipeline for VF data uploaded to a grading platform at Moorfields. Specifically, we use the script to ensure that users are uploading data with the correct strategy and then finally display the VF data in a custom format within a webpage.

I am able to extract the original plot images as follows:

from PIL import ImageImage.fromarray(hvf_obj.image).save("tmp/out/orig.jpeg")Image.fromarray(hvf_obj.raw_value_array.plot_image).save("tmp/out/raw_value_array.jpeg")Image.fromarray(hvf_obj.abs_dev_value_array.plot_image).save("tmp/out/abs_dev_value_array.jpeg")Image.fromarray(hvf_obj.pat_dev_value_array.plot_image).save("tmp/out/pat_dev_value_array.jpeg")Image.fromarray(hvf_obj.abs_dev_percentile_array.plot_image).save("tmp/out/abs_dev_percentile_array.jpeg")Image.fromarray(hvf_obj.pat_dev_percentile_array.plot_image).save("tmp/out/pat_dev_percentile_array.jpeg")

I noticed that the hvf_object does not include the pattern sensitivity plots (i.e. the plot on the right below). Is this by design, or am I missing something?

[image: image] https://user-images.githubusercontent.com/5578375/167255532-c373ae07-a6d2-4c14-a06c-c4e701d4b026.png

— Reply to this email directly, view it on GitHub https://github.com/msaifee786/hvf_extraction_script/issues/1#issuecomment-1120208296, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHFGLA7BPSBHS2XOYHJZ5TVIZUMVANCNFSM5VGCITBQ . You are receiving this because you commented.Message ID: @.***>