Coder Social home page Coder Social logo

medvisbonn / eyepy Goto Github PK

View Code? Open in Web Editor NEW
38.0 8.0 7.0 13.76 MB

A python package to read, analyse and visualize OCT and fundus data from various sources.

Home Page: https://medvisbonn.github.io/eyepy/

License: MIT License

Python 100.00%
oct heyex heidelberg localizer fundus enface nir amd drusen etdrs

eyepy's Introduction

eyepy

Use Python to import, analyse and visualize retinal imaging data.

header_gif

Documentation PyPI version DOI

The eyepy python package provides a simple interface to import and process OCT volumes. Everything you import with one of our import functions becomes an EyeVolume object which provides a unified interface to the data. The EyeVolume object provides methods to plot the localizer (fundus) image and B-scans as well as to compute and plot quantifications of voxel annotations such as drusen. Check out the documentation, especially the Cookbook chapter, for more information.

Features

  • Import Data (Heyex-E2E, Heyex-VOL, Heyex-XML, Topcon-FDA, B-Scan collections, RETOUCH Challenge, AMD Dataset from Duke University)
  • Analyze OCT volumes (compute and quantify drusen)
  • Visualize OCT volumes with annotations and quantifications
  • Save and load EyeVolume objects

Getting Started

Installation

Attention: If you want to use a version prior to 0.12.0 you have to install from the eyepie name instead. This is because we used eyepie as a package name on PyPI until the previous owner of the eyepy name on PyPI was so kind to transfer it to us.

To install the latest version of eyepy run pip install -U eyepy. (It is eyepie for versions < 0.12.0)

Getting Started

When you don't hava a supported OCT volume at hand you can check out our sample dataset to get familiar with eyepy.

from eyepy.data import load
ev = load("drusen_patient")

If you have data at hand use one of eyepys import functions.

# Import HEYEX E2E export
ev = ep.import_heyex_e2e("path/to/file.e2e")
# Import HEYEX XML export
ev = ep.import_heyex_xml("path/to/folder")
# Import HEYEX VOL export
ev = ep.import_heyex_vol("path/to/file.vol")
# Import Topcon FDA export
ev = ep.import_topcon_fda("path/to/file.fda")
# Import volume from Duke public dataset
ev = ep.import_duke_mat("path/to/file.mat")
# Import volume form RETOUCH challenge
ev = ep.import_retouch("path/to/volume_folder")

Related Projects:

eyepy's People

Contributors

actions-user avatar drombas avatar oli4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eyepy's Issues

failed to install

  • eyepy version:latest
  • Python version:3.8.16
  • Operating System:Linux in docker container

Description

I try to install your library but I get:

note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> imagecodecs


note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

What I Did

pip install -U eyepie

Loading not equally spaced OCT volumes

Hi Olivier,

I'm working with a dataset that has a lot of not equally spaced OCTs. The current eyepy verson does not seem to support loading such volumes (in line 167 in eyepy/io/utils.py)

msg = "B-scans are not equally spaced. Data can not be imported."
raise ValueError(msg)

Is it possible to just set the spacing to a default number and still load the volume?
BTW, I've also been using the eyelab for segmentation, it works so well! It would also be great if you could provide an exe build that supports loading non-uniformly spaced volumes.

Thanks!

unable to load *.e2e file

  • eyepy version: latest
  • Python version: 3.10.0
  • Operating System: CentOS Linux 8 (Core)

Description

I tried to read my e2e file but I get the following error:

What I Did

import eyepy as ep
ev = ep.import_heyex_e2e("123456.E2E", single=False)

response:

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
Cell In[18], line 1
----> 1 ev = ep.import_heyex_e2e("76543017.E2E", single=False)

File /scratch/ag9454/conda-envs/ppml/lib/python3.10/site-packages/eyepy/io/__init__.py:34, in import_heyex_e2e(path, single)
     20 def import_heyex_e2e(path: Union[str, Path],
     21                      single=True) -> Union[EyeVolume, List[EyeVolume]]:
     22     """ Read a Heyex E2E file
     23 
     24     This function is a thin wrapper around the HeE2eReader class and
   (...)
     32 
     33     """
---> 34     return HeE2eReader(path, single=single).volume

File /scratch/ag9454/conda-envs/ppml/lib/python3.10/site-packages/eyepy/io/he/e2e_reader.py:108, in HeE2eReader.__init__(self, path, single)
    105 self._bscan_meta = None
    107 self._current_volume_index = 0
--> 108 self._sort_folders(self.current_volume_index)

File /scratch/ag9454/conda-envs/ppml/lib/python3.10/site-packages/eyepy/io/he/e2e_reader.py:130, in HeE2eReader._sort_folders(self, index)
    128 def _sort_folders(self, index):
    129     self._folders = defaultdict(list)
--> 130     for folder in self._single_volumes[index]:
    131         t = folder.header.type
    132         s = "enface" if folder.header.ind == 0 else "bscan"

IndexError: list index out of range

I tried also:

from eyepy.data import load
# Import HEYEX XML export
ev = load("drusen_patient")

response:

B-scans are not equally spaced. Projections into the enface space are distorted.

What might be the problem??

Not fully understand scale_x means.

  • eyepy version:0.12.1
  • Python version:3.8
  • Operating System:win11

Description

I want to get the scale_x of oct image, so that i can get the true size of oct (not in pixels)

I notice that in https://medvisbonn.github.io/eyepy/formats/he_e2e_types/Type10004/ it has scale_x and i tried it into on of my e2e file.
I'm pretty sure it's nothing like scalue_y ,which means pixel size * scale_y can get the true size.

1024 * 0.9146999716758728 is not 5.9 mm

so what's this scale_x means, and is there any chance i can get true x for e2e file.

OCT data post-processing

Dear Morelle,

Thanks for building this useful packages for OCT data analysis.
I wonder what post processing the packages is using after reading the raw data volumes. It looks different from the results generated by just octs = np.sqrt(np.sqrt(octs)) and octs[octs>1] = 0. I find one post porcessing here

def _data_processing(self, data):
but is this all? I hope to figure out this since I need to read OCTA data which may need a different post processing.

BTW, do you have any idea about the projection artifacts removal step, a post processing for OCTA data?

Thanks and looking forward to your reply!

Getting error while reading .vol file

  • eyepy version: 0.3.6
  • Python version: 3.7.1
  • Operating System: windows 10

Description

I am trying to read meta data information from .vol file but it gives error "buffer is too small for requested array"
I have also attached the screen shot of the error.

Could please help why i am getting this error ?

Thanks,
Naveed

error reading vol

[Bug] Bscans and segmentation displayed incorrectly

  • eyepy version: 0.7.0
  • Python version: 3.8.10
  • Operating System: Linux-5.10.147+-x86_64-with-glibc2.29

Description

Hi there. I am testing the package a bit to get an idea of how it works.
When plotting B-scans with segmentation overlay the boundaries do not match.
It seems that what happens is that segmentation and B-scans are stored with different orders.

What I Did

image

Disable motion correction

Hi, I wonder if there is a way to load the bscans & layer segmentation data without performing motion correction via affine transformation?

Installation problems on Google Colab

  • eyepy version: 0.4.0
  • Python version: 3.8.10
  • Operating System: Linux-5.10.147+-x86_64-with-glibc2.29

Description

Hi! I tried installing eyepy in a fresh Google Colab notebook but I got some dependency error.
Not sure if it is related to Google Colab or eyepy but it may be similar to #8 .
I think I tested the same thing with the previous eyepy version and it worked fine.
image

Here is the link to the notebook.

Exporting data

Hello together,

thank you for your repository. It seems to work well for extracting .vol data.

We plan to export our data to another file format such as Nifti, Dicom or raw/mhd. Are you aware of functions to convert EyeVolume data into another format?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.